diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-15 18:34:37 +0200 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2015-07-16 08:15:19 +0200 |
commit | 234ac0e3e8a0c6e791f6fa2f9f947979bd6f7c6f (patch) | |
tree | da6b1e6dc862d2f7c249bd9dc447d4699c557441 | |
parent | 209f0824338e7e1882373116d052d1a701fac6e6 (diff) |
also react to title checkboxes
This needs to improved when tdf#92768 has been implemented. Also we need
to rethink the default strings.
Change-Id: I74b9bdf0caeaf314f103aa7b13dad3215e828423
-rw-r--r-- | chart2/source/controller/sidebar/ChartElementsPanel.cxx | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx index 3e3aed5eee68..1c22c605d9b4 100644 --- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx +++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx @@ -141,6 +141,18 @@ bool isTitleVisisble(css::uno::Reference<css::frame::XModel> xModel, TitleHelper return TitleHelper::getTitle(eTitle, xModel).is(); } +void setTitleVisible(css::uno::Reference<css::frame::XModel> xModel, TitleHelper::eTitleType eTitle, bool bVisible) +{ + if (bVisible) + { + TitleHelper::createTitle(eTitle, "Title", xModel, comphelper::getProcessComponentContext()); + } + else + { + TitleHelper::removeTitle(eTitle, xModel); + } +} + bool isGridVisible(css::uno::Reference<css::frame::XModel> xModel, GridType eType) { Reference< chart2::XDiagram > xDiagram(ChartModelHelper::findDiagram(xModel)); @@ -367,16 +379,29 @@ IMPL_LINK(ChartElementsPanel, CheckBoxHdl, CheckBox*, pCheckBox) { bool bChecked = pCheckBox->IsChecked(); if (pCheckBox == mpCBTitle.get()) - { - } + setTitleVisible(mxModel, TitleHelper::MAIN_TITLE, bChecked); + else if (pCheckBox == mpCBSubtitle.get()) + setTitleVisible(mxModel, TitleHelper::SUB_TITLE, bChecked); else if (pCheckBox == mpCBXAxis.get()) setAxisVisible(mxModel, AxisType::X_MAIN, bChecked); + else if (pCheckBox == mpCBXAxisTitle.get()) + setTitleVisible(mxModel, TitleHelper::X_AXIS_TITLE, bChecked); else if (pCheckBox == mpCBYAxis.get()) setAxisVisible(mxModel, AxisType::Y_MAIN, bChecked); + else if (pCheckBox == mpCBYAxisTitle.get()) + setTitleVisible(mxModel, TitleHelper::Y_AXIS_TITLE, bChecked); + else if (pCheckBox == mpCBZAxis.get()) + setAxisVisible(mxModel, AxisType::Z_MAIN, bChecked); + else if (pCheckBox == mpCBZAxisTitle.get()) + setTitleVisible(mxModel, TitleHelper::Z_AXIS_TITLE, bChecked); else if (pCheckBox == mpCB2ndXAxis.get()) setAxisVisible(mxModel, AxisType::X_SECOND, bChecked); + else if (pCheckBox == mpCB2ndXAxisTitle.get()) + setTitleVisible(mxModel, TitleHelper::SECONDARY_X_AXIS_TITLE, bChecked); else if (pCheckBox == mpCB2ndYAxis.get()) setAxisVisible(mxModel, AxisType::Y_SECOND, bChecked); + else if (pCheckBox == mpCB2ndYAxisTitle.get()) + setTitleVisible(mxModel, TitleHelper::SECONDARY_Y_AXIS_TITLE, bChecked); return 0; } |