include/svx/srchdlg.hxx | 2 + officecfg/registry/data/org/openoffice/Office/Common.xcu | 3 ++ officecfg/registry/schema/org/openoffice/Office/Common.xcs | 5 ++++ svx/source/dialog/srchdlg.cxx | 16 ++++++------- 4 files changed, 18 insertions(+), 8 deletions(-)
New commits: commit 70e22d4996e71e019f62743893f041797f050361 Author: heiko tietze <tietze.he...@gmail.com> AuthorDate: Sun Feb 10 14:17:08 2019 +0100 Commit: Heiko Tietze <tietze.he...@gmail.com> CommitDate: Mon Feb 18 09:50:33 2019 +0100 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.he...@gmail.com> diff --git a/include/svx/srchdlg.hxx b/include/svx/srchdlg.hxx index 4b82db88fe7c..5b202aeebcc9 100644 --- a/include/svx/srchdlg.hxx +++ b/include/svx/srchdlg.hxx @@ -200,6 +200,7 @@ private: VclPtr<RadioButton> m_pColumnsBtn; VclPtr<CheckBox> m_pAllSheetsCB; + SfxBindings& rBindings; bool bWriter; bool bSearch; @@ -214,6 +215,7 @@ private: OUString aLayoutWriterStr; OUString aLayoutCalcStr; OUString aCalcStr; + sal_uInt16 nRememberSize; std::vector<OUString> aSearchStrings; std::vector<OUString> aReplaceStrings; diff --git a/officecfg/registry/data/org/openoffice/Office/Common.xcu b/officecfg/registry/data/org/openoffice/Office/Common.xcu index 6c80882ce337..3e3223a14562 100644 --- a/officecfg/registry/data/org/openoffice/Office/Common.xcu +++ b/officecfg/registry/data/org/openoffice/Office/Common.xcu @@ -492,6 +492,9 @@ <it>--------------------</it> </value> </prop> + <prop oor:name="FindReplaceRememberedSearches"> + <value>10</value> + </prop> </node> <node oor:name="Save"> <node oor:name="Document"> diff --git a/officecfg/registry/schema/org/openoffice/Office/Common.xcs b/officecfg/registry/schema/org/openoffice/Office/Common.xcs index d39e49484c22..324f22055eb7 100644 --- a/officecfg/registry/schema/org/openoffice/Office/Common.xcs +++ b/officecfg/registry/schema/org/openoffice/Office/Common.xcs @@ -5641,6 +5641,11 @@ <desc>Contains the Personas installed through extensions</desc> </info> </set> + <prop oor:name="FindReplaceRememberedSearches" oor:type="xs:int" oor:nillable="false"> + <info> + <desc>Number of saved searches in the Find and Replace dialog.</desc> + </info> + </prop> </group> <group oor:name="Forms"> <info> 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); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits