Camino only - Bug 401531: Look for urln on the pasteboard if urld isn't available. r=froodian sr=pink

This commit is contained in:
stuart.morgan%alumni.case.edu 2007-11-03 19:56:51 +00:00
Родитель b4d7c68da3
Коммит efa5ac10aa
1 изменённых файлов: 13 добавлений и 12 удалений

Просмотреть файл

@ -198,23 +198,24 @@ NSString* const kWebURLsWithTitlesPboardType = @"WebURLsWithTitlesPboardType";
}
} else if ([types containsObject:NSURLPboardType]) {
*outUrls = [NSArray arrayWithObject:[[NSURL URLFromPasteboard:self] absoluteString]];
if ([types containsObject:kCorePasteboardFlavorType_urld]) {
NSString* title = [self stringForType:kCorePasteboardFlavorType_urld];
if (!title)
title = [self stringForType:NSStringPboardType];
if (title)
*outTitles = [NSArray arrayWithObject:title];
}
else
*outTitles = [NSArray arrayWithObject:@""];
NSString* title = nil;
if ([types containsObject:kCorePasteboardFlavorType_urld])
title = [self stringForType:kCorePasteboardFlavorType_urld];
if (!title && [types containsObject:kCorePasteboardFlavorType_urln])
title = [self stringForType:kCorePasteboardFlavorType_urln];
if (!title && [types containsObject:NSStringPboardType])
title = [self stringForType:NSStringPboardType];
*outTitles = [NSArray arrayWithObject:(title ? title : @"")];
} else if ([types containsObject:NSStringPboardType]) {
NSURL* testURL = [NSURL URLWithString:[self stringForType:NSStringPboardType]];
if (testURL) {
*outUrls = [NSArray arrayWithObject:[self stringForType:NSStringPboardType]];
NSString* title = nil;
if ([types containsObject:kCorePasteboardFlavorType_urld])
*outTitles = [NSArray arrayWithObject:[self stringForType:kCorePasteboardFlavorType_urld]];
else
*outTitles = [NSArray arrayWithObject:@""];
title = [self stringForType:kCorePasteboardFlavorType_urld];
if (!title && [types containsObject:kCorePasteboardFlavorType_urln])
title = [self stringForType:kCorePasteboardFlavorType_urln];
*outTitles = [NSArray arrayWithObject:(title ? title : @"")];
} else {
// The string doesn't look like a URL - return empty arrays
*outUrls = [NSArray array];