r24769 by craig - #16680: search results has %1 instead of %n for plural translations. Fix

scribus-commit scribus-commit at lists.scribus.net
Tue Nov 9 22:17:23 UTC 2021


Author: craig
Date: Tue Nov  9 22:17:23 2021
New Revision: 24769

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24769
Log:
#16680: search results has %1 instead of %n for plural translations. Fix
counting for search vs replace

Modified:
    trunk/Scribus/scribus/ui/search.cpp
    trunk/Scribus/scribus/ui/storyeditor.cpp

Modified: trunk/Scribus/scribus/ui/search.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24769&path=/trunk/Scribus/scribus/ui/search.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/search.cpp	(original)
+++ trunk/Scribus/scribus/ui/search.cpp	Tue Nov  9 22:17:23 2021
@@ -571,6 +571,8 @@
 					m_doc->regionsChanged()->update(updateRect.adjusted(-10.0, -10.0, 10.0, 10.0));
 			}
 		}
+		if (found)
+			m_matchesFound++;
 		if ((!found) || (a == m_item->itemText.length()))
 		{
 			m_doc->DoDrawing = true;
@@ -702,7 +704,6 @@
 				replaceButton->setEnabled(true);
 				replaceAllButton->setEnabled(true);
 			}
-			m_matchesFound++;
 			m_firstMatchPosition = storyTextEdit->textCursor().selectionStart();
 		}
 		else
@@ -730,7 +731,6 @@
 {
 	if (m_itemMode)
 	{
-		m_matchesFound++;
 		UndoTransaction transaction;
 		if (UndoManager::undoEnabled())
 			transaction = UndoManager::instance()->beginTransaction(m_item->getUName(), m_item->getUPixmap());
@@ -922,7 +922,7 @@
 //		ScMessageBox::information(this, tr("Search/Replace"), tr("Search finished));
 //	else
 //	{
-	ScMessageBox::information(this, tr("Search/Replace"), tr("Search finished. ") + tr("%1 match(es) found", "", m_matchesFound));
+	ScMessageBox::information(this, tr("Search/Replace"), tr("Search finished. ") + tr("%n match(es) found", "", m_matchesFound));
 	m_matchesFound = 0;
 //	}
 }

Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24769&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp	(original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp	Tue Nov  9 22:17:23 2021
@@ -146,7 +146,7 @@
 
 	pmen->clear();
 
-	QString styleName = "";
+	QString styleName;
 	ParaStyleComboBox* paraStyleCombo = new ParaStyleComboBox(pmen);
 	paraStyleCombo->setDoc(m_editor->doc);
 	if ((currentPar < static_cast<int>(m_editor->StyledText.nrOfParagraphs())) && (m_editor->StyledText.length() != 0))




More information about the scribus-commit mailing list