summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-15 21:15:15 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-16 08:15:19 +0200
commit374d3fbf89830a8ee8f4e2e3a802aa408b15afe4 (patch)
treed8461c47e02f98bc54dd9c9bf5c254a260f8ffd5
parent234ac0e3e8a0c6e791f6fa2f9f947979bd6f7c6f (diff)
handle changes to legend checkbox
Change-Id: I3901ce4f7664eb7b8eca50014f5916fd6ccb0854
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.cxx14
1 files changed, 14 insertions, 0 deletions
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 1c22c605d9b4..8aa044b9a518 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -136,6 +136,18 @@ bool isLegendVisible(css::uno::Reference<css::frame::XModel> xModel)
return false;
}
+void setLegendVisible(css::uno::Reference<css::frame::XModel> xModel, bool bVisible)
+{
+ ChartModel* pModel = getChartModel(xModel);
+ if (!pModel)
+ return;
+
+ if (bVisible)
+ LegendHelper::showLegend(*pModel, comphelper::getProcessComponentContext());
+ else
+ LegendHelper::hideLegend(*pModel);
+}
+
bool isTitleVisisble(css::uno::Reference<css::frame::XModel> xModel, TitleHelper::eTitleType eTitle)
{
return TitleHelper::getTitle(eTitle, xModel).is();
@@ -402,6 +414,8 @@ IMPL_LINK(ChartElementsPanel, CheckBoxHdl, CheckBox*, pCheckBox)
setAxisVisible(mxModel, AxisType::Y_SECOND, bChecked);
else if (pCheckBox == mpCB2ndYAxisTitle.get())
setTitleVisible(mxModel, TitleHelper::SECONDARY_Y_AXIS_TITLE, bChecked);
+ else if (pCheckBox == mpCBLegend.get())
+ setLegendVisible(mxModel, bChecked);
return 0;
}