mirror of
https://github.com/fltk/fltk.git
synced 2026-06-02 15:46:52 +08:00
Fix the MSWindows part of STR #2472. DnD now works well with UTF-8 data
between FLTK and other apps in both directions. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8000 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
@@ -172,6 +172,14 @@ public:
|
|||||||
HWND hwnd = fl_xid( (Fl_Window*)w );
|
HWND hwnd = fl_xid( (Fl_Window*)w );
|
||||||
if (fillCurrentDragData(data)) {
|
if (fillCurrentDragData(data)) {
|
||||||
int old_event = Fl::e_number;
|
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::belowmouse()->handle(Fl::e_number = FL_PASTE); // e_text will be invalid after this call
|
||||||
Fl::e_number = old_event;
|
Fl::e_number = old_event;
|
||||||
SetForegroundWindow( hwnd );
|
SetForegroundWindow( hwnd );
|
||||||
|
|||||||
Reference in New Issue
Block a user