diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-28 12:11:43 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-03-29 00:47:21 -0400 |
commit | de7c0f31b5773296c8af6692e7155119209d07ef (patch) | |
tree | a2dad52b0a3fdebff1e9ba01b9f7ff7870bd9ee4 /chart2 | |
parent | 0be6a5ef376e1841bf60658b41d0f56d07caf2a3 (diff) |
Let's use define constants here rather than string values....
Easier to keep track of their call sites.
Change-Id: I5f874194425ae8f5043bef45cce63a5e1d51a400
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/inc/unonames.hxx | 7 | ||||
-rw-r--r-- | chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx | 20 |
2 files changed, 19 insertions, 8 deletions
diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx index 6f800f8d40e2..a02ba61523cc 100644 --- a/chart2/inc/unonames.hxx +++ b/chart2/inc/unonames.hxx @@ -10,8 +10,11 @@ #ifndef CHART2_UNONAMES_HXX #define CHART2_UNONAMES_HXX -#define CHART_UNONAME_SORT_BY_XVALUES "SortByXValues" -#define CHART_UNONAME_ROUNDED_EDGE "RoundedEdge" +#define CHART_UNONAME_SORT_BY_XVALUES "SortByXValues" +#define CHART_UNONAME_ROUNDED_EDGE "RoundedEdge" +#define CHART_UNONAME_SPLINE_TYPE "SplineType" +#define CHART_UNONAME_SPLINE_ORDER "SplineOrder" +#define CHART_UNONAME_SPLINE_RESOLUTION "SplineResolution" #endif diff --git a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx index 3edef79bf576..4adf8ea209d1 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSplineProperties.cxx @@ -21,6 +21,8 @@ #include "macros.hxx" #include "FastPropertyIdRanges.hxx" #include "DiagramHelper.hxx" +#include <unonames.hxx> + #include <com/sun/star/chart2/CurveStyle.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -182,21 +184,21 @@ enum void WrappedSplineProperties::addProperties( ::std::vector< Property > & rOutProperties ) { rOutProperties.push_back( - Property( "SplineType", + Property( CHART_UNONAME_SPLINE_TYPE, PROP_CHART_SPLINE_TYPE, ::getCppuType( reinterpret_cast< sal_Int32 * >(0)), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT | beans::PropertyAttribute::MAYBEVOID )); rOutProperties.push_back( - Property( "SplineOrder", + Property( CHART_UNONAME_SPLINE_ORDER, PROP_CHART_SPLINE_ORDER, ::getCppuType( reinterpret_cast< sal_Int32 * >(0)), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT | beans::PropertyAttribute::MAYBEVOID )); rOutProperties.push_back( - Property( "SplineResolution", + Property( CHART_UNONAME_SPLINE_RESOLUTION, PROP_CHART_SPLINE_RESOLUTION, ::getCppuType( reinterpret_cast< sal_Int32 * >(0)), beans::PropertyAttribute::BOUND @@ -208,12 +210,18 @@ void WrappedSplineProperties::addWrappedProperties( std::vector< WrappedProperty , ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ) { rList.push_back( new WrappedSplineTypeProperty( spChart2ModelContact ) ); - rList.push_back( new WrappedSplineProperty<sal_Int32>( "SplineOrder", "SplineOrder", uno::makeAny(sal_Int32(3)), spChart2ModelContact ) ); - rList.push_back( new WrappedSplineProperty<sal_Int32>( "SplineResolution", "CurveResolution", uno::makeAny(sal_Int32(20)), spChart2ModelContact ) ); + rList.push_back( + new WrappedSplineProperty<sal_Int32>( + CHART_UNONAME_SPLINE_ORDER, "SplineOrder", // same name ? + uno::makeAny(sal_Int32(3)), spChart2ModelContact)); + rList.push_back( + new WrappedSplineProperty<sal_Int32>( + CHART_UNONAME_SPLINE_RESOLUTION, "CurveResolution", + uno::makeAny(sal_Int32(20)), spChart2ModelContact)); } WrappedSplineTypeProperty::WrappedSplineTypeProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ) - : WrappedSplineProperty<sal_Int32>( "SplineType", "CurveStyle", uno::makeAny(sal_Int32(0)), spChart2ModelContact ) + : WrappedSplineProperty<sal_Int32>(CHART_UNONAME_SPLINE_TYPE, "CurveStyle", uno::makeAny(sal_Int32(0)), spChart2ModelContact ) { } WrappedSplineTypeProperty::~WrappedSplineTypeProperty() |