Update "o" variable detection code to handle more cases (STR #1429)

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@5487 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Michael R Sweet
2006-09-24 19:24:12 +00:00
parent ad40154ca3
commit 174c006fd5
2 changed files with 28 additions and 16 deletions
+10 -10
View File
@@ -35,19 +35,19 @@ CHANGES IN FLTK 1.1.8
- Fixed Fl_Positioner callback when released (STR #1387)
- Fixed WIN32 zero size window issue (STR #1387)
- Fixed Sudoku window positioning (STR #1398)
- Fluid Code Declarations can now handle
C++ style comments (STR #1383)
- Fixed uninitialized data in OS X and WIN32
timout functions (STR #1374).
- Fixed speed issues when measuring text on OS X
with Quartz (STR #1386).
- Fluid Code Declarations can now handle C++ style
comments (STR #1383)
- Fixed uninitialized data in OS X and WIN32 timeout
functions (STR #1374).
- Fixed speed issues when measuring text on OS X with
Quartz (STR #1386).
- Fixed focus issues on OS X (STR #1377)
- Optional precission argument when storing floats or
doubles in a Preferences file (STR #1381)
- Fixed callback not called when using arrow keys
in Fl_Slider (STR #1333)
- Changing the shorcut of a widget in fluid now marks
the document as dirty (STR #1382)
- Fixed callback not called when using arrow keys in
Fl_Slider (STR #1333)
- Changing the shorcut of a widget in fluid now marks the
document as dirty (STR #1382)
- Fl_Text_Editor now correctly handles middle mouse
clicks (STR #1384)
- Added some GLUT4 functions (STR #1370)
+18 -6
View File
@@ -1985,12 +1985,24 @@ void Fl_Widget_Type::write_code1() {
if (!varused) {
for (int n=0; n < NUM_EXTRA_CODE; n++)
if (extra_code(n) && !isdeclare(extra_code(n)) &&
(ptr = strstr(extra_code(n), "o->")) != NULL &&
(ptr == extra_code(n) ||
(!isalnum(ptr[-1] & 255) && ptr[-1] != '_'))) {
varused = 1;
break;
if (extra_code(n) && !isdeclare(extra_code(n)))
{
int instring = 0;
int inname = 0;
for (ptr = extra_code(n); *ptr; ptr ++)
if (instring) {
if (*ptr == '\\') ptr++;
else if (*ptr == '\"') instring = 0;
} else if (inname && !isalnum(*ptr & 255)) inname = 0;
else if (*ptr == '\"') instring = 1;
else if (!strncmp(ptr, "o->", 3) || !strncmp(ptr, "o)", 2) ||
!strncmp(ptr, "o,", 2) || !strncmp(ptr, "o ", 2)) break;
else if (isalnum(*ptr & 255)) inname = 1;
if (*ptr) {
varused = 1;
break;
}
}
}