call ExtPage::DeactivatePage for apply as well as ok
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 <caolanm@redhat.com>
diff --git a/cui/source/inc/treeopt.hxx b/cui/source/inc/treeopt.hxx
index e0ec4eb..4c7bfe8 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 5cb3fde..7b53723 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<weld::TreeIter> 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 )