r23762 by jghali - Fix coverity 1438504: Unchecked return value

scribus-commit scribus-commit at lists.scribus.net
Mon May 11 14:00:28 UTC 2020


Author: jghali
Date: Mon May 11 14:00:27 2020
New Revision: 23762

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23762
Log:
Fix coverity 1438504: Unchecked return value

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23762&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp	Mon May 11 14:00:27 2020
@@ -160,10 +160,10 @@
 	return docText;
 }
 
-void Scribus13Format::getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces)
+void Scribus13Format::getReplacedFontData(bool & getNewReplacement, QMap<QString, QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces)
 {
-	getNewReplacement=newReplacement;
-	getReplacedFonts=ReplacedFonts;
+	getNewReplacement = newReplacement;
+	getReplacedFonts = ReplacedFonts;
 }
 
 bool Scribus13Format::loadFile(const QString & fileName, const FileFormat & /* fmt */, int /* flags */, int /* index */)
@@ -2568,35 +2568,6 @@
 	}
 }
 
-QString Scribus13Format::AskForFont(const QString& fStr, ScribusDoc *doc)
-{
-	PrefsManager& prefsManager=PrefsManager::instance();
-//	QFont fo;
-	QString tmpf = fStr;
-	if ((!(*m_AvailableFonts).contains(tmpf)) || (!(*m_AvailableFonts)[tmpf].usable()))
-	{
-		if ((!prefsManager.appPrefs.fontPrefs.GFontSub.contains(tmpf)) || (!(*m_AvailableFonts)[prefsManager.appPrefs.fontPrefs.GFontSub[tmpf]].usable()))
-		{
-			qApp->setOverrideCursor(QCursor(Qt::ArrowCursor));
-			MissingFont *dia = new MissingFont(nullptr, tmpf, doc);
-			dia->exec();
-			tmpf = dia->getReplacementFont();
-			delete dia;
-			qApp->restoreOverrideCursor();
-			prefsManager.appPrefs.fontPrefs.GFontSub[fStr] = tmpf;
-		}
-		else
-			tmpf = prefsManager.appPrefs.fontPrefs.GFontSub[tmpf];
-		ReplacedFonts[fStr] = tmpf;
-	}
-	if (!doc->UsedFonts.contains(tmpf))
-	{
-		doc->AddFont(tmpf);
-	}
-// 	DoFonts[fStr] = tmpf;
-	return tmpf;
-}
-
 bool Scribus13Format::readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles)
 {
 	ParagraphStyle pstyle;

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23762&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h	Mon May 11 14:00:27 2020
@@ -27,6 +27,7 @@
 		// Standard plugin implementation
 		Scribus13Format();
 		virtual ~Scribus13Format();
+
 		QString fullTrName() const override;
 		const AboutData* getAboutData() const override;
 		void deleteAboutData(const AboutData* about) const override;
@@ -44,7 +45,7 @@
 		bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty) override;
 		bool readColors(const QString& fileName, ColorList & colors) override;
 		bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames) override;
-		void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces) override;
+		void getReplacedFontData(bool & getNewReplacement, QMap<QString, QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces) override;
 
 	private:
 		void registerFormats();
@@ -54,15 +55,14 @@
 		PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir, PageItem::ItemKind itemKind, int pagenr = -2 /* currentPage*/);
 		void GetStyle(QDomElement *pg, ParagraphStyle *vg, StyleSet<ParagraphStyle> *tempParagraphStyles, ScribusDoc* doc, bool fl);
 		QString readSLA(const QString & fileName);
-		QString AskForFont(const QString& fStr, ScribusDoc *doc);
 		
 		QMap<int, int> itemRemap;
 		QMap<int, int> itemNext;
 		QList<PageItem*> FrameItems;
 		int itemCount {0};
 		bool newReplacement {false};
-		QMap<QString,QString> ReplacedFonts;
-		QMap<uint,QString> DoVorl;
+		QMap<QString, QString> ReplacedFonts;
+		QMap<uint, QString> DoVorl;
 		uint VorlC {0};
 		QList<PDFPresentationData> EffVal;
 };




More information about the scribus-commit mailing list