summaryrefslogtreecommitdiffstats
path: root/third_party/mozilla
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-15 18:15:55 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-15 18:15:55 +0000
commit8aa0f562f0e4a7519bd0f71e078a75f81c15d056 (patch)
tree33844551714b4b898d65943a13aa9d9d22d26afd /third_party/mozilla
parentc5ae74ab1f13a54c7f2bd9578848c65cb2f402bf (diff)
downloadchromium_src-8aa0f562f0e4a7519bd0f71e078a75f81c15d056.zip
chromium_src-8aa0f562f0e4a7519bd0f71e078a75f81c15d056.tar.gz
chromium_src-8aa0f562f0e4a7519bd0f71e078a75f81c15d056.tar.bz2
Mac: sync with upstream (Camino) NSPasteboard+Utils.mm
The upstream commit message is: 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 BUG=none (probably *something*, but what?) TEST=trybots, unit tests, everything still works Review URL: http://codereview.chromium.org/1545040 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44669 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'third_party/mozilla')
-rw-r--r--third_party/mozilla/NSPasteboard+Utils.mm9
1 files changed, 3 insertions, 6 deletions
diff --git a/third_party/mozilla/NSPasteboard+Utils.mm b/third_party/mozilla/NSPasteboard+Utils.mm
index 2a7ee5e..255566e0 100644
--- a/third_party/mozilla/NSPasteboard+Utils.mm
+++ b/third_party/mozilla/NSPasteboard+Utils.mm
@@ -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];