r24249 by jghali - Simplify code by removing an useless iteration loop

scribus-commit scribus-commit at lists.scribus.net
Sat Nov 14 21:04:12 UTC 2020


Author: jghali
Date: Sat Nov 14 21:04:12 2020
New Revision: 24249

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24249
Log:
Simplify code by removing an useless iteration loop

Modified:
    trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp

Modified: trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24249&path=/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp	Sat Nov 14 21:04:12 2020
@@ -257,21 +257,9 @@
 
 void HunspellDialog::setLanguageCombo(const QString &newLangAbbrev)
 {
-	bool found = false;
-
-	auto it = m_dictionaryMap->cbegin();
-	while (it != m_dictionaryMap->cend())
-	{
-		if (it.key() == newLangAbbrev)
-		{
-			found = true;
-			break;
-		}
-		++it;
-	}
 	int i = 0;
-	if (found)
-		i = languagesComboBox->findText(LanguageManager::instance()->getLangFromAbbrev(newLangAbbrev,true));
+	if (m_dictionaryMap->contains(newLangAbbrev))
+		i = languagesComboBox->findText(LanguageManager::instance()->getLangFromAbbrev(newLangAbbrev, true));
 	bool b = languagesComboBox->blockSignals(true);
 	languagesComboBox->setCurrentIndex(i);
 	languagesComboBox->blockSignals(b);




More information about the scribus-commit mailing list