[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - svx/source
Caolán McNamara (via logerrit)
logerrit at kemper.freedesktop.org
Thu Nov 21 19:25:45 UTC 2019
svx/source/dialog/srchdlg.cxx | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
New commits:
commit f5b74048d460de005335cb74f5c072410bf66b51
Author: Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Nov 18 12:42:41 2019 +0000
Commit: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
CommitDate: Thu Nov 21 20:24:42 2019 +0100
rhbz#1773525 reducing the amount of saved search/replace entries didn't work
Change-Id: I1512ef507130718859271079e603a95cf2105c58
Reviewed-on: https://gerrit.libreoffice.org/83091
Tested-by: Jenkins
Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index ce298c60e494..1f95fbe21a7c 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -150,7 +150,7 @@ struct SearchDlg_Impl
}
};
-static void ListToStrArr_Impl( sal_uInt16 nId, std::vector<OUString>& rStrLst, weld::ComboBox& rCBox )
+static void ListToStrArr_Impl(sal_uInt16 nId, std::vector<OUString>& rStrLst, weld::ComboBox& rCBox, sal_uInt16 nRememberSize)
{
const SfxStringListItem* pSrchItem =
static_cast<const SfxStringListItem*>(SfxGetpApp()->GetItem( nId ));
@@ -159,6 +159,9 @@ static void ListToStrArr_Impl( sal_uInt16 nId, std::vector<OUString>& rStrLst, w
{
std::vector<OUString> aLst = pSrchItem->GetList();
+ if (aLst.size() > nRememberSize)
+ aLst.resize(nRememberSize);
+
for (const OUString & s : aLst)
{
rStrLst.push_back(s);
@@ -378,9 +381,9 @@ void SvxSearchDialog::Construct_Impl()
// Get stored search-strings from the application
ListToStrArr_Impl(SID_SEARCHDLG_SEARCHSTRINGS,
- aSearchStrings, *m_xSearchLB);
+ aSearchStrings, *m_xSearchLB, nRememberSize);
ListToStrArr_Impl(SID_SEARCHDLG_REPLACESTRINGS,
- aReplaceStrings, *m_xReplaceLB);
+ aReplaceStrings, *m_xReplaceLB, nRememberSize);
InitControls_Impl();
More information about the Libreoffice-commits
mailing list