r13833 by cbradney - #8331 - Allow context menu to paste

scribus-commit scribus-commit at lists.scribus.net
Mon Aug 10 21:10:41 CEST 2009


Revision: 13833
Author: cbradney
Date: 2009-08-10T19:07:24.006297Z
Commit message: #8331 - Allow context menu to paste

Changeset: 
M  /trunk/Scribus/scribus/scmimedata.h
M  /trunk/Scribus/scribus/ui/contextmenu.cpp
M  /trunk/Scribus/scribus/scmimedata.cpp

Diffs:
Index: scribus/scmimedata.cpp
===================================================================
--- scribus/scmimedata.cpp	(revision 13832)
+++ scribus/scmimedata.cpp	(revision 13833)
@@ -61,6 +61,14 @@
 	return false;
 }
 
+bool ScMimeData::clipboardHasPlainText(void)
+{
+	const QMimeData* mimeData = QApplication::clipboard()->mimeData();
+	if (mimeData)
+		return mimeData->hasText();
+	return false;
+}
+
 QString ScMimeData::clipboardScribusElem(void)
 {
 	const QMimeData* mimeData = QApplication::clipboard()->mimeData();
Index: scribus/ui/contextmenu.cpp
===================================================================
--- scribus/ui/contextmenu.cpp	(revision 13832)
+++ scribus/ui/contextmenu.cpp	(revision 13833)
@@ -370,7 +370,7 @@
 		addAction(m_AP->scrActions["editCut"]);
 	if (!(currItem->isSingleSel))
 		addAction(m_AP->scrActions["editCopy"]);
-	if ((m_doc->appMode == modeEdit) && (ScMimeData::clipboardHasScribusText()) && (currItem->itemType() == PageItem::TextFrame))
+	if ((m_doc->appMode == modeEdit) && (ScMimeData::clipboardHasScribusText()||ScMimeData::clipboardHasPlainText()) && (currItem->itemType() == PageItem::TextFrame))
 		addAction(m_AP->scrActions["editPaste"]);
 	if (!currItem->locked() && (m_doc->appMode != modeEdit) && (!(currItem->isSingleSel)))
 		addAction(m_AP->scrActions["itemDelete"]);
Index: scribus/scmimedata.h
===================================================================
--- scribus/scmimedata.h	(revision 13832)
+++ scribus/scmimedata.h	(revision 13833)
@@ -37,6 +37,7 @@
 	static bool clipboardHasScribusElem(void);
 	static bool clipboardHasScribusFragment(void);
 	static bool clipboardHasScribusText(void);
+	static bool clipboardHasPlainText(void);
 
 	static QString    clipboardScribusElem(void);
 	static QByteArray clipboardScribusFragment(void);




More information about the scribus-commit mailing list