summaryrefslogtreecommitdiff
path: root/chart2/source
diff options
context:
space:
mode:
authorMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-09-20 21:29:41 +0200
committerMarkus Mohrhard <markus.mohrhard@googlemail.com>2015-09-20 21:33:58 +0200
commit85eb1e5148ec657c8e582a0faf3ffa75009a4788 (patch)
tree8db62c278ce2ec3b657f5ece9f9d2b47eb580e74 /chart2/source
parente1afea91e9662424480b8ad9f50842cfa224331e (diff)
use localized string for title text, tdf#94294
Change-Id: Id27e5c3794b728ce79d63b6c7d552df0cc1ba239
Diffstat (limited to 'chart2/source')
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.cxx49
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.hxx8
2 files changed, 37 insertions, 20 deletions
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index 985f9974a163..8d9317a8199a 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -37,7 +37,6 @@
#include <comphelper/processfactory.hxx>
#include "LegendHelper.hxx"
-#include "TitleHelper.hxx"
#include "ChartModelHelper.hxx"
#include "AxisHelper.hxx"
#include "DiagramHelper.hxx"
@@ -119,18 +118,6 @@ 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));
@@ -313,6 +300,12 @@ ChartElementsPanel::ChartElementsPanel(
get(mpLBLegendPosition, "comboboxtext_legend");
get(mpBoxLegend, "box_legend");
+ get(mpTextTitle, "text_title");
+ get(mpTextSubTitle, "text_subtitle");
+
+ maTextTitle = mpTextTitle->GetText();
+ maTextSubTitle = mpTextSubTitle->GetText();
+
Initialize();
}
@@ -347,6 +340,9 @@ void ChartElementsPanel::dispose()
mpLBLegendPosition.clear();
mpBoxLegend.clear();
+ mpTextTitle.clear();
+ mpTextSubTitle.clear();
+
PanelLayout::dispose();
}
@@ -472,29 +468,29 @@ IMPL_LINK_TYPED(ChartElementsPanel, CheckBoxHdl, Button*, pButton, void)
CheckBox* pCheckBox = static_cast<CheckBox*>(pButton);
bool bChecked = pCheckBox->IsChecked();
if (pCheckBox == mpCBTitle.get())
- setTitleVisible(mxModel, TitleHelper::MAIN_TITLE, bChecked);
+ setTitleVisible(TitleHelper::MAIN_TITLE, bChecked);
else if (pCheckBox == mpCBSubtitle.get())
- setTitleVisible(mxModel, TitleHelper::SUB_TITLE, bChecked);
+ setTitleVisible(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);
+ setTitleVisible(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);
+ setTitleVisible(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);
+ setTitleVisible(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);
+ setTitleVisible(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);
+ setTitleVisible(TitleHelper::SECONDARY_Y_AXIS_TITLE, bChecked);
else if (pCheckBox == mpCBLegend.get())
{
mpBoxLegend->Enable( bChecked );
@@ -517,6 +513,19 @@ IMPL_LINK_NOARG(ChartElementsPanel, LegendPosHdl)
return 0;
}
+void ChartElementsPanel::setTitleVisible(TitleHelper::eTitleType eTitle, bool bVisible)
+{
+ if (bVisible)
+ {
+ OUString aText = eTitle == TitleHelper::SUB_TITLE ? maTextSubTitle : maTextTitle;
+ TitleHelper::createTitle(eTitle, aText, mxModel, comphelper::getProcessComponentContext());
+ }
+ else
+ {
+ TitleHelper::removeTitle(eTitle, mxModel);
+ }
+}
+
}} // end of namespace ::chart::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index c5ffae24e632..39d78d9ddaac 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -25,6 +25,7 @@
#include <svx/sidebar/PanelLayout.hxx>
#include <vcl/layout.hxx>
#include "ChartSidebarModifyListener.hxx"
+#include "TitleHelper.hxx"
#include <com/sun/star/util/XModifyListener.hpp>
@@ -89,6 +90,8 @@ private:
VclPtr<CheckBox> mpCBGridHorizontalMajor;
VclPtr<CheckBox> mpCBGridVerticalMinor;
VclPtr<CheckBox> mpCBGridHorizontalMinor;
+ VclPtr<FixedText> mpTextTitle;
+ VclPtr<FixedText> mpTextSubTitle;
VclPtr<ListBox> mpLBLegendPosition;
VclPtr<VclHBox> mpBoxLegend;
@@ -101,8 +104,13 @@ private:
bool mbModelValid;
+ OUString maTextTitle;
+ OUString maTextSubTitle;
+
void Initialize();
+ void setTitleVisible(TitleHelper::eTitleType eTitle, bool bVisible);
+
DECL_LINK_TYPED(CheckBoxHdl, Button*, void);
DECL_LINK(LegendPosHdl, void*);
};