r20814 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Sat Jan 30 22:06:08 UTC 2016


Author: jghali
Date: Sat Jan 30 22:06:08 2016
New Revision: 20814

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20814
Log:
coverity #1350104: 'constant' variable guard dead code

Modified:
    trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp

Modified: trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20814&path=/trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp	(original)
+++ trunk/Scribus/scribus/plugins/gettext/xtgim/xtgscanner.cpp	Sat Jan 30 22:06:08 2016
@@ -372,7 +372,6 @@
 QString XtgScanner::getFontName(QString name)
 {
 	QString fontName = name;
-	bool found = false;
 	SCFontsIterator it(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts);
 	for ( ; it.hasNext(); it.next())
 	{
@@ -398,24 +397,21 @@
 			}
 		}
 	}
-	if (found)
-		return fontName;
+
+	if (!PrefsManager::instance()->appPrefs.fontPrefs.GFontSub.contains(fontName))
+	{
+		qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
+		MissingFont *dia = new MissingFont(0, fontName, doc);
+		dia->exec();
+		QString fontNameR = dia->getReplacementFont();
+		delete dia;
+		qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
+		PrefsManager::instance()->appPrefs.fontPrefs.GFontSub[fontName] = fontNameR;
+		fontName = fontNameR;
+	}
 	else
-	{
-		if (!PrefsManager::instance()->appPrefs.fontPrefs.GFontSub.contains(fontName))
-		{
-			qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
-			MissingFont *dia = new MissingFont(0, fontName, doc);
-			dia->exec();
-			QString fontNameR = dia->getReplacementFont();
-			delete dia;
-			qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
-			PrefsManager::instance()->appPrefs.fontPrefs.GFontSub[fontName] = fontNameR;
-			fontName = fontNameR;
-		}
-		else
-			fontName = PrefsManager::instance()->appPrefs.fontPrefs.GFontSub[fontName];
-	}
+		fontName = PrefsManager::instance()->appPrefs.fontPrefs.GFontSub[fontName];
+
 	return fontName;
 }
 




More information about the scribus-commit mailing list