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

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 3 22:49:58 UTC 2013


Author: jghali
Date: Tue Dec  3 22:49:58 2013
New Revision: 18618

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

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=18618&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 Tue Dec  3 22:49:58 2013
@@ -85,6 +85,8 @@
 		sentenceTextEdit->clear();
 		changePushButton->setEnabled(false);
 		changeAllPushButton->setEnabled(false);
+		ignoreOncePushButton->setEnabled(false);
+		ignoreAllPushButton->setEnabled(false);
 		return;
 	}
 	else
@@ -98,16 +100,17 @@
 	sentence.insert(currWF.end-sentencePos+currWF.changeOffset,"</b></font>");
 	sentence.insert(currWF.start-sentencePos+currWF.changeOffset,"<font color=red><b>");
 	sentenceTextEdit->setText(sentence);
-
 }
 
 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