diff options
author | Bayram Çiçek <bayram.cicek@collabora.com> | 2024-05-02 22:40:22 +0300 |
---|---|---|
committer | Caolán McNamara <caolan.mcnamara@collabora.com> | 2024-05-10 11:20:06 +0200 |
commit | f2f4ceb79a0adfec6654e6ebf122928cc7927036 (patch) | |
tree | e90dea5147746a10c7d7c7c2e1fad3f0267180f6 /cui | |
parent | 726b133fd8c823c7f05a30c1995de26db372174d (diff) |
tdf#159375: remove initialization on Tools>Options
- Initializing some dialogs at the startup of Options
makes it opening very slow on some low-power systems.
- This patch removes this initialization. This means,
all dialogs will be initialized at the time of search.
Therefore, we should wait a bit longer when typing
on the search bar to get the results...
- remove the default parameter "nNumberOfNode" from
initializeFirstNDialog()
- rename initializeFirstNDialog() to initializeAllDialogs()
Change-Id: I4fd9c5673f7edecfe6a6621b6018d5d405f112a6
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167023
Tested-by: Jenkins
Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Reviewed-by: Moritz Duge <moritz.duge@allotropia.de>
(cherry picked from commit dd3953f705cc19aad4b0fcec7fd2961246b659e3)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/167450
Tested-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/inc/treeopt.hxx | 4 | ||||
-rw-r--r-- | cui/source/options/treeopt.cxx | 22 |
2 files changed, 5 insertions, 21 deletions
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx index 307c70f9edd5..1522ded3d7c4 100644 --- a/cui/source/inc/treeopt.hxx +++ b/cui/source/inc/treeopt.hxx @@ -229,8 +229,8 @@ public: void ActivatePage( const OUString& rPageURL ); void ApplyItemSets(); - // default value initializes all dialogs - void initializeFirstNDialog(sal_Int16 nNumberOfNode = -1); + // initialize all dialogs in "Tools > Options" + void initializeAllDialogs(); // helper functions to call the Languages and Locales TabPage from the SpellDialog static void ApplyLanguageOptions(const SfxItemSet& rSet); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index d8fe793e10b7..029c5f773f8f 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -790,7 +790,7 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, SearchUpdateHdl, weld::Entry&, void) IMPL_LINK_NOARG(OfaTreeOptionsDialog, ImplUpdateDataHdl, Timer*, void) { - // initializeFirstNDialog() can take a long time, show wait cursor and disable input + // initializeAllDialogs() can take a long time, show wait cursor and disable input std::unique_ptr<weld::WaitObject> xWait(m_pParent ? new weld::WaitObject(m_pParent) : nullptr); // Pause redraw @@ -801,7 +801,7 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, ImplUpdateDataHdl, Timer*, void) m_xSearchEdit->freeze(); xTreeLB->hide(); - initializeFirstNDialog(); + initializeAllDialogs(); m_xSearchEdit->thaw(); xTreeLB->show(); @@ -847,10 +847,9 @@ void OfaTreeOptionsDialog::selectFirstEntry() } } -void OfaTreeOptionsDialog::initializeFirstNDialog(sal_Int16 nNumberOfNode) +void OfaTreeOptionsDialog::initializeAllDialogs() { std::unique_ptr<weld::TreeIter> xEntry; - sal_Int16 nCount = 0; std::unique_ptr<weld::TreeIter> xTemp = xTreeLB->make_iterator(); bool bTemp = xTreeLB->get_iter_first(*xTemp); @@ -877,12 +876,6 @@ void OfaTreeOptionsDialog::initializeFirstNDialog(sal_Int16 nNumberOfNode) } } - /* if nNumberOfNode is -1 (which is the default value if no parameter provided), - this function will initialize all dialogs since nCount always greater than -1 */ - if (nCount == nNumberOfNode) - break; - - ++nCount; bTemp = xTreeLB->iter_next(*xTemp); } } @@ -1187,15 +1180,6 @@ void OfaTreeOptionsDialog::ActivateLastSelection() xTreeLB->select(*xEntry); m_xSearchEdit->grab_focus(); SelectHdl_Impl(); - - // initializeFirstNDialog() can take a long time, show wait cursor - std::unique_ptr<weld::WaitObject> xWait(m_pParent ? new weld::WaitObject(m_pParent) : nullptr); - - /* initialize first 25 dialogs which are almost half of the dialogs - in a row while Options dialog opens. then clear&reselect to avoid UI test failures. */ - initializeFirstNDialog(25); - clearOptionsDialog(); - SelectHdl_Impl(); } void OfaTreeOptionsDialog::InitItemSets(OptionsGroupInfo& rGroupInfo) |