summaryrefslogtreecommitdiff
path: root/src/Fl_cocoa.mm
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2015-01-28 17:05:29 +0000
committerManolo Gouy <Manolo>2015-01-28 17:05:29 +0000
commit64ffd414d6bbe05be33e7a6a1cf6028d5d883be6 (patch)
tree70bd2423eb64ab3ce3d4cd819d0532733c81b203 /src/Fl_cocoa.mm
parentb8b89178da6a1e0b6a555e9c463fc8c8bb0f8bd9 (diff)
Stop using dynamic_cast when performing text drag (Mac OS only).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10536 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_cocoa.mm')
-rw-r--r--src/Fl_cocoa.mm9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/Fl_cocoa.mm b/src/Fl_cocoa.mm
index 495806c97..0c1736a86 100644
--- a/src/Fl_cocoa.mm
+++ b/src/Fl_cocoa.mm
@@ -4001,7 +4001,12 @@ static NSImage *defaultDragImage(int *pwidth, int *pheight)
return image;
}
-int Fl::dnd(void)
+int Fl::dnd()
+{
+ return Fl_X::dnd(0);
+}
+
+int Fl_X::dnd(int use_selection)
{
CFDataRef text = CFDataCreate(kCFAllocatorDefault, (UInt8*)fl_selection_buffer[0], fl_selection_length[0]);
if (text==NULL) return false;
@@ -4018,7 +4023,7 @@ int Fl::dnd(void)
int width, height;
NSImage *image;
- if ( dynamic_cast<Fl_Input_*>(w) != NULL || dynamic_cast<Fl_Text_Display*>(w) != NULL) {
+ if (use_selection) {
fl_selection_buffer[0][ fl_selection_length[0] ] = 0;
image = imageFromText(fl_selection_buffer[0], &width, &height);
} else {