summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorheiko tietze <tietze.heiko@gmail.com>2019-02-10 14:17:08 +0100
committerHeiko Tietze <tietze.heiko@gmail.com>2019-02-18 09:50:33 +0100
commit70e22d4996e71e019f62743893f041797f050361 (patch)
treed538864af18677ba0b5d88f84b58ae0f5d75f019 /svx
parent7dcd1651e8cd89f07bbe618393bea32fc73d3549 (diff)
Resolves tdf#122322 - Modifying max number of saved word searches
Expert configuration Common::Misc::FindReplaceRememberedSearches defaulting to 10 introduced Change-Id: Id51bb78ee1f5ad9e73fa56e5f2d07773c528f9a7 Reviewed-on: https://gerrit.libreoffice.org/67614 Tested-by: Jenkins Reviewed-by: Heiko Tietze <tietze.heiko@gmail.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/srchdlg.cxx16
1 files changed, 8 insertions, 8 deletions
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 425210c82bea..d23071acac66 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-
#include <sal/macros.h>
#include <vcl/wrkwin.hxx>
#include <vcl/timer.hxx>
@@ -74,6 +73,7 @@
#include <memory>
#include <svx/xdef.hxx>
+#include <officecfg/Office/Common.hxx>
using namespace com::sun::star::i18n;
using namespace com::sun::star::uno;
@@ -81,9 +81,6 @@ using namespace com::sun::star::accessibility;
using namespace com::sun::star;
using namespace comphelper;
-
-#define REMEMBER_SIZE 10
-
enum class ModifyFlags {
NONE = 0x000000,
Search = 0x000001,
@@ -336,6 +333,9 @@ SvxSearchDialog::SvxSearchDialog( vcl::Window* pParent, SfxChildWindow* pChildWi
// m_pSimilarityBtn->set_height_request(m_pSimilarityBox->get_preferred_size().Height());
// m_pJapOptionsBtn->set_height_request(m_pJapOptionsCB->get_preferred_size().Height());
+ //tdf#122322
+ nRememberSize = officecfg::Office::Common::Misc::FindReplaceRememberedSearches::get();
+
long nTermWidth = approximate_char_width() * 32;
m_pSearchLB->set_width_request(nTermWidth);
m_pSearchTmplLB->set_width_request(nTermWidth);
@@ -1633,11 +1633,11 @@ void SvxSearchDialog::Remember_Impl( const OUString &rStr, bool _bSearch )
return;
// delete oldest entry at maximum occupancy (ListBox and Array)
- if(REMEMBER_SIZE < pArr->size())
+ if(nRememberSize < pArr->size())
{
- pListBox->RemoveEntryAt(static_cast<sal_uInt16>(REMEMBER_SIZE - 1));
- (*pArr)[REMEMBER_SIZE - 1] = rStr;
- pArr->erase(pArr->begin() + REMEMBER_SIZE - 1);
+ pListBox->RemoveEntryAt(static_cast<sal_uInt16>(nRememberSize - 1));
+ (*pArr)[nRememberSize - 1] = rStr;
+ pArr->erase(pArr->begin() + nRememberSize - 1);
}
pArr->insert(pArr->begin(), rStr);