From 806c696ccdac69e274cbfeac0cb45ea59555c01d Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 29 Oct 2020 16:04:13 +0000 Subject: call ExtPage::DeactivatePage for apply as well as ok MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I think the concerns at https://gerrit.libreoffice.org/c/core/+/54980/ are on balance overly conservative and its safer to make apply behave the same as ok wrt that call Change-Id: I889290c23dc9a7d4bb751769a509932142be5795 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105019 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- cui/source/inc/treeopt.hxx | 2 +- cui/source/options/treeopt.cxx | 11 ++++------- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'cui') diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx index e0ec4eb42354..4c7bfe8986ac 100644 --- a/cui/source/inc/treeopt.hxx +++ b/cui/source/inc/treeopt.hxx @@ -156,7 +156,7 @@ private: static VectorOfNodes LoadNodes( Module* pModule, const OUString& rExtensionId ); void InsertNodes( const VectorOfNodes& rNodeList ); - void ApplyOptions( bool deactivate ); + void ApplyOptions(); DECL_LINK(ShowPageHdl_Impl, weld::TreeView&, void); DECL_LINK(BackHdl_Impl, weld::Button&, void); diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 5cb3fde4677b..7b537238f9c5 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -638,7 +638,7 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, BackHdl_Impl, weld::Button&, void) pPageInfo->m_xExtPage->ResetPage(); } -void OfaTreeOptionsDialog::ApplyOptions(bool deactivate) +void OfaTreeOptionsDialog::ApplyOptions() { std::unique_ptr xEntry = xTreeLB->make_iterator(); bool bEntry = xTreeLB->get_iter_first(*xEntry); @@ -658,10 +658,7 @@ void OfaTreeOptionsDialog::ApplyOptions(bool deactivate) if ( pPageInfo->m_xExtPage ) { - if ( deactivate ) - { - pPageInfo->m_xExtPage->DeactivatePage(); - } + pPageInfo->m_xExtPage->DeactivatePage(); pPageInfo->m_xExtPage->SavePage(); } if ( pPageInfo->m_xPage && RID_OPTPAGE_CHART_DEFCOLORS == pPageInfo->m_nPageId ) @@ -676,7 +673,7 @@ void OfaTreeOptionsDialog::ApplyOptions(bool deactivate) IMPL_LINK_NOARG(OfaTreeOptionsDialog, ApplyHdl_Impl, weld::Button&, void) { - ApplyOptions(/*deactivate =*/false); + ApplyOptions(); if ( bNeedsRestart ) { @@ -729,7 +726,7 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, OKHdl_Impl, weld::Button&, void) } } - ApplyOptions(/*deactivate =*/ true); + ApplyOptions(); m_xDialog->response(RET_OK); if ( bNeedsRestart ) -- cgit