[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
cblu
cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:09:07 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 01f3c7eefb545eb389a12b38c9d96339c61b3c0f
Author: cblu <cblu at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Nov 4 01:48:06 2003 +0000
Fixed:
<rdar://problem/3472377>: Provide NSRTFDPboardType on pasteboard when copying or dragging images
<rdar://problem/3470809>: REGRESSION (111-112): Can't copy & paste image into Photoshop 7
Reviewed by hyatt.
* Misc.subproj/WebNSPasteboardExtras.h:
* Misc.subproj/WebNSPasteboardExtras.m:
(-[NSPasteboard _web_writeFileDataAsRTFDAttachment:withFilename:]): renamed, now writes file data as an RTF attachment
* Misc.subproj/WebNSViewExtras.m:
(-[NSView _web_dragImage:originalData:rect:URL:title:event:]): call renamed _web_writeFileDataAsRTFDAttachment
* WebView.subproj/WebDefaultContextMenuDelegate.m:
(-[WebDefaultUIDelegate copyImageToClipboard:]): call renamed _web_writeFileDataAsRTFDAttachment
* WebView.subproj/WebImageView.m:
(-[WebImageView writeImageToPasteboard:]): call renamed _web_writeFileDataAsRTFDAttachment
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5378 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d91c39f..3b97c8a 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,21 @@
+2003-11-03 Chris Blumenberg <cblu at apple.com>
+
+ Fixed:
+ <rdar://problem/3472377>: Provide NSRTFDPboardType on pasteboard when copying or dragging images
+ <rdar://problem/3470809>: REGRESSION (111-112): Can't copy & paste image into Photoshop 7
+
+ Reviewed by hyatt.
+
+ * Misc.subproj/WebNSPasteboardExtras.h:
+ * Misc.subproj/WebNSPasteboardExtras.m:
+ (-[NSPasteboard _web_writeFileDataAsRTFDAttachment:withFilename:]): renamed, now writes file data as an RTF attachment
+ * Misc.subproj/WebNSViewExtras.m:
+ (-[NSView _web_dragImage:originalData:rect:URL:title:event:]): call renamed _web_writeFileDataAsRTFDAttachment
+ * WebView.subproj/WebDefaultContextMenuDelegate.m:
+ (-[WebDefaultUIDelegate copyImageToClipboard:]): call renamed _web_writeFileDataAsRTFDAttachment
+ * WebView.subproj/WebImageView.m:
+ (-[WebImageView writeImageToPasteboard:]): call renamed _web_writeFileDataAsRTFDAttachment
+
2003-11-03 Vicki Murley <vicki at apple.com>
Reviewed by kocienda.
diff --git a/WebKit/Misc.subproj/WebNSPasteboardExtras.h b/WebKit/Misc.subproj/WebNSPasteboardExtras.h
index 60028b3..696f359 100644
--- a/WebKit/Misc.subproj/WebNSPasteboardExtras.h
+++ b/WebKit/Misc.subproj/WebNSPasteboardExtras.h
@@ -40,8 +40,8 @@ extern NSString *WebURLNamePboardType;
// Sets the text on the NSFindPboard. Returns the new changeCount for the NSFindPboard.
+ (int)_web_setFindPasteboardString:(NSString *)string withOwner:(id)owner;
-// Writes file contents data to the pasteboard and specifies a filename.
-// NSFileContentsPboardType must be declared on the pasteboard before calling this method.
-- (void)_web_writeFileContents:(NSData *)data withFilename:(NSString *)filename;
+// Writes file contents data to the pasteboard as an RTFD attachment.
+// NSRTFDPboardType must be declared on the pasteboard before calling this method.
+- (void)_web_writeFileDataAsRTFDAttachment:(NSData *)data withFilename:(NSString *)filename;
@end
diff --git a/WebKit/Misc.subproj/WebNSPasteboardExtras.m b/WebKit/Misc.subproj/WebNSPasteboardExtras.m
index c15a7ef..57e57a1 100644
--- a/WebKit/Misc.subproj/WebNSPasteboardExtras.m
+++ b/WebKit/Misc.subproj/WebNSPasteboardExtras.m
@@ -133,12 +133,19 @@ NSString *WebURLNamePboardType = nil;
return [findPasteboard changeCount];
}
-- (void)_web_writeFileContents:(NSData *)data withFilename:(NSString *)filename
+- (void)_web_writeFileDataAsRTFDAttachment:(NSData *)data withFilename:(NSString *)filename
{
NSFileWrapper *wrapper = [[NSFileWrapper alloc] initRegularFileWithContents:data];
[wrapper setPreferredFilename:filename];
- [self writeFileWrapper:wrapper];
+
+ NSTextAttachment *attachment = [[NSTextAttachment alloc] initWithFileWrapper:wrapper];
[wrapper release];
+
+ NSAttributedString *string = [NSAttributedString attributedStringWithAttachment:attachment];
+ [attachment release];
+
+ NSData *RTFDData = [string RTFDFromRange:NSMakeRange(0, [string length]) documentAttributes:nil];
+ [self setData:RTFDData forType:NSRTFDPboardType];
}
@end
diff --git a/WebKit/Misc.subproj/WebNSViewExtras.m b/WebKit/Misc.subproj/WebNSViewExtras.m
index 60e72fb..8a70b4c 100644
--- a/WebKit/Misc.subproj/WebNSViewExtras.m
+++ b/WebKit/Misc.subproj/WebNSViewExtras.m
@@ -228,11 +228,11 @@
NSMutableArray *types = [NSMutableArray arrayWithObjects:NSFilesPromisePboardType, NSTIFFPboardType, nil];
[types addObjectsFromArray:[NSPasteboard _web_writableDragTypesForURL]];
if (originalData) {
- [types insertObject:NSFileContentsPboardType atIndex:0];
+ [types insertObject:NSRTFDPboardType atIndex:0];
}
[pboard _web_writeURL:URL andTitle:title withOwner:self types:types];
if (originalData) {
- [pboard _web_writeFileContents:originalData withFilename:filename];
+ [pboard _web_writeFileDataAsRTFDAttachment:originalData withFilename:filename];
}
[pboard setPropertyList:filesTypes forType:NSFilesPromisePboardType];
[pboard setData:[image TIFFRepresentation] forType:NSTIFFPboardType];
diff --git a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
index 10b7770..615711f 100644
--- a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
@@ -180,11 +180,11 @@
NSCachedURLResponse *cachedResponse = [webView _cachedResponseForURL:[element objectForKey:WebElementImageURLKey]];
NSData *data = [cachedResponse data];
if (data) {
- [types insertObject:NSFileContentsPboardType atIndex:0];
+ [types insertObject:NSRTFDPboardType atIndex:0];
}
[pasteboard declareTypes:types owner:nil];
if (data) {
- [pasteboard _web_writeFileContents:data withFilename:[[cachedResponse response] suggestedFilename]];
+ [pasteboard _web_writeFileDataAsRTFDAttachment:data withFilename:[[cachedResponse response] suggestedFilename]];
}
[pasteboard setData:[[element objectForKey:WebElementImageKey] TIFFRepresentation] forType:NSTIFFPboardType];
}
diff --git a/WebKit/WebView.subproj/WebImageView.m b/WebKit/WebView.subproj/WebImageView.m
index 0796844..8e23152 100644
--- a/WebKit/WebView.subproj/WebImageView.m
+++ b/WebKit/WebView.subproj/WebImageView.m
@@ -188,8 +188,8 @@
- (BOOL)writeImageToPasteboard:(NSPasteboard *)pasteboard
{
if ([self haveCompleteImage]) {
- [pasteboard declareTypes:[NSArray arrayWithObjects:NSFileContentsPboardType, NSTIFFPboardType, nil] owner:nil];
- [pasteboard _web_writeFileContents:[rep data] withFilename:[rep filename]];
+ [pasteboard declareTypes:[NSArray arrayWithObjects:NSRTFDPboardType, NSTIFFPboardType, nil] owner:nil];
+ [pasteboard _web_writeFileDataAsRTFDAttachment:[rep data] withFilename:[rep filename]];
[pasteboard setData:[[rep image] TIFFRepresentation] forType:NSTIFFPboardType];
return YES;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list