r19568 by jghali - move AppModeHelper::inAnEditMode() to ScribusDoc

scribus-commit scribus-commit at lists.scribus.net
Wed Oct 8 23:11:50 UTC 2014


Author: jghali
Date: Wed Oct  8 23:11:50 2014
New Revision: 19568

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19568
Log:
move AppModeHelper::inAnEditMode() to ScribusDoc

Modified:
    trunk/Scribus/scribus/appmodehelper.cpp
    trunk/Scribus/scribus/appmodehelper.h
    trunk/Scribus/scribus/scpage.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h

Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19568&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp (original)
+++ trunk/Scribus/scribus/appmodehelper.cpp Wed Oct  8 23:11:50 2014
@@ -394,26 +394,6 @@
 #ifdef HAVE_OSG
 	(*a_scrActions)["toolsPDFAnnot3D"]->setChecked(newMode==modeInsertPDF3DAnnotation);
 #endif
-}
-
-bool AppModeHelper::inAnEditMode(ScribusDoc *doc)
-{
-	bool inEditMode=false;
-
-	if (doc->appMode == modeEdit ||
-		doc->appMode == modeEditTable ||
-		doc->appMode == modeEditSpiral ||
-		doc->appMode == modeEditGradientVectors ||
-		doc->appMode == modeEditClip ||
-		doc->appMode == modeEditMeshGradient ||
-		doc->appMode == modeEditArc ||
-		doc->appMode == modeEditMeshPatch ||
-		doc->appMode == modeEditWeldPoint ||
-		doc->appMode == modeEditPolygon
-		)
-		inEditMode=true;
-
-	return inEditMode;
 }
 
 void AppModeHelper::setActionGroupEnabled(QMap<QString, QPointer<ScrAction> >*ag, bool enabled)

Modified: trunk/Scribus/scribus/appmodehelper.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19568&path=/trunk/Scribus/scribus/appmodehelper.h
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.h (original)
+++ trunk/Scribus/scribus/appmodehelper.h Wed Oct  8 23:11:50 2014
@@ -38,7 +38,6 @@
 		void resetApplicationMode(ScribusMainWindow* scmw, int newMode);
 		void setApplicationMode(ScribusMainWindow* scmw, ScribusDoc* doc, int newMode);
 		void setModeActionsPerMode(int newMode);
-		bool inAnEditMode(ScribusDoc* doc);
 		void setActionGroupEnabled(QMap<QString, QPointer<ScrAction> > *, bool enabled);
 		void setTextEditMode(bool b);
 		void setSpecialEditMode(bool b);

Modified: trunk/Scribus/scribus/scpage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19568&path=/trunk/Scribus/scribus/scpage.cpp
==============================================================================
--- trunk/Scribus/scribus/scpage.cpp (original)
+++ trunk/Scribus/scribus/scpage.cpp Wed Oct  8 23:11:50 2014
@@ -322,7 +322,7 @@
 	PageItem *ite = state->getItem();
 	bool oldMPMode=m_Doc->masterPageMode();
 	m_Doc->setMasterPageMode(!ite->OnMasterPage.isEmpty());
-	if (m_Doc->scMW()->appModeHelper->inAnEditMode(m_Doc))
+	if (m_Doc->inAnEditMode())
 		m_Doc->view()->requestMode(modeNormal);
 	m_Doc->m_Selection->delaySignalsOn();
 	if (isUndo)

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19568&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Wed Oct  8 23:11:50 2014
@@ -5470,7 +5470,7 @@
 	if (!HaveDoc)
 		return;
 
-	bool inEditMode=appModeHelper->inAnEditMode(doc);
+	bool inEditMode = doc->inAnEditMode();
 	if (inEditMode)
 	{
 		if (doc->m_Selection->isEmpty())

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19568&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Wed Oct  8 23:11:50 2014
@@ -753,6 +753,26 @@
 	if (m_tserializer)
 		delete m_tserializer;
 	ScCore->fileWatcher->start();
+}
+
+bool ScribusDoc::inAnEditMode() const
+{
+	bool inEditMode=false;
+
+	if (appMode == modeEdit ||
+		appMode == modeEditTable ||
+		appMode == modeEditSpiral ||
+		appMode == modeEditGradientVectors ||
+		appMode == modeEditClip ||
+		appMode == modeEditMeshGradient ||
+		appMode == modeEditArc ||
+		appMode == modeEditMeshPatch ||
+		appMode == modeEditWeldPoint ||
+		appMode == modeEditPolygon
+		)
+		inEditMode=true;
+
+	return inEditMode;
 }
 
 QList<PageItem*> ScribusDoc::getAllItems(QList<PageItem*> &items)

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19568&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Wed Oct  8 23:11:50 2014
@@ -128,6 +128,7 @@
 	ScribusDoc(const QString& docName, int unitIndex, const PageSize& pagesize, const MarginStruct& margins, const DocPagesSetup& pagesSetup);
 	~ScribusDoc();
 	void init();
+	bool inAnEditMode() const;
 	QList<PageItem*> getAllItems(QList<PageItem*> &items);
 	QList<PageItem*> *parentGroup(PageItem* item, QList<PageItem*> *list);
 	void setup(const int, const int, const int, const int, const int, const QString&, const QString&);




More information about the scribus-commit mailing list