summaryrefslogtreecommitdiff
path: root/chart2/source/controller/sidebar/ChartAxisPanel.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'chart2/source/controller/sidebar/ChartAxisPanel.cxx')
-rw-r--r--chart2/source/controller/sidebar/ChartAxisPanel.cxx72
1 files changed, 33 insertions, 39 deletions
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
index 2b6bc5535b27..7554d164f11f 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
@@ -17,11 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/chart/ChartAxisLabelPosition.hpp>
#include <com/sun/star/chart2/AxisOrientation.hpp>
-#include <com/sun/star/chart2/XAxis.hpp>
-#include <com/sun/star/util/XModifyBroadcaster.hpp>
#include <vcl/svapp.hxx>
#include <sal/log.hxx>
@@ -29,6 +26,7 @@
#include "ChartAxisPanel.hxx"
#include <ChartController.hxx>
#include <ChartModel.hxx>
+#include <Axis.hxx>
using namespace css;
using namespace css::uno;
@@ -38,15 +36,14 @@ namespace chart::sidebar {
namespace {
bool isLabelShown(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return false;
- uno::Any aAny = xAxis->getPropertyValue("DisplayLabels");
+ uno::Any aAny = xAxis->getPropertyValue(u"DisplayLabels"_ustr);
if (!aAny.hasValue())
return false;
@@ -56,15 +53,14 @@ bool isLabelShown(const rtl::Reference<::chart::ChartModel>& xModel,
}
void setLabelShown(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, bool bVisible)
+ std::u16string_view rCID, bool bVisible)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return;
- xAxis->setPropertyValue("DisplayLabels", css::uno::Any(bVisible));
+ xAxis->setPropertyValue(u"DisplayLabels"_ustr, css::uno::Any(bVisible));
}
struct AxisLabelPosMap
@@ -81,15 +77,14 @@ AxisLabelPosMap const aLabelPosMap[] = {
};
sal_Int32 getLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return 0;
- uno::Any aAny = xAxis->getPropertyValue("LabelPosition");
+ uno::Any aAny = xAxis->getPropertyValue(u"LabelPosition"_ustr);
if (!aAny.hasValue())
return 0;
@@ -105,10 +100,9 @@ sal_Int32 getLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel,
}
void setLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, sal_Int32 nPos)
+ std::u16string_view rCID, sal_Int32 nPos)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis = ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return;
@@ -120,13 +114,13 @@ void setLabelPosition(const rtl::Reference<::chart::ChartModel>& xModel,
ePos = i.ePos;
}
- xAxis->setPropertyValue("LabelPosition", css::uno::Any(ePos));
+ xAxis->setPropertyValue(u"LabelPosition"_ustr, css::uno::Any(ePos));
}
bool isReverse(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
- css::uno::Reference< css::chart2::XAxis > xAxis =
+ rtl::Reference< Axis > xAxis =
ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
@@ -138,9 +132,9 @@ bool isReverse(const rtl::Reference<::chart::ChartModel>& xModel,
}
void setReverse(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, bool bReverse)
+ std::u16string_view rCID, bool bReverse)
{
- css::uno::Reference< css::chart2::XAxis > xAxis =
+ rtl::Reference< Axis > xAxis =
ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
@@ -176,27 +170,27 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
}
void setAxisRotation(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID, double nVal)
+ std::u16string_view rCID, double nVal)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis =
+ ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return;
- xAxis->setPropertyValue("TextRotation", css::uno::Any(nVal));
+ xAxis->setPropertyValue(u"TextRotation"_ustr, css::uno::Any(nVal));
}
double getAxisRotation(const rtl::Reference<::chart::ChartModel>& xModel,
- const OUString& rCID)
+ std::u16string_view rCID)
{
- css::uno::Reference< css::beans::XPropertySet > xAxis(
- ObjectIdentifier::getAxisForCID(rCID, xModel), uno::UNO_QUERY );
+ rtl::Reference< ::chart::Axis > xAxis =
+ ObjectIdentifier::getAxisForCID(rCID, xModel);
if (!xAxis.is())
return 0;
- css::uno::Any aAny = xAxis->getPropertyValue("TextRotation");
+ css::uno::Any aAny = xAxis->getPropertyValue(u"TextRotation"_ustr);
double nVal = 0;
aAny >>= nVal;
return nVal;
@@ -207,12 +201,12 @@ double getAxisRotation(const rtl::Reference<::chart::ChartModel>& xModel,
ChartAxisPanel::ChartAxisPanel(
weld::Widget* pParent,
ChartController* pController)
- : PanelLayout(pParent, "ChartAxisPanel", "modules/schart/ui/sidebaraxis.ui")
- , mxCBShowLabel(m_xBuilder->weld_check_button("checkbutton_show_label"))
- , mxCBReverse(m_xBuilder->weld_check_button("checkbutton_reverse"))
- , mxLBLabelPos(m_xBuilder->weld_combo_box("comboboxtext_label_position"))
- , mxGridLabel(m_xBuilder->weld_widget("label_props"))
- , mxNFRotation(m_xBuilder->weld_metric_spin_button("spinbutton1", FieldUnit::DEGREE))
+ : PanelLayout(pParent, u"ChartAxisPanel"_ustr, u"modules/schart/ui/sidebaraxis.ui"_ustr)
+ , mxCBShowLabel(m_xBuilder->weld_check_button(u"checkbutton_show_label"_ustr))
+ , mxCBReverse(m_xBuilder->weld_check_button(u"checkbutton_reverse"_ustr))
+ , mxLBLabelPos(m_xBuilder->weld_combo_box(u"comboboxtext_label_position"_ustr))
+ , mxGridLabel(m_xBuilder->weld_widget(u"label_props"_ustr))
+ , mxNFRotation(m_xBuilder->weld_metric_spin_button(u"spinbutton1"_ustr, FieldUnit::DEGREE))
, mxModel(pController->getChartModel())
, mxModifyListener(new ChartSidebarModifyListener(this))
, mxSelectionListener(new ChartSidebarSelectionListener(this, OBJECTTYPE_AXIS))
@@ -278,7 +272,7 @@ std::unique_ptr<PanelLayout> ChartAxisPanel::Create (
ChartController* pController)
{
if (pParent == nullptr)
- throw lang::IllegalArgumentException("no parent Window given to ChartAxisPanel::Create", nullptr, 0);
+ throw lang::IllegalArgumentException(u"no parent Window given to ChartAxisPanel::Create"_ustr, nullptr, 0);
return std::make_unique<ChartAxisPanel>(pParent, pController);
}
@@ -306,7 +300,7 @@ void ChartAxisPanel::modelInvalid()
mbModelValid = false;
}
-void ChartAxisPanel::doUpdateModel(rtl::Reference<::chart::ChartModel> xModel)
+void ChartAxisPanel::doUpdateModel(const rtl::Reference<::chart::ChartModel>& xModel)
{
if (mbModelValid)
{