summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-15 21:26:05 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-07-16 08:15:19 +0200
commit6503c1c9c4fa0c0f07b1890668dab5799187053b (patch)
tree2360b349be0c56dce86935abaa2807e14a361a10
parent374d3fbf89830a8ee8f4e2e3a802aa408b15afe4 (diff)
handle change to grid line checkboxes
Change-Id: Ib39dc1669dfefe82eaefff1608de4fe1d4ef5832
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.cxx24
1 files changed, 24 insertions, 0 deletions
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 8aa044b9a518..e073e5fcd92c 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -183,6 +183,26 @@ bool isGridVisible(css::uno::Reference<css::frame::XModel> xModel, GridType eTyp
return false;
}
+void setGridVisible(css::uno::Reference<css::frame::XModel> xModel, GridType eType, bool bVisible)
+{
+ Reference< chart2::XDiagram > xDiagram(ChartModelHelper::findDiagram(xModel));
+ if(xDiagram.is())
+ {
+ sal_Int32 nDimensionIndex = 0;
+ if (eType == GridType::HOR_MAJOR || eType == GridType::HOR_MINOR)
+ nDimensionIndex = 1;
+ sal_Int32 nCooSysIndex = 0;
+
+ bool bMajor = (eType == GridType::HOR_MAJOR || eType == GridType::VERT_MAJOR);
+
+ if (bVisible)
+ AxisHelper::showGrid(nDimensionIndex, nCooSysIndex, bMajor,
+ xDiagram, comphelper::getProcessComponentContext());
+ else
+ AxisHelper::hideGrid(nDimensionIndex, nCooSysIndex, bMajor, xDiagram);
+ }
+}
+
bool isAxisVisible(css::uno::Reference<css::frame::XModel> xModel, AxisType eType)
{
Reference< chart2::XDiagram > xDiagram(ChartModelHelper::findDiagram(xModel));
@@ -416,6 +436,10 @@ IMPL_LINK(ChartElementsPanel, CheckBoxHdl, CheckBox*, pCheckBox)
setTitleVisible(mxModel, TitleHelper::SECONDARY_Y_AXIS_TITLE, bChecked);
else if (pCheckBox == mpCBLegend.get())
setLegendVisible(mxModel, bChecked);
+ else if (pCheckBox == mpCBGridVertical.get())
+ setGridVisible(mxModel, GridType::VERT_MAJOR, bChecked);
+ else if (pCheckBox == mpCBGridHorizontal.get())
+ setGridVisible(mxModel, GridType::HOR_MAJOR, bChecked);
return 0;
}