r13832 by cbradney - #8331 - Allow context menu to paste
scribus-commit
scribus-commit at lists.scribus.net
Mon Aug 10 21:10:25 CEST 2009
Revision: 13832
Author: cbradney
Date: 2009-08-10T19:07:13.411051Z
Commit message: #8331 - Allow context menu to paste
Changeset:
M /branches/Version135/Scribus/scribus/contextmenu.cpp
M /branches/Version135/Scribus/scribus/scmimedata.h
M /branches/Version135/Scribus/scribus/scmimedata.cpp
Diffs:
Index: scribus/scmimedata.h
===================================================================
--- scribus/scmimedata.h (revision 13831)
+++ scribus/scmimedata.h (revision 13832)
@@ -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);
Index: scribus/scmimedata.cpp
===================================================================
--- scribus/scmimedata.cpp (revision 13831)
+++ scribus/scmimedata.cpp (revision 13832)
@@ -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/contextmenu.cpp
===================================================================
--- scribus/contextmenu.cpp (revision 13831)
+++ scribus/contextmenu.cpp (revision 13832)
@@ -363,7 +363,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"]);
More information about the scribus-commit
mailing list