Author: manolo
Date: 2010-12-10 09:52:14 -0800 (Fri, 10 Dec 2010)
New Revision: 8000
Log:
Fix the MSWindows part of STR #2472. DnD now works well with UTF-8 data
between FLTK and other apps in both directions.

Modified:
   branches/branch-1.3/src/fl_dnd_win32.cxx

Modified: branches/branch-1.3/src/fl_dnd_win32.cxx
===================================================================
--- branches/branch-1.3/src/fl_dnd_win32.cxx    2010-12-10 16:57:23 UTC (rev 
7999)
+++ branches/branch-1.3/src/fl_dnd_win32.cxx    2010-12-10 17:52:14 UTC (rev 
8000)
@@ -172,6 +172,14 @@
     HWND hwnd = fl_xid( (Fl_Window*)w );
     if (fillCurrentDragData(data)) {
       int old_event = Fl::e_number;
+      char *a, *b;
+      a = b = Fl::e_text;
+      while (*a) { // strip the CRLF pairs
+       if (*a == '\r' && a[1] == '\n') a++;
+       else *b++ = *a++;
+      }
+      *b = 0;
+      Fl::e_length = b - Fl::e_text;
       Fl::belowmouse()->handle(Fl::e_number = FL_PASTE); // e_text will be 
invalid after this call
       Fl::e_number = old_event;
       SetForegroundWindow( hwnd );

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

Reply via email to