summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/TextEditorDataTransfer.cpp
diff options
context:
space:
mode:
authorjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-20 22:54:26 +0200
committerjanekptacijarabaci <janekptacijarabaci@seznam.cz>2018-04-20 22:54:26 +0200
commit4549256c2b685782587f2ccad6a105c0392492c7 (patch)
treeb4364b3e0c84ed2c812158e89054e2c57b47f962 /editor/libeditor/TextEditorDataTransfer.cpp
parent20a3f8c006445b176fa8559f6529c2cf3cb75b0d (diff)
downloadUXP-4549256c2b685782587f2ccad6a105c0392492c7.tar
UXP-4549256c2b685782587f2ccad6a105c0392492c7.tar.gz
UXP-4549256c2b685782587f2ccad6a105c0392492c7.tar.lz
UXP-4549256c2b685782587f2ccad6a105c0392492c7.tar.xz
UXP-4549256c2b685782587f2ccad6a105c0392492c7.zip
moebius#56: Fix: DataTransfer - Pasting image from clipboard fails in some cases
https://github.com/MoonchildProductions/moebius/pull/56
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;