Commit 914b6e5d authored by cblu's avatar cblu

Fixed: 3100597 - repro NSArray exception using contextual menu

        * Misc.subproj/WebNSPasteboardExtras.m:
        (-[NSPasteboard _web_writeURL:andTitle:withOwner:]): more error checking


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2759 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 091be39c
2002-11-19 Chris Blumenberg <cblu@apple.com>
Fixed: 3100597 - repro NSArray exception using contextual menu
* Misc.subproj/WebNSPasteboardExtras.m:
(-[NSPasteboard _web_writeURL:andTitle:withOwner:]): more error checking
2002-11-19 Trey Matteson <trey@apple.com>
Just a tweak to the description printout.
......
2002-11-19 Chris Blumenberg <cblu@apple.com>
Fixed: 3100597 - repro NSArray exception using contextual menu
* Misc.subproj/WebNSPasteboardExtras.m:
(-[NSPasteboard _web_writeURL:andTitle:withOwner:]): more error checking
2002-11-19 Trey Matteson <trey@apple.com>
Just a tweak to the description printout.
......
......@@ -10,6 +10,7 @@
#import <WebKit/WebNSPasteboardExtras.h>
#import <WebKit/WebURLsWithTitles.h>
#import <WebFoundation/WebAssertions.h>
#import <WebFoundation/WebNSStringExtras.h>
#import <WebFoundation/WebNSURLExtras.h>
......@@ -65,16 +66,22 @@ -(NSURL *)_web_bestURL
- (void)_web_writeURL:(NSURL *)URL andTitle:(NSString *)title withOwner:(id)owner
{
ASSERT(URL);
NSArray *types = [NSArray arrayWithObjects:WebURLsWithTitlesPboardType, NSURLPboardType, NSStringPboardType, nil];
[self declareTypes:types owner:owner];
[URL writeToPasteboard:self];
[self setString:[URL absoluteString] forType:NSStringPboardType];
[WebURLsWithTitles writeURLs:[NSArray arrayWithObject:URL] andTitles:[NSArray arrayWithObject:title] toPasteboard:self];
[self setString:[URL absoluteString] forType:WebURLPboardType];
NSArray *titles = nil;
if(title && ![title isEqualToString:@""]){
titles = [NSArray arrayWithObject:title];
[self setString:title forType:WebURLNamePboardType];
}
[WebURLsWithTitles writeURLs:[NSArray arrayWithObject:URL] andTitles:titles toPasteboard:self];
[self setString:[URL absoluteString] forType:WebURLPboardType];
}
@end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment