Commit 579abbb5 authored by bweinstein@apple.com's avatar bweinstein@apple.com

2009-06-16 Brian Weinstein <bweinstein@apple.com>

        Reviewed by Adele Peterson.

        Fix of <rdar://6967547> Ctrl-C copies null value erasing text in clipboard in Safari.
        This patch kept the way events were firing as they were before, and Windows events are
        consistent with Mac.       

        * editing/Editor.cpp:
        (WebCore::Editor::tryDHTMLCopy): Added check for canCopy() before clearing PasteBoard
        (WebCore::Editor::tryDHTMLCut): Added check for canCut() before clearing PasteBoard



git-svn-id: http://svn.webkit.org/repository/webkit/trunk@44750 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 317d75c6
2009-06-16 Brian Weinstein <bweinstein@apple.com>
Reviewed by Adele Peterson.
Fix of <rdar://6967547> Ctrl-C copies null value erasing text in clipboard in Safari.
This patch kept the way events were firing as they were before, and Windows events are
consistent with Mac.
* editing/Editor.cpp:
(WebCore::Editor::tryDHTMLCopy): Added check for canCopy() before clearing PasteBoard
(WebCore::Editor::tryDHTMLCut): Added check for canCut() before clearing PasteBoard
2009-06-16 Antti Koivisto <antti@apple.com>
Reviewed by Brady Eidson.
......
......@@ -340,9 +340,10 @@ bool Editor::tryDHTMLCopy()
if (m_frame->selection()->isInPasswordField())
return false;
// Must be done before oncopy adds types and data to the pboard,
// also done for security, as it erases data from the last copy/paste.
Pasteboard::generalPasteboard()->clear();
if (canCopy())
// Must be done before oncopy adds types and data to the pboard,
// also done for security, as it erases data from the last copy/paste.
Pasteboard::generalPasteboard()->clear();
return !dispatchCPPEvent(eventNames().copyEvent, ClipboardWritable);
}
......@@ -351,10 +352,11 @@ bool Editor::tryDHTMLCut()
{
if (m_frame->selection()->isInPasswordField())
return false;
// Must be done before oncut adds types and data to the pboard,
// also done for security, as it erases data from the last copy/paste.
Pasteboard::generalPasteboard()->clear();
if (canCut())
// Must be done before oncut adds types and data to the pboard,
// also done for security, as it erases data from the last copy/paste.
Pasteboard::generalPasteboard()->clear();
return !dispatchCPPEvent(eventNames().cutEvent, ClipboardWritable);
}
......
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