summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/TextEditorDataTransfer.cpp
diff options
context:
space:
mode:
authorMoonchild <mcwerewolf@gmail.com>2018-04-22 10:13:13 +0200
committerGitHub <noreply@github.com>2018-04-22 10:13:13 +0200
commitc74754d23864569956853c1f77a37275842b0fd0 (patch)
treec858bde1c123fd2c73935d8cb811a6be364daf81 /editor/libeditor/TextEditorDataTransfer.cpp
parentcbe93351ee1d924090fc689f85c657c3e1aac41d (diff)
parent306690e137c2bb031020ba3c2c1515ba731a23a5 (diff)
downloadUXP-c74754d23864569956853c1f77a37275842b0fd0.tar
UXP-c74754d23864569956853c1f77a37275842b0fd0.tar.gz
UXP-c74754d23864569956853c1f77a37275842b0fd0.tar.lz
UXP-c74754d23864569956853c1f77a37275842b0fd0.tar.xz
UXP-c74754d23864569956853c1f77a37275842b0fd0.zip
Merge pull request #225 from janekptacijarabaci/data-transfer_1
moebius#56: DataTransfer - Pasting image from clipboard fails in some cases
Diffstat (limited to 'editor/libeditor/TextEditorDataTransfer.cpp')
-rw-r--r--editor/libeditor/TextEditorDataTransfer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/libeditor/TextEditorDataTransfer.cpp b/editor/libeditor/TextEditorDataTransfer.cpp
index 0388aa4a8..2cc2906fa 100644
--- a/editor/libeditor/TextEditorDataTransfer.cpp
+++ b/editor/libeditor/TextEditorDataTransfer.cpp
@@ -383,6 +383,13 @@ TextEditor::CanPaste(int32_t aSelectionType,
NS_ENSURE_ARG_POINTER(aCanPaste);
*aCanPaste = false;
+ // Always enable the paste command when inside of a HTML or XHTML document.
+ nsCOMPtr<nsIDocument> doc = GetDocument();
+ if (doc && doc->IsHTMLOrXHTML()) {
+ *aCanPaste = true;
+ return NS_OK;
+ }
+
// can't paste if readonly
if (!IsModifiable()) {
return NS_OK;