sw/inc/strings.hrc                          |    1 +
 sw/source/uibase/sidebar/QuickFindPanel.cxx |    8 ++++++++
 2 files changed, 9 insertions(+)

New commits:
commit d5b76e32f99738301c253840ff089cfc830874dc
Author:     Jim Raykowski <rayk...@gmail.com>
AuthorDate: Mon Sep 23 18:25:17 2024 -0800
Commit:     Jim Raykowski <rayk...@gmail.com>
CommitDate: Tue Sep 24 18:56:01 2024 +0200

    tdf#163100 Need more FIND details
    
    This enhancement patch for the quick find panel makes the document
    order index of the match entry selected in the finds list be shown in
    the found times label at the bottom of the panel. For example,
    selecting the 6th entry in the finds list for a search that has 25
    matches will display "Match 6 of 25 matches."
    
    Change-Id: Iea39e754b0cd75d3ca446781a4b8d2e8651e7d08
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173835
    Reviewed-by: Vernon, Stuart Foote <vsfo...@libreoffice.org>
    Reviewed-by: Jim Raykowski <rayk...@gmail.com>
    Tested-by: Jenkins

diff --git a/sw/inc/strings.hrc b/sw/inc/strings.hrc
index 96ed8bab484d..6e7e81c383bc 100644
--- a/sw/inc/strings.hrc
+++ b/sw/inc/strings.hrc
@@ -1399,6 +1399,7 @@
 #define STR_EDIT_FOOTNOTE                       NC_("STR_EDIT_FOOTNOTE", "Edit 
Footnote/Endnote")
 #define STR_NB_REPLACED                         NC_("STR_NB_REPLACED", "Search 
key replaced XX times.")
 #define STR_SEARCH_KEY_FOUND_TIMES              
NNC_("STR_SEARCH_KEY_FOUND_TIMES", "One match found.", "%1 matches found.")
+#define STR_SEARCH_KEY_FOUND_XOFN               
NNC_("STR_SEARCH_KEY_FOUND_XOFN", "Match one of one match found.", "Match %1 of 
%2 matches found.")
 #define STR_SRCVIEW_ROW                         NC_("STR_SRCVIEW_ROW", "Row ")
 #define STR_SRCVIEW_COL                         NC_("STR_SRCVIEW_COL", "Column 
")
 #define STR_SAVEAS_SRC                          NC_("STR_SAVEAS_SRC", "~Export 
source...")
diff --git a/sw/source/uibase/sidebar/QuickFindPanel.cxx 
b/sw/source/uibase/sidebar/QuickFindPanel.cxx
index 483d6415d121..016878aa2521 100644
--- a/sw/source/uibase/sidebar/QuickFindPanel.cxx
+++ b/sw/source/uibase/sidebar/QuickFindPanel.cxx
@@ -378,6 +378,14 @@ IMPL_LINK_NOARG(QuickFindPanel, 
SearchFindsListSelectionChangedHandler, weld::Tr
     }
     m_pWrtShell->EndAction();
 
+    // tdf#163100 Need more FIND details
+    // Set the found times label to show "Match X of N matches found."
+    auto nSearchFindFoundTimes = m_vPaMs.size();
+    OUString sText = SwResId(STR_SEARCH_KEY_FOUND_XOFN, nSearchFindFoundTimes);
+    sText = sText.replaceFirst("%1", OUString::number(sId.toUInt32() + 1));
+    sText = sText.replaceFirst("%2", OUString::number(nSearchFindFoundTimes));
+    m_xSearchFindFoundTimesLabel->set_label(sText);
+
     SwShellCursor* pShellCursor = m_pWrtShell->GetCursor_();
     std::vector<basegfx::B2DRange> vRanges;
     for (const SwRect& rRect : *pShellCursor)

Reply via email to