r22856 by jghali - Fix some tests for map key availability in barcodegenerator.cpp

scribus-commit scribus-commit at lists.scribus.net
Fri Mar 1 02:10:54 UTC 2019


Author: jghali
Date: Fri Mar  1 02:10:53 2019
New Revision: 22856

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22856
Log:
Fix some tests for map key availability in barcodegenerator.cpp

Modified:
    trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp

Modified: trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22856&path=/trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	(original)
+++ trunk/Scribus/scribus/plugins/barcodegenerator/barcodegenerator.cpp	Fri Mar  1 02:10:53 2019
@@ -329,11 +329,11 @@
 {
 	QString enc=map[ui.bcCombo->currentText()].command;
 
-	ui.formatLabel->setText(resvlbl[enc]!="" ? resvlbl[enc]+":" : "Version:");
+	ui.formatLabel->setText(resvlbl.contains(enc) ? resvlbl[enc]+":" : "Version:");
 	ui.formatCombo->blockSignals(true);
 	ui.formatCombo->clear();
 	ui.formatCombo->addItem("Auto");
-	if (resvers[enc]!="")
+	if (resvers.contains(enc))
 	{
 		ui.formatCombo->insertSeparator(999);
 		ui.formatCombo->addItems(resvers[enc].split(","));
@@ -350,7 +350,7 @@
 	ui.eccCombo->blockSignals(true);
 	ui.eccCombo->clear();
 	ui.eccCombo->addItem("Auto");
-	if (resecls[enc]!="")
+	if (resecls.contains(enc))
 	{
 		ui.eccCombo->insertSeparator(999);
 		ui.eccCombo->addItems(resecls[enc].split(","));
@@ -511,7 +511,7 @@
 	}
 
 	QString enc=map[ui.bcCombo->currentText()].command;
-	QString vlbl=resvlbl[enc]!="" ? resvlbl[enc].toLower() : "version";
+	QString vlbl=resvlbl.contains(enc) ? resvlbl[enc].toLower() : "version";
 
 	if (ui.formatCombo->currentIndex() != 0)
 	{
@@ -572,7 +572,7 @@
 	ui.parsefncCheck->blockSignals(false);
 
 	QString enc=map[ui.bcCombo->currentText()].command;
-	QString vlbl=resvlbl[enc]!="" ? resvlbl[enc].toLower() : "version";
+	QString vlbl=resvlbl.contains(enc) ? resvlbl[enc].toLower() : "version";
 
 	QRegExp rxf("\\b"+QRegExp::escape(vlbl)+"=(\\S*)\\b");
 	ui.formatCombo->blockSignals(true);




More information about the scribus-commit mailing list