[Libreoffice-commits] core.git: Branch 'private/kohei/new-chart-type-skeleton' - chart2/inc chart2/Library_chartcontroller.mk chart2/source
Kohei Yoshida
kohei.yoshida at collabora.com
Fri Mar 28 11:59:27 PDT 2014
Rebased ref, commits from common ancestor:
commit c1374e9af2a8d46e7e43c688d08b040cc6cd6729
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Fri Mar 28 12:29:13 2014 -0400
Add API wrapper to handle properties of new GL3D chart type.
Now the new proprety gets properly imported and exported to and from ODF.
Also, more on replacing string literals with define macro constants.
Change-Id: I4b773d68610a8aeaeb239901dac166e4dc2dd80d
diff --git a/chart2/Library_chartcontroller.mk b/chart2/Library_chartcontroller.mk
index 86c2a04..b32d840 100644
--- a/chart2/Library_chartcontroller.mk
+++ b/chart2/Library_chartcontroller.mk
@@ -75,6 +75,7 @@ $(eval $(call gb_Library_add_exception_objects,chartcontroller,\
chart2/source/controller/chartapiwrapper/WrappedCharacterHeightProperty \
chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties \
chart2/source/controller/chartapiwrapper/WrappedGapwidthProperty \
+ chart2/source/controller/chartapiwrapper/WrappedGL3DProperties \
chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty \
chart2/source/controller/chartapiwrapper/WrappedScaleProperty \
chart2/source/controller/chartapiwrapper/WrappedScaleTextProperties \
diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx
index a02ba61..9f9d1cb 100644
--- a/chart2/inc/unonames.hxx
+++ b/chart2/inc/unonames.hxx
@@ -15,6 +15,8 @@
#define CHART_UNONAME_SPLINE_TYPE "SplineType"
#define CHART_UNONAME_SPLINE_ORDER "SplineOrder"
#define CHART_UNONAME_SPLINE_RESOLUTION "SplineResolution"
+#define CHART_UNONAME_CURVE_STYLE "CurveStyle"
+#define CHART_UNONAME_CURVE_RESOLUTION "CurveResolution"
#endif
diff --git a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
index 0e05e6d..822d32c 100644
--- a/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/DiagramWrapper.cxx
@@ -39,6 +39,7 @@
#include "WrappedSplineProperties.hxx"
#include "WrappedStockProperties.hxx"
#include "WrappedSceneProperty.hxx"
+#include "WrappedGL3DProperties.hxx"
#include "RelativePositionHelper.hxx"
#include "ContainerHelper.hxx"
#include "ControllerLockGuard.hxx"
@@ -471,6 +472,7 @@ private:
WrappedSplineProperties::addProperties( aProperties );
WrappedStockProperties::addProperties( aProperties );
WrappedAutomaticPositionProperties::addProperties( aProperties );
+ WrappedGL3DProperties::addProperties(aProperties);
::std::sort( aProperties.begin(), aProperties.end(),
::chart::PropertyNameLess() );
@@ -2045,6 +2047,7 @@ const std::vector< WrappedProperty* > DiagramWrapper::createWrappedProperties()
WrappedSplineProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
WrappedStockProperties::addWrappedProperties( aWrappedProperties, m_spChart2ModelContact );
WrappedAutomaticPositionProperties::addWrappedProperties( aWrappedProperties );
+ WrappedGL3DProperties::addWrappedProperties(aWrappedProperties, m_spChart2ModelContact);
aWrappedProperties.push_back( new WrappedDataRowSourceProperty( m_spChart2ModelContact ) );
aWrappedProperties.push_back( new WrappedStackingProperty( StackMode_Y_STACKED,m_spChart2ModelContact ) );
diff --git a/chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.cxx
new file mode 100644
index 0000000..a4beaf5
--- /dev/null
+++ b/chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.cxx
@@ -0,0 +1,146 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#include "WrappedGL3DProperties.hxx"
+#include "Chart2ModelContact.hxx"
+#include <unonames.hxx>
+#include <WrappedProperty.hxx>
+#include <DiagramHelper.hxx>
+
+#include <com/sun/star/beans/PropertyAttribute.hpp>
+#include <com/sun/star/chart2/XDiagram.hpp>
+
+using namespace com::sun::star;
+
+namespace chart { namespace wrapper {
+
+namespace {
+
+enum
+{
+ PROP_GL3DCHARTTYPE_ROUNDED_EDGE
+};
+
+class WrappedGL3DProperty : public WrappedProperty
+{
+ uno::Any maDefault;
+ boost::shared_ptr<Chart2ModelContact> mpModelContact;
+
+private:
+ uno::Reference<chart2::XChartType> getChartType() const
+ {
+ uno::Reference<chart2::XDiagram> xDiagram = mpModelContact->getChart2Diagram();
+ uno::Sequence<uno::Reference<chart2::XChartType> > aCTs =
+ DiagramHelper::getChartTypesFromDiagram(xDiagram);
+
+ for (sal_Int32 i = 0; i < aCTs.getLength(); ++i)
+ {
+ uno::Reference<chart2::XChartType> xThisCT = aCTs[i];
+ if (xThisCT->getChartType() == "com.sun.star.chart2.GL3DBarChartType")
+ // Found the right chart type.
+ return xThisCT;
+ }
+
+ return uno::Reference<chart2::XChartType>();
+ }
+
+public:
+ WrappedGL3DProperty( const OUString& rInName, const OUString& rOutName, const uno::Any& rDefault, const boost::shared_ptr<Chart2ModelContact>& pContact ) :
+ WrappedProperty(rInName, rOutName), maDefault(rDefault), mpModelContact(pContact) {}
+
+ virtual ~WrappedGL3DProperty() {}
+
+ virtual uno::Any getPropertyValue( const uno::Reference<beans::XPropertySet>& /*xInnerPS*/ ) const
+ throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ uno::Reference<chart2::XChartType> xCT = getChartType();
+ if (!xCT.is())
+ return uno::Any();
+
+ try
+ {
+ uno::Reference<beans::XPropertySet> xPS(xCT, uno::UNO_QUERY_THROW);
+ return xPS->getPropertyValue(CHART_UNONAME_ROUNDED_EDGE);
+ }
+ catch ( const uno::Exception& ) {}
+
+ return uno::Any();
+ };
+
+ virtual void setPropertyValue(
+ const uno::Any& rOutValue, const uno::Reference<beans::XPropertySet>& /*xInnerPS*/ ) const
+ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
+ lang::IllegalArgumentException, lang::WrappedTargetException,
+ uno::RuntimeException)
+ {
+ uno::Reference<chart2::XChartType> xCT = getChartType();
+ if (!xCT.is())
+ return;
+
+ try
+ {
+ uno::Reference<beans::XPropertySet> xPS(xCT, uno::UNO_QUERY_THROW);
+ return xPS->setPropertyValue(CHART_UNONAME_ROUNDED_EDGE, rOutValue);
+ }
+ catch ( const uno::Exception& ) {}
+ }
+
+ virtual void setPropertyToDefault( const uno::Reference<beans::XPropertyState>& /*xInnerPropState*/ ) const
+ throw (beans::UnknownPropertyException, uno::RuntimeException)
+ {
+ uno::Reference<chart2::XChartType> xCT = getChartType();
+ if (!xCT.is())
+ return;
+
+ try
+ {
+ uno::Reference<beans::XPropertySet> xPS(xCT, uno::UNO_QUERY_THROW);
+ return xPS->setPropertyValue(CHART_UNONAME_ROUNDED_EDGE, maDefault);
+ }
+ catch ( const uno::Exception& ) {}
+ }
+
+ virtual uno::Any getPropertyDefault( const uno::Reference<beans::XPropertyState>& /*xInnerPS*/ ) const
+ throw (beans::UnknownPropertyException, lang::WrappedTargetException, uno::RuntimeException)
+ {
+ return maDefault;
+ }
+
+ virtual beans::PropertyState getPropertyState( const uno::Reference<beans::XPropertyState>& /*xInnerPS*/ ) const
+ throw (beans::UnknownPropertyException, uno::RuntimeException)
+ {
+ return beans::PropertyState_DIRECT_VALUE;
+ }
+};
+
+}
+
+void WrappedGL3DProperties::addProperties( std::vector<css::beans::Property> & rOutProps )
+{
+ rOutProps.push_back(
+ beans::Property(
+ CHART_UNONAME_ROUNDED_EDGE,
+ PROP_GL3DCHARTTYPE_ROUNDED_EDGE,
+ ::getCppuBooleanType(),
+ beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT
+ )
+ );
+}
+
+void WrappedGL3DProperties::addWrappedProperties(
+ std::vector<WrappedProperty*>& rList, const boost::shared_ptr<Chart2ModelContact>& pChart2ModelContact )
+{
+ rList.push_back(
+ new WrappedGL3DProperty(
+ CHART_UNONAME_ROUNDED_EDGE, CHART_UNONAME_ROUNDED_EDGE, uno::makeAny(false), pChart2ModelContact));
+}
+
+}}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.hxx b/chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.hxx
new file mode 100644
index 0000000..90034a0
--- /dev/null
+++ b/chart2/source/controller/chartapiwrapper/WrappedGL3DProperties.hxx
@@ -0,0 +1,38 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef CHART2_WRAPPEDGL3DPROPERTIES_HXX
+#define CHART2_WRAPPEDGL3DPROPERTIES_HXX
+
+#include <vector>
+#include <boost/shared_ptr.hpp>
+
+#include <com/sun/star/beans/Property.hpp>
+
+namespace chart {
+
+class WrappedProperty;
+
+namespace wrapper {
+
+class Chart2ModelContact;
+
+class WrappedGL3DProperties
+{
+public:
+ static void addProperties( std::vector<css::beans::Property> & rOutProps );
+ static void addWrappedProperties(
+ std::vector<WrappedProperty*>& rList, const boost::shared_ptr<Chart2ModelContact>& pChart2ModelContact );
+};
+
+}}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
index baa7683..8ae43c4 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx
@@ -212,16 +212,16 @@ void WrappedSplineProperties::addWrappedProperties( std::vector< WrappedProperty
rList.push_back( new WrappedSplineTypeProperty( spChart2ModelContact ) );
rList.push_back(
new WrappedSplineProperty<sal_Int32>(
- CHART_UNONAME_SPLINE_ORDER, "SplineOrder", // same name ?
+ CHART_UNONAME_SPLINE_ORDER, CHART_UNONAME_SPLINE_ORDER,
uno::makeAny(sal_Int32(3)), spChart2ModelContact));
rList.push_back(
new WrappedSplineProperty<sal_Int32>(
- CHART_UNONAME_SPLINE_RESOLUTION, "CurveResolution",
+ CHART_UNONAME_SPLINE_RESOLUTION, CHART_UNONAME_CURVE_RESOLUTION,
uno::makeAny(sal_Int32(20)), spChart2ModelContact));
}
WrappedSplineTypeProperty::WrappedSplineTypeProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact )
- : WrappedSplineProperty<sal_Int32>(CHART_UNONAME_SPLINE_TYPE, "CurveStyle", uno::makeAny(sal_Int32(0)), spChart2ModelContact )
+ : WrappedSplineProperty<sal_Int32>(CHART_UNONAME_SPLINE_TYPE, CHART_UNONAME_CURVE_STYLE, uno::makeAny(sal_Int32(0)), spChart2ModelContact )
{
}
WrappedSplineTypeProperty::~WrappedSplineTypeProperty()
diff --git a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
index c31ffc8..ee1d899 100644
--- a/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
+++ b/chart2/source/controller/dialogs/ChartTypeDialogController.cxx
@@ -146,9 +146,9 @@ ChartTypeParameter ChartTypeDialogController::getChartTypeParameterForService(
{
try
{
- xTemplateProps->getPropertyValue( "CurveStyle" ) >>= aRet.eCurveStyle;
- xTemplateProps->getPropertyValue( "CurveResolution" ) >>= aRet.nCurveResolution;
- xTemplateProps->getPropertyValue( "SplineOrder" ) >>= aRet.nSplineOrder;
+ xTemplateProps->getPropertyValue( CHART_UNONAME_CURVE_STYLE ) >>= aRet.eCurveStyle;
+ xTemplateProps->getPropertyValue( CHART_UNONAME_CURVE_RESOLUTION ) >>= aRet.nCurveResolution;
+ xTemplateProps->getPropertyValue( CHART_UNONAME_SPLINE_ORDER ) >>= aRet.nSplineOrder;
}
catch( uno::Exception & ex )
{
@@ -291,9 +291,9 @@ uno::Reference< XChartTypeTemplate > ChartTypeDialogController::getCurrentTempla
{
try
{
- xTemplateProps->setPropertyValue( "CurveStyle" , uno::makeAny(rParameter.eCurveStyle) );
- xTemplateProps->setPropertyValue( "CurveResolution" , uno::makeAny(rParameter.nCurveResolution) );
- xTemplateProps->setPropertyValue( "SplineOrder" , uno::makeAny(rParameter.nSplineOrder) );
+ xTemplateProps->setPropertyValue( CHART_UNONAME_CURVE_STYLE , uno::makeAny(rParameter.eCurveStyle) );
+ xTemplateProps->setPropertyValue( CHART_UNONAME_CURVE_RESOLUTION , uno::makeAny(rParameter.nCurveResolution) );
+ xTemplateProps->setPropertyValue( CHART_UNONAME_SPLINE_ORDER , uno::makeAny(rParameter.nSplineOrder) );
}
catch( uno::Exception & ex )
{
diff --git a/chart2/source/model/template/LineChartType.cxx b/chart2/source/model/template/LineChartType.cxx
index 7733ed5..d1b9185 100644
--- a/chart2/source/model/template/LineChartType.cxx
+++ b/chart2/source/model/template/LineChartType.cxx
@@ -22,6 +22,8 @@
#include "macros.hxx"
#include "servicenames_charttypes.hxx"
#include "ContainerHelper.hxx"
+#include <unonames.hxx>
+
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/CurveStyle.hpp>
@@ -47,20 +49,20 @@ void lcl_AddPropertiesToVector(
::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
- Property( "CurveStyle",
+ Property( CHART_UNONAME_CURVE_STYLE,
PROP_LINECHARTTYPE_CURVE_STYLE,
::getCppuType( reinterpret_cast< const chart2::CurveStyle * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
- Property( "CurveResolution",
+ Property( CHART_UNONAME_CURVE_RESOLUTION,
PROP_LINECHARTTYPE_CURVE_RESOLUTION,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
- Property( "SplineOrder",
+ Property( CHART_UNONAME_SPLINE_ORDER,
PROP_LINECHARTTYPE_SPLINE_ORDER,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
diff --git a/chart2/source/model/template/LineChartTypeTemplate.cxx b/chart2/source/model/template/LineChartTypeTemplate.cxx
index 5d833df..2d70112 100644
--- a/chart2/source/model/template/LineChartTypeTemplate.cxx
+++ b/chart2/source/model/template/LineChartTypeTemplate.cxx
@@ -23,10 +23,12 @@
#include "servicenames_charttypes.hxx"
#include "ContainerHelper.hxx"
#include "DataSeriesHelper.hxx"
+#include "PropertyHelper.hxx"
+#include <unonames.hxx>
+
#include <com/sun/star/chart2/SymbolStyle.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
-#include "PropertyHelper.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <algorithm>
@@ -56,19 +58,19 @@ void lcl_AddPropertiesToVector(
::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
- Property( "CurveStyle",
+ Property( CHART_UNONAME_CURVE_STYLE,
PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE,
::getCppuType( reinterpret_cast< const chart2::CurveStyle * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
- Property( "CurveResolution",
+ Property( CHART_UNONAME_CURVE_RESOLUTION,
PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
- Property( "SplineOrder",
+ Property( CHART_UNONAME_SPLINE_ORDER,
PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
@@ -275,9 +277,9 @@ sal_Bool SAL_CALL LineChartTypeTemplate::matchesTemplate(
uno::Reference< beans::XPropertySet > xChartTypeProp(
DiagramHelper::getChartTypeByIndex( xDiagram, 0 ),
uno::UNO_QUERY_THROW );
- setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE, xChartTypeProp->getPropertyValue("CurveStyle") );
- setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, xChartTypeProp->getPropertyValue("CurveResolution") );
- setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER, xChartTypeProp->getPropertyValue("SplineOrder") );
+ setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE, xChartTypeProp->getPropertyValue(CHART_UNONAME_CURVE_STYLE) );
+ setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION, xChartTypeProp->getPropertyValue(CHART_UNONAME_CURVE_RESOLUTION) );
+ setFastPropertyValue_NoBroadcast( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER, xChartTypeProp->getPropertyValue(CHART_UNONAME_SPLINE_ORDER) );
}
catch( const uno::Exception & ex )
{
@@ -303,11 +305,11 @@ Reference< chart2::XChartType > LineChartTypeTemplate::getChartTypeForIndex( sal
if( xCTProp.is())
{
xCTProp->setPropertyValue(
- "CurveStyle", getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE ));
+ CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE ));
xCTProp->setPropertyValue(
- "CurveResolution", getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
+ CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
xCTProp->setPropertyValue(
- "SplineOrder", getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER ));
+ CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER ));
}
}
catch( const uno::Exception & ex )
@@ -337,11 +339,11 @@ Reference< chart2::XChartType > SAL_CALL LineChartTypeTemplate::getChartTypeForN
if( xCTProp.is())
{
xCTProp->setPropertyValue(
- "CurveStyle", getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE ));
+ CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_STYLE ));
xCTProp->setPropertyValue(
- "CurveResolution", getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
+ CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
xCTProp->setPropertyValue(
- "SplineOrder", getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER ));
+ CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_LINECHARTTYPE_TEMPLATE_SPLINE_ORDER ));
}
}
catch( const uno::Exception & ex )
diff --git a/chart2/source/model/template/ScatterChartType.cxx b/chart2/source/model/template/ScatterChartType.cxx
index 9f33147..7d83da3 100644
--- a/chart2/source/model/template/ScatterChartType.cxx
+++ b/chart2/source/model/template/ScatterChartType.cxx
@@ -25,6 +25,8 @@
#include "CartesianCoordinateSystem.hxx"
#include "AxisHelper.hxx"
#include "AxisIndexDefines.hxx"
+#include <unonames.hxx>
+
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart2/AxisType.hpp>
#include <com/sun/star/chart2/CurveStyle.hpp>
@@ -51,20 +53,20 @@ void lcl_AddPropertiesToVector(
::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
- Property( "CurveStyle",
+ Property( CHART_UNONAME_CURVE_STYLE,
PROP_SCATTERCHARTTYPE_CURVE_STYLE,
::getCppuType( reinterpret_cast< const chart2::CurveStyle * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
- Property( "CurveResolution",
+ Property( CHART_UNONAME_CURVE_RESOLUTION,
PROP_SCATTERCHARTTYPE_CURVE_RESOLUTION,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
- Property( "SplineOrder",
+ Property( CHART_UNONAME_SPLINE_ORDER,
PROP_SCATTERCHARTTYPE_SPLINE_ORDER,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
diff --git a/chart2/source/model/template/ScatterChartTypeTemplate.cxx b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
index 2312ae8..0f9d3a3 100644
--- a/chart2/source/model/template/ScatterChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ScatterChartTypeTemplate.cxx
@@ -25,10 +25,12 @@
#include "servicenames_charttypes.hxx"
#include "ContainerHelper.hxx"
#include "DataSeriesHelper.hxx"
+#include "PropertyHelper.hxx"
+#include <unonames.hxx>
+
#include <com/sun/star/chart2/SymbolStyle.hpp>
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/drawing/LineStyle.hpp>
-#include "PropertyHelper.hxx"
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <algorithm>
@@ -58,19 +60,19 @@ void lcl_AddPropertiesToVector(
::std::vector< Property > & rOutProperties )
{
rOutProperties.push_back(
- Property( "CurveStyle",
+ Property( CHART_UNONAME_CURVE_STYLE,
PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE,
::getCppuType( reinterpret_cast< const chart2::CurveStyle * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
- Property( "CurveResolution",
+ Property( CHART_UNONAME_CURVE_RESOLUTION,
PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
- Property( "SplineOrder",
+ Property( CHART_UNONAME_SPLINE_ORDER,
PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER,
::getCppuType( reinterpret_cast< const sal_Int32 * >(0)),
beans::PropertyAttribute::BOUND
@@ -309,9 +311,9 @@ sal_Bool SAL_CALL ScatterChartTypeTemplate::matchesTemplate(
uno::Reference< beans::XPropertySet > xChartTypeProp(
DiagramHelper::getChartTypeByIndex( xDiagram, 0 ),
uno::UNO_QUERY_THROW );
- setFastPropertyValue_NoBroadcast( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE, xChartTypeProp->getPropertyValue("CurveStyle") );
- setFastPropertyValue_NoBroadcast( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION, xChartTypeProp->getPropertyValue("CurveResolution") );
- setFastPropertyValue_NoBroadcast( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER, xChartTypeProp->getPropertyValue("SplineOrder") );
+ setFastPropertyValue_NoBroadcast( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE, xChartTypeProp->getPropertyValue(CHART_UNONAME_CURVE_STYLE) );
+ setFastPropertyValue_NoBroadcast( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION, xChartTypeProp->getPropertyValue(CHART_UNONAME_CURVE_RESOLUTION) );
+ setFastPropertyValue_NoBroadcast( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER, xChartTypeProp->getPropertyValue(CHART_UNONAME_SPLINE_ORDER) );
}
catch( const uno::Exception & ex )
{
@@ -337,11 +339,11 @@ Reference< chart2::XChartType > ScatterChartTypeTemplate::getChartTypeForIndex(
if( xCTProp.is())
{
xCTProp->setPropertyValue(
- "CurveStyle", getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE ));
+ CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE ));
xCTProp->setPropertyValue(
- "CurveResolution", getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
+ CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
xCTProp->setPropertyValue(
- "SplineOrder", getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER ));
+ CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER ));
}
}
catch( const uno::Exception & ex )
@@ -371,11 +373,11 @@ Reference< chart2::XChartType > SAL_CALL ScatterChartTypeTemplate::getChartTypeF
if( xCTProp.is())
{
xCTProp->setPropertyValue(
- "CurveStyle", getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE ));
+ CHART_UNONAME_CURVE_STYLE, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_STYLE ));
xCTProp->setPropertyValue(
- "CurveResolution", getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
+ CHART_UNONAME_CURVE_RESOLUTION, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_CURVE_RESOLUTION ));
xCTProp->setPropertyValue(
- "SplineOrder", getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER ));
+ CHART_UNONAME_SPLINE_ORDER, getFastPropertyValue( PROP_SCATTERCHARTTYPE_TEMPLATE_SPLINE_ORDER ));
}
}
catch( const uno::Exception & ex )
diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index 2cc53b6..ce557ad 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -30,6 +30,7 @@
#include "Clipping.hxx"
#include "Stripe.hxx"
#include "DateHelper.hxx"
+#include <unonames.hxx>
#include <com/sun/star/chart2/Symbol.hpp>
#include <com/sun/star/chart/DataLabelPlacement.hpp>
@@ -76,9 +77,9 @@ AreaChart::AreaChart( const uno::Reference<XChartType>& xChartTypeModel
{
if( m_xChartTypeModelProps.is() )
{
- m_xChartTypeModelProps->getPropertyValue("CurveStyle") >>= m_eCurveStyle;
- m_xChartTypeModelProps->getPropertyValue("CurveResolution") >>= m_nCurveResolution;
- m_xChartTypeModelProps->getPropertyValue("SplineOrder") >>= m_nSplineOrder;
+ m_xChartTypeModelProps->getPropertyValue(CHART_UNONAME_CURVE_STYLE) >>= m_eCurveStyle;
+ m_xChartTypeModelProps->getPropertyValue(CHART_UNONAME_CURVE_RESOLUTION) >>= m_nCurveResolution;
+ m_xChartTypeModelProps->getPropertyValue(CHART_UNONAME_SPLINE_ORDER) >>= m_nSplineOrder;
}
}
catch( uno::Exception& e )
More information about the Libreoffice-commits
mailing list