r24123 by jghali - Fix offset error when extracting sentence of spellchecked word

scribus-commit scribus-commit at lists.scribus.net
Thu Oct 29 15:27:25 UTC 2020


Author: jghali
Date: Thu Oct 29 15:27:25 2020
New Revision: 24123

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24123
Log:
Fix offset error when extracting sentence of spellchecked word

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=24123&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	Thu Oct 29 15:27:25 2020
@@ -62,12 +62,12 @@
 {
 	if (m_returnToDefaultLang)
 	{
-		bool b=languagesComboBox->blockSignals(true);
+		bool b = languagesComboBox->blockSignals(true);
 		languagesComboBox->setCurrentIndex(m_primaryLangIndex);
 		languagesComboBox->blockSignals(b);
 	}
-	if (i>=0)
-		wfListIndex=i;
+	if (i >= 0)
+		wfListIndex = i;
 	else
 	{
 		do {
@@ -88,16 +88,15 @@
 	}
 	else
 		statusLabel->setText("");
-	currWF=m_wfList->at(wfListIndex);
+	currWF = m_wfList->at(wfListIndex);
 	setLanguageCombo(currWF.lang);
 	updateSuggestions(currWF.replacements);
 
-	int sentencePos=0;
-	QString sentence(m_iText->sentence(currWF.start, sentencePos));
-	sentence.insert(currWF.end-sentencePos+currWF.changeOffset,"</b></font>");
-	sentence.insert(currWF.start-sentencePos+currWF.changeOffset,"<font color=red><b>");
+	int sentencePos = 0;
+	QString sentence(m_iText->sentence(currWF.start + currWF.changeOffset, sentencePos));
+	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()




More information about the scribus-commit mailing list