From 16d2876b61520a765a111d7c38d60b143e669a37 Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Thu, 31 Jan 2019 01:58:51 -0900 Subject: tdf#123021 Fix options dialog cancel doesn't cancel chart color changes ...and add missed variable inititialization in options uitest that causes Jenkins to report test failure when testing patches concerning options charts default colors page. Change-Id: I324bcbb7834abf1a270bfce01eb84db280420409 Reviewed-on: https://gerrit.libreoffice.org/67236 Tested-by: Jenkins Reviewed-by: Markus Mohrhard --- cui/source/options/optchart.cxx | 13 +++++++++---- cui/source/options/optchart.hxx | 2 ++ cui/source/options/treeopt.cxx | 5 +++++ 3 files changed, 16 insertions(+), 4 deletions(-) (limited to 'cui') diff --git a/cui/source/options/optchart.cxx b/cui/source/options/optchart.cxx index 2bb82ded9621..4645f4ea10d0 100644 --- a/cui/source/options/optchart.cxx +++ b/cui/source/options/optchart.cxx @@ -139,12 +139,8 @@ SvxDefaultColorOptPage::~SvxDefaultColorOptPage() void SvxDefaultColorOptPage::dispose() { - // save changes if (pChartOptions) { - pChartOptions->SetDefaultColors( pColorConfig->GetColorList() ); - pChartOptions->Commit(); - pColorConfig.reset(); pChartOptions.reset(); } @@ -200,6 +196,15 @@ void SvxDefaultColorOptPage::FillPaletteLB() } } +void SvxDefaultColorOptPage::SaveChartOptions() +{ + if (pChartOptions) + { + pChartOptions->SetDefaultColors( pColorConfig->GetColorList() ); + pChartOptions->Commit(); + } +} + // event handlers diff --git a/cui/source/options/optchart.hxx b/cui/source/options/optchart.hxx index 19db288db8e1..f99f0798cf79 100644 --- a/cui/source/options/optchart.hxx +++ b/cui/source/options/optchart.hxx @@ -72,6 +72,8 @@ public: static VclPtr Create( TabPageParent pParent, const SfxItemSet* rInAttrs ); virtual bool FillItemSet( SfxItemSet* rOutAttrs ) override; virtual void Reset( const SfxItemSet* rInAttrs ) override; + + void SaveChartOptions(); }; #endif // INCLUDED_CUI_SOURCE_OPTIONS_OPTCHART_HXX diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index c1383ea4e16b..0c01d7fc677c 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -683,6 +683,11 @@ void OfaTreeOptionsDialog::ApplyOptions(bool deactivate) } pPageInfo->m_pExtPage->SavePage(); } + if ( pPageInfo->m_pPage && RID_OPTPAGE_CHART_DEFCOLORS == pPageInfo->m_nPageId ) + { + SvxDefaultColorOptPage* pPage = static_cast(pPageInfo->m_pPage.get()); + pPage->SaveChartOptions(); + } } pEntry = pTreeLB->Next(pEntry); } -- cgit