Commit 7957a03b authored by bdakin's avatar bdakin

Reviewed by Geoff.

        Fix for http://bugs.webkit.org/show_bug.cgi?id=13088 REGRESSION
        (r19761-19779): Copy image no longer includes image address 
        (rdar://5067927)

        writeURL() does not need an isImage parameter. Now that it accepts 
        the types as a parameter, we can just declare the appropriate image 
        types within writeImage and send them to writeURL(). Also, 
        declaring the types twice is what broke this.

        * platform/Pasteboard.h:
        * platform/mac/PasteboardMac.mm:
        (WebCore::Pasteboard::writeURL):
        (WebCore::Pasteboard::writeImage):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@20233 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent e7b8679c
2007-03-15 Beth Dakin <bdakin@apple.com>
Reviewed by Geoff.
Fix for http://bugs.webkit.org/show_bug.cgi?id=13088 REGRESSION
(r19761-19779): Copy image no longer includes image address
(rdar://5067927)
writeURL() does not need an isImage parameter. Now that it accepts
the types as a parameter, we can just declare the appropriate image
types within writeImage and send them to writeURL(). Also,
declaring the types twice is what broke this.
* platform/Pasteboard.h:
* platform/mac/PasteboardMac.mm:
(WebCore::Pasteboard::writeURL):
(WebCore::Pasteboard::writeImage):
2007-03-15 Adele Peterson <adele@apple.com>
Reviewed by Kevin Decker.
......
......@@ -68,12 +68,12 @@ public:
#if PLATFORM(MAC)
//Helper functions to allow Clipboard to share code
static void writeSelection(NSPasteboard* pasteboard, Range* selectedRange, bool canSmartCopyOrDelete, Frame* frame);
static void writeURL(NSPasteboard* pasteboard, NSArray* types, const KURL& url, const String& titleStr, Frame* frame, bool isImage = false);
static void writeURL(NSPasteboard* pasteboard, NSArray* types, const KURL& url, const String& titleStr, Frame* frame);
#endif
static Pasteboard* generalPasteboard();
void writeSelection(Range*, bool canSmartCopyOrDelete, Frame*);
void writeURL(const KURL&, const String&, Frame* = 0, bool isImage = false);
void writeURL(const KURL&, const String&, Frame* = 0);
void writeImage(const HitTestResult&);
#if PLATFORM(MAC)
void writeFileWrapperAsRTFDAttachment(NSFileWrapper*);
......
......@@ -200,16 +200,13 @@ void Pasteboard::writeSelection(Range* selectedRange, bool canSmartCopyOrDelete,
Pasteboard::writeSelection(m_pasteboard, selectedRange, canSmartCopyOrDelete, frame);
}
void Pasteboard::writeURL(NSPasteboard* pasteboard, NSArray* types, const KURL& url, const String& titleStr, Frame* frame, bool isImage)
void Pasteboard::writeURL(NSPasteboard* pasteboard, NSArray* types, const KURL& url, const String& titleStr, Frame* frame)
{
if (WebArchivePboardType == nil)
Pasteboard::generalPasteboard(); //Initialises pasteboard types
if (types == nil) {
if (isImage)
types = writableTypesForImage();
else
types = writableTypesForURL();
types = writableTypesForURL();
[pasteboard declareTypes:types owner:nil];
}
......@@ -240,9 +237,9 @@ void Pasteboard::writeURL(NSPasteboard* pasteboard, NSArray* types, const KURL&
[pasteboard setString:userVisibleString forType:NSStringPboardType];
}
void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame, bool isImage)
void Pasteboard::writeURL(const KURL& url, const String& titleStr, Frame* frame)
{
Pasteboard::writeURL(m_pasteboard, nil, url, titleStr, frame, isImage);
Pasteboard::writeURL(m_pasteboard, nil, url, titleStr, frame);
}
static NSFileWrapper* fileWrapperForImage(CachedResource* resource, NSURL *URL)
......@@ -285,9 +282,9 @@ void Pasteboard::writeImage(const HitTestResult& result)
NSString *title = result.altDisplayString().isNull() ? nil : (NSString*)(result.altDisplayString());
Frame* frame = node->document()->frame();
writeURL(URL, title, frame, true);
NSArray *types = [m_pasteboard types];
NSArray* types = writableTypesForImage();
[m_pasteboard declareTypes:types owner:nil];
writeURL(m_pasteboard, types, URL, title, frame);
Image* coreImage = result.image();
ASSERT(coreImage);
......
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