From fe2421f13570f39a7a43c0dbb482b94c825c4fda Mon Sep 17 00:00:00 2001 From: FredKiefer Date: Tue, 24 Jun 2003 22:57:12 +0000 Subject: [PATCH] Corrected handling of pasteboard data of type NSFilenamesPboardType. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@17015 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 6 ++++++ Source/NSImage.m | 7 +++++-- Source/NSView.m | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index c494b3b7c..acdf2ad87 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-06-25 Fred Kiefer + + * Source/NSImage.m (initWithPasteboard:): + * Source/NSView.m (dragFile:fromRect:slideBack:event:): + Corrected handling of pasteboard data of type NSFilenamesPboardType. + 2003-06-24 01:05 Alexander Malmberg * Source/NSTabViewItem.m (-drawLabel:inRect:): Update for change diff --git a/Source/NSImage.m b/Source/NSImage.m index dd182d426..3499cdb09 100644 --- a/Source/NSImage.m +++ b/Source/NSImage.m @@ -400,9 +400,12 @@ repd_for_rep(NSArray *_reps, NSImageRep *rep) [self addRepresentations: reps]; else { - NSString* file = [pasteboard propertyListForType: NSFilenamesPboardType]; + NSArray *array = [pasteboard propertyListForType: NSFilenamesPboardType]; + NSString* file; - if (file != nil || ![self _loadFromFile: file]) + if ((array == nil) || ([array count] == 0) || + (file = [array objectAtIndex: 0]) == nil || + ![self _loadFromFile: file]) { RELEASE(self); return nil; diff --git a/Source/NSView.m b/Source/NSView.m index c530d5408..9c13a7f6d 100644 --- a/Source/NSView.m +++ b/Source/NSView.m @@ -2920,7 +2920,7 @@ static NSView* findByTag(NSView *view, int aTag, unsigned *level) [pboard declareTypes: [NSArray arrayWithObject: NSFilenamesPboardType] owner: self]; - if (![pboard setPropertyList: filename + if (![pboard setPropertyList: [NSArray arrayWithObject: filename] forType: NSFilenamesPboardType]) return NO;