summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/options/optchart.cxx13
-rw-r--r--cui/source/options/optchart.hxx2
-rw-r--r--cui/source/options/treeopt.cxx5
-rw-r--r--sc/qa/uitest/options/tdf122977.py1
4 files changed, 17 insertions, 4 deletions
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<SfxTabPage> 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<SvxDefaultColorOptPage *>(pPageInfo->m_pPage.get());
+ pPage->SaveChartOptions();
+ }
}
pEntry = pTreeLB->Next(pEntry);
}
diff --git a/sc/qa/uitest/options/tdf122977.py b/sc/qa/uitest/options/tdf122977.py
index 3ced68542fee..ee8d4ff3b4c1 100644
--- a/sc/qa/uitest/options/tdf122977.py
+++ b/sc/qa/uitest/options/tdf122977.py
@@ -34,6 +34,7 @@ class chartDefaultColors(UITestCase):
xDefault = xDialogOpt.getChild("default")
#click Default - reset
xDefault.executeAction("CLICK", tuple())
+ nrDefaultColors = get_state_as_dict(xColors)["EntryCount"]
nrDefaultColors1 = int(nrDefaultColors) + 1
xAdd.executeAction("CLICK", tuple()) #add new color
self.assertEqual(get_state_as_dict(xColors)["EntryCount"], str(nrDefaultColors1))