Fix bug 448058 - 'Bookmark bar -> Copy Information to Clipboard -> Mail fails' and bug 491448 - 'Copy Link/Image Location does not paste into Pages or RTF Mail message' by setting a non-empty title string in WebURLsWithTitlesPboardType. Patch by Christopher Henderson <trendyhendy2000@gmail.com>, r=cl, r=me, sr=smorgan
git-svn-id: svn://10.0.0.236/trunk@258314 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
6cb4f87a9f
commit
1abce6e4ca
@ -111,7 +111,7 @@ NSString* const kWebURLsWithTitlesPboardType = @"WebURLsWithTitlesPboardType";
|
||||
if (!inTitles) {
|
||||
NSMutableArray* tmpTitleArray = [NSMutableArray arrayWithCapacity:urlCount];
|
||||
for (unsigned int i = 0; i < urlCount; ++i)
|
||||
[tmpTitleArray addObject:@""];
|
||||
[tmpTitleArray addObject:[inUrls objectAtIndex:i]];
|
||||
inTitles = tmpTitleArray;
|
||||
}
|
||||
|
||||
@ -133,11 +133,8 @@ NSString* const kWebURLsWithTitlesPboardType = @"WebURLsWithTitlesPboardType";
|
||||
[self setPropertyList:clipboardData forType:kWebURLsWithTitlesPboardType];
|
||||
|
||||
if (urlCount == 1) {
|
||||
NSString* title = @"";
|
||||
if (inTitles)
|
||||
title = [inTitles objectAtIndex:0];
|
||||
|
||||
NSString* url = [inUrls objectAtIndex:0];
|
||||
NSString* title = [inTitles objectAtIndex:0];
|
||||
|
||||
[[NSURL URLWithString:url] writeToPasteboard:self];
|
||||
[self setString:url forType:NSStringPboardType];
|
||||
@ -159,7 +156,7 @@ NSString* const kWebURLsWithTitlesPboardType = @"WebURLsWithTitlesPboardType";
|
||||
// there is data there, but get nothing
|
||||
|
||||
NSString* firstURL = [inUrls objectAtIndex:0];
|
||||
NSString* firstTitle = ([inTitles count] > 0) ? [inTitles objectAtIndex:0] : @"";
|
||||
NSString* firstTitle = [inTitles objectAtIndex:0];
|
||||
|
||||
const char* tempCString = [firstURL UTF8String];
|
||||
[self setData:[NSData dataWithBytes:tempCString length:strlen(tempCString)] forType:kCorePasteboardFlavorType_url];
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user