r18619 by jghali - #11863 : Check Spelling crashes pressing "Ignore All" without text available

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 3 22:51:11 UTC 2013


Author: jghali
Date: Tue Dec  3 22:51:11 2013
New Revision: 18619

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18619
Log:
#11863 : Check Spelling crashes pressing "Ignore All" without text available

Modified:
    branches/Version14x/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp

Modified: branches/Version14x/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18619&path=/branches/Version14x/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp (original)
+++ branches/Version14x/Scribus/scribus/plugins/tools/hunspellcheck/hunspelldialog.cpp Tue Dec  3 22:51:11 2013
@@ -82,6 +82,8 @@
 		sentenceTextEdit->clear();
 		changePushButton->setEnabled(false);
 		changeAllPushButton->setEnabled(false);
+		ignoreOncePushButton->setEnabled(false);
+		ignoreAllPushButton->setEnabled(false);
 		return;
 	}
 	else
@@ -100,11 +102,13 @@
 
 void HunspellDialog::ignoreAllWords()
 {
-	QString wordToIgnore=m_wfList->at(wfListIndex).w;
+	if (wfListIndex < 0 || wfListIndex >= m_wfList->count())
+		return;
+	QString wordToIgnore = m_wfList->at(wfListIndex).w;
 	//Do we start from 0 or from the instance of the word where we are... 0 for now
-	for(int i=0;i<m_wfList->count();++i)
-		if(m_wfList->at(i).w==wordToIgnore)
-			(*m_wfList)[i].ignore=true;
+	for (int i = 0; i < m_wfList->count(); ++i)
+		if (m_wfList->at(i).w == wordToIgnore)
+			(*m_wfList)[i].ignore = true;
 	goToNextWord();
 }
 




More information about the scribus-commit mailing list