r23604 by jghali - Remove unused function arguments from ScriXmlDoc's readElem() and readElemToLayer()

scribus-commit scribus-commit at lists.scribus.net
Mon Apr 13 13:21:49 UTC 2020


Author: jghali
Date: Mon Apr 13 13:21:49 2020
New Revision: 23604

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23604
Log:
Remove unused function arguments from ScriXmlDoc's readElem() and readElemToLayer()

Modified:
    trunk/Scribus/scribus/scpreview.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusXml.cpp
    trunk/Scribus/scribus/scribusXml.h
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/ui/colorsandfills.cpp
    trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp

Modified: trunk/Scribus/scribus/scpreview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23604&path=/trunk/Scribus/scribus/scpreview.cpp
==============================================================================
--- trunk/Scribus/scribus/scpreview.cpp	(original)
+++ trunk/Scribus/scribus/scpreview.cpp	Mon Apr 13 13:21:49 2020
@@ -46,7 +46,7 @@
 		m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
 		m_Doc->setLoading(true);
 		m_Doc->DoDrawing = false;
-		if (ss.readElem(data, prefsManager.appPrefs.fontPrefs.AvailFonts, m_Doc, 0, 0, false, true, prefsManager.appPrefs.fontPrefs.GFontSub))
+		if (ss.readElem(data, m_Doc, 0, 0, false, true))
 		{
 			QList<PageItem*> Elements = *m_Doc->Items;
 			Selection *tmpSel = new Selection(m_Doc, false);

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23604&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Mon Apr 13 13:21:49 2020
@@ -7530,7 +7530,7 @@
 		view->requestMode(submodeEndNodeEdit);
 
 	ScriXmlDoc ss;
-	if (ss.readElem(xml, m_prefsManager.appPrefs.fontPrefs.AvailFonts, docc, x, y, art, loca, m_prefsManager.appPrefs.fontPrefs.GFontSub))
+	if (ss.readElem(xml, docc, x, y, art, loca))
 	{
 		vie->DrawNew();
 		if (doc == docc)

Modified: trunk/Scribus/scribus/scribusXml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23604&path=/trunk/Scribus/scribus/scribusXml.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusXml.cpp	(original)
+++ trunk/Scribus/scribus/scribusXml.cpp	Mon Apr 13 13:21:49 2020
@@ -110,14 +110,14 @@
 	return (succeed && !sReader.hasError());
 }
 
-bool ScriXmlDoc::readElem(const QString& fileNameOrData, SCFonts &avail, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, QMap<QString,QString> &FontSub)
+bool ScriXmlDoc::readElem(const QString& fileNameOrData, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc)
 {
 	// Do not suppose the existence of layer with id = 0
 	// return readElemToLayer(fileName, avail, doc, Xp, Yp, Fi, loc, FontSub, view, 0);
-	return readElemToLayer(fileNameOrData, avail, doc, xPos, yPos, isDataFromFile, loc, FontSub, doc->activeLayer());
-}
-
-bool ScriXmlDoc::readElemToLayer(const QString& fileNameOrData, SCFonts &avail, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, QMap<QString,QString> &FontSub, int toLayer)
+	return readElemToLayer(fileNameOrData, doc, xPos, yPos, isDataFromFile, loc, doc->activeLayer());
+}
+
+bool ScriXmlDoc::readElemToLayer(const QString& fileNameOrData, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, int toLayer)
 {
 	QString elementData;
 	QString fileDir = ScPaths::applicationDataDir();

Modified: trunk/Scribus/scribus/scribusXml.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23604&path=/trunk/Scribus/scribus/scribusXml.h
==============================================================================
--- trunk/Scribus/scribus/scribusXml.h	(original)
+++ trunk/Scribus/scribus/scribusXml.h	Mon Apr 13 13:21:49 2020
@@ -48,8 +48,8 @@
 	\retval bool true = Scribus format file, false : not Scribus
 	*/
 	bool readElemHeader(const QString& file, bool isFile, double *x, double *y, double *w, double *h);
-	bool readElem(const QString& fileNameOrData, SCFonts &avail, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, QMap<QString,QString> &FontSub);
-	bool readElemToLayer(const QString& fileNameOrData, SCFonts &avail, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, QMap<QString,QString> &FontSub, int toLayer);
+	bool readElem(const QString& fileNameOrData, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc);
+	bool readElemToLayer(const QString& fileNameOrData, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, int toLayer);
 	
 	static QString writeElem(ScribusDoc *doc, Selection *selection);
 	static ScElemMimeData* writeToMimeData(ScribusDoc *doc, Selection *selection);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23604&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Mon Apr 13 13:21:49 2020
@@ -2802,7 +2802,7 @@
 	{
 		ScriXmlDoc ss;
 		QString dataS = ss.writeElem(this, &sourceSelection);
-		ss.readElemToLayer(dataS, m_appPrefsData.fontPrefs.AvailFonts, this, Pages->at(0)->xOffset(), Pages->at(0)->yOffset(), false, true, m_appPrefsData.fontPrefs.GFontSub, whereToInsert);
+		ss.readElemToLayer(dataS, this, Pages->at(0)->xOffset(), Pages->at(0)->yOffset(), false, true, whereToInsert);
 	}
 	sourceSelection.clear();
 	changed();
@@ -5132,7 +5132,7 @@
 	int GrMax = GroupCounter;
 	ScPage* sourcePage = Pages->at(pageNumber);
 	int nr = MasterPages.count();
-	ScPage* targetPage=addMasterPage(nr, masterPageName);
+	ScPage* targetPage = addMasterPage(nr, masterPageName);
 	assert(targetPage != nullptr);
 	//Backup currentpage, and don't use sourcepage here as we might convert a non current page
 	ScPage* oldCurrentPage = currentPage();
@@ -5162,13 +5162,13 @@
 		if (!sourcePage->masterPageNameEmpty() && MasterNames.contains(sourcePage->masterPageName()))
 		{
 			ScPage* pageMaster = nullptr;
-			for (int i=0; i < MasterPages.count(); ++i )
+			for (int i = 0; i < MasterPages.count(); ++i )
 			{
 				pageMaster=MasterPages[i];
 				if (pageMaster->pageName() == sourcePage->masterPageName())
 					break;
 			}
-			if (Layers.count()!= 0 && pageMaster != nullptr)
+			if (Layers.count() != 0 && pageMaster != nullptr)
 			{
 				int currActiveLayer = activeLayer();
 				for (ScLayers::iterator it = Layers.begin(); it != Layers.end(); ++it)
@@ -5187,7 +5187,7 @@
 						setCurrentPage(pageMaster); // Needed for writeElem to write proper page relative coordinates
 						QString dataS = ss.writeElem(this, &tempSelection);
 						setCurrentPage(targetPage);
-						ss.readElemToLayer(dataS, m_appPrefsData.fontPrefs.AvailFonts, this, targetPage->xOffset(), targetPage->yOffset(), false, true, m_appPrefsData.fontPrefs.GFontSub, it->ID);
+						ss.readElemToLayer(dataS, this, targetPage->xOffset(), targetPage->yOffset(), false, true, it->ID);
 						setMasterPageMode(false);
 						setCurrentPage(oldCurrentPage);
 					}
@@ -5198,7 +5198,7 @@
 		}
 	}
 	//Copy the items from our current *document* page
-	if (Layers.count()!= 0)
+	if (Layers.count() != 0 )
 	{
 		int currActiveLayer = activeLayer();
 		for (ScLayers::iterator it = Layers.begin(); it != Layers.end(); ++it)
@@ -5217,7 +5217,7 @@
 				QString dataS = ss.writeElem(this, &tempSelection);
 				setMasterPageMode(true);
 				setCurrentPage(targetPage);
-				ss.readElemToLayer(dataS, m_appPrefsData.fontPrefs.AvailFonts, this, targetPage->xOffset(), targetPage->yOffset(), false, true, m_appPrefsData.fontPrefs.GFontSub, it->ID);
+				ss.readElemToLayer(dataS, this, targetPage->xOffset(), targetPage->yOffset(), false, true, it->ID);
 				setMasterPageMode(false);
 				setCurrentPage(oldCurrentPage);
 			}
@@ -5342,7 +5342,7 @@
 		newItem = createPageItem(itemType, frameType, x, y, b, h, w, fill, outline); 
 	
 	Q_CHECK_PTR(newItem);
-	if (newItem==nullptr)
+	if (newItem == nullptr)
 		return -1;
 
 	if (itemKind == PageItem::InlineItem || itemKind == PageItem::PatternItem)
@@ -7226,7 +7226,7 @@
 					{
 						ScriXmlDoc ss;
 						QString fragment = itemBuffer[lcount];
-						ss.readElemToLayer(fragment, m_appPrefsData.fontPrefs.AvailFonts, this, destination->xOffset(), destination->yOffset(), false, true, m_appPrefsData.fontPrefs.GFontSub, it->ID);
+						ss.readElemToLayer(fragment, this, destination->xOffset(), destination->yOffset(), false, true, it->ID);
 					}
 					lcount++;
 				}
@@ -10779,7 +10779,7 @@
 		for (int b = 0; b < nrOfCopies; b++)
 		{
 			uint ac = Items->count();
-			xmlDoc.readElem(copyBuffer, m_appPrefsData.fontPrefs.AvailFonts, this, m_currentPage->xOffset(), m_currentPage->yOffset(), false, true, m_appPrefsData.fontPrefs.GFontSub);
+			xmlDoc.readElem(copyBuffer, this, m_currentPage->xOffset(), m_currentPage->yOffset(), false, true);
 			for (int as = ac; as < Items->count(); ++as)
 			{
 				PageItem* bItem = Items->at(as);
@@ -13575,7 +13575,7 @@
 		for (int i=0; i<mdData.copyCount; ++i)
 		{
 			uint ac = Items->count();
-			ss.readElem(BufferS, m_appPrefsData.fontPrefs.AvailFonts, this, m_currentPage->xOffset(), m_currentPage->yOffset(), false, true, m_appPrefsData.fontPrefs.GFontSub);
+			ss.readElem(BufferS, this, m_currentPage->xOffset(), m_currentPage->yOffset(), false, true);
 			m_Selection->delaySignalsOn();
 			for (int as = ac; as < Items->count(); ++as)
 			{
@@ -13635,7 +13635,7 @@
 				if (i==0 && j==0)
 					continue;
 				uint ac = Items->count();
-				ss.readElem(BufferS, m_appPrefsData.fontPrefs.AvailFonts, this, m_currentPage->xOffset(), m_currentPage->yOffset(), false, true, m_appPrefsData.fontPrefs.GFontSub);
+				ss.readElem(BufferS, this, m_currentPage->xOffset(), m_currentPage->yOffset(), false, true);
 				for (int as = ac; as < Items->count(); ++as)
 				{
 					PageItem* bItem = Items->at(as);
@@ -13749,7 +13749,7 @@
 		ScPage* targetPage = Pages->at(page - 1);
 		setCurrentPage(targetPage);
 		int countBeforeInsert = Items->count();
-		xmlStream.readElem(buffer, m_appPrefsData.fontPrefs.AvailFonts, this, currentPage()->xOffset(), currentPage()->yOffset(), false, true, m_appPrefsData.fontPrefs.GFontSub);
+		xmlStream.readElem(buffer, this, currentPage()->xOffset(), currentPage()->yOffset(), false, true);
 		if (!lastInChain)
 			continue;
 		for (int i = countBeforeInsert; i < Items->count(); ++i)

Modified: trunk/Scribus/scribus/ui/colorsandfills.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23604&path=/trunk/Scribus/scribus/ui/colorsandfills.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/colorsandfills.cpp	(original)
+++ trunk/Scribus/scribus/ui/colorsandfills.cpp	Mon Apr 13 13:21:49 2020
@@ -1324,7 +1324,7 @@
 	if (fi.suffix().toLower() == "sce")
 	{
 		ScriXmlDoc ss;
-		ss.readElem(data, PrefsManager::instance().appPrefs.fontPrefs.AvailFonts, m_doc, m_doc->currentPage()->xOffset(), m_doc->currentPage()->yOffset(), true, true, PrefsManager::instance().appPrefs.fontPrefs.GFontSub);
+		ss.readElem(data, m_doc, m_doc->currentPage()->xOffset(), m_doc->currentPage()->yOffset(), true, true);
 	}
 	else
 	{

Modified: trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23604&path=/trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp	(original)
+++ trunk/Scribus/scribus/ui/pagepalette_masterpages.cpp	Mon Apr 13 13:21:49 2020
@@ -292,7 +292,7 @@
 			{
 				ScriXmlDoc ss;
 				QString buffer = ss.writeElem(m_doc, m_doc->m_Selection);
-				ss.readElemToLayer(buffer, prefsManager.appPrefs.fontPrefs.AvailFonts, m_doc, destination->xOffset(), destination->yOffset(), false, true, prefsManager.appPrefs.fontPrefs.GFontSub, it->ID);
+				ss.readElemToLayer(buffer, m_doc, destination->xOffset(), destination->yOffset(), false, true, it->ID);
 				m_doc->m_Selection->clear();
 			}
 		}




More information about the scribus-commit mailing list