summaryrefslogtreecommitdiffstats
path: root/editor/libeditor/HTMLEditorDataTransfer.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/HTMLEditorDataTransfer.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/HTMLEditorDataTransfer.cpp')
-rw-r--r--editor/libeditor/HTMLEditorDataTransfer.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/editor/libeditor/HTMLEditorDataTransfer.cpp b/editor/libeditor/HTMLEditorDataTransfer.cpp
index ed350c0dd..c56fbead7 100644
--- a/editor/libeditor/HTMLEditorDataTransfer.cpp
+++ b/editor/libeditor/HTMLEditorDataTransfer.cpp
@@ -1538,6 +1538,13 @@ HTMLEditor::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;