Author: fabien
Date: 2012-04-20 20:41:36 -0700 (Fri, 20 Apr 2012)
New Revision: 9364
Log:
Applying recent STR fixes to 3.0

Modified:
   branches/branch-3.0/fluid/Fl_Type.cxx
   branches/branch-3.0/src/fltk3/TextDisplay.cxx

Modified: branches/branch-3.0/fluid/Fl_Type.cxx
===================================================================
--- branches/branch-3.0/fluid/Fl_Type.cxx       2012-04-21 03:17:40 UTC (rev 
9363)
+++ branches/branch-3.0/fluid/Fl_Type.cxx       2012-04-21 03:41:36 UTC (rev 
9364)
@@ -654,9 +654,9 @@
   undo_checkpoint();
   int length = 0;
   if (n) { // see if blank, strip leading & trailing blanks
-    if (!nostrip) while (isspace(*n)) n++;
+    if (!nostrip) while (isspace((int)*n)) n++;
     const char *e = n + strlen(n);
-    if (!nostrip) while (e > n && isspace(*(e-1))) e--;
+    if (!nostrip) while (e > n && isspace((int)*(e-1))) e--;
     length = e-n;
     if (!length) n = 0;
   }    

Modified: branches/branch-3.0/src/fltk3/TextDisplay.cxx
===================================================================
--- branches/branch-3.0/src/fltk3/TextDisplay.cxx       2012-04-21 03:17:40 UTC 
(rev 9363)
+++ branches/branch-3.0/src/fltk3/TextDisplay.cxx       2012-04-21 03:41:36 UTC 
(rev 9364)
@@ -822,16 +822,13 @@
   
   /* If position is not displayed, return false */
   if (pos < mFirstChar || (pos > mLastChar && !empty_vlines())) {
-    return 0;
+    return *X=*Y=0;
   }
   
   /* Calculate Y coordinate */
-  if (!position_to_line(pos, &visLineNum)) {
-    return 0;
+  if (!position_to_line(pos, &visLineNum) || visLineNum < 0 || visLineNum > 
mNBufferLines) {
+    return *X=*Y=0;
   }
-  if (visLineNum < 0 || visLineNum > mNBufferLines) {
-    return 0;
-  }
   
   fontHeight = mMaxsize;
   *Y = text_area.y + visLineNum * fontHeight;
@@ -3478,10 +3475,12 @@
                  text_area.h);
     
     int X, Y;
-    if (position_to_xy(mCursorPos, &X, &Y)) draw_cursor(X, Y);
+    if (position_to_xy(mCursorPos, &X, &Y)) {
+      draw_cursor(X, Y);
+      mCursorOldY = Y;
+    }
     //    else puts("position_to_xy() failed - unable to draw cursor!");
     //printf("drew cursor at pos: %d (%d,%d)\n", mCursorPos, X, Y);
-    mCursorOldY = Y;
     fltk3::pop_clip();
   }
   fltk3::pop_clip();

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to