diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-06-17 11:41:06 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-06-19 14:46:56 -0400 |
commit | 2538e30ccc2e98de92de5157ca523fdb347eb537 (patch) | |
tree | f6e07c61cd108d73e7cc99752e89e08a4cde84ff /chart2 | |
parent | b846847121a29b8acd9d48ef1a795ea3b9d6d974 (diff) |
Use define constant to keep track of all NumberFormat property usage.
Change-Id: I2a544922e03ec8253290ac8bf5a89c9cdd72d8dd
Diffstat (limited to 'chart2')
19 files changed, 67 insertions, 44 deletions
diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx index 7962249120ce..2b5f601e90e1 100644 --- a/chart2/inc/unonames.hxx +++ b/chart2/inc/unonames.hxx @@ -17,6 +17,8 @@ #define CHART_UNONAME_SPLINE_RESOLUTION "SplineResolution" #define CHART_UNONAME_CURVE_STYLE "CurveStyle" #define CHART_UNONAME_CURVE_RESOLUTION "CurveResolution" +#define CHART_UNONAME_NUMFMT "NumberFormat" +#define CHART_UNONAME_LINK_TO_SRC_NUMFMT "LinkNumberFormatToSource" #endif diff --git a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx index 06d56b3ef293..2c10c6126872 100644 --- a/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/AxisWrapper.cxx @@ -27,6 +27,7 @@ #include "GridWrapper.hxx" #include "TitleWrapper.hxx" #include "DisposeHelper.hxx" +#include <unonames.hxx> #include <comphelper/InlineContainer.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -270,14 +271,14 @@ void lcl_AddPropertiesToVector( | beans::PropertyAttribute::MAYBEDEFAULT )); rOutProperties.push_back( - Property( "NumberFormat", + Property( CHART_UNONAME_NUMFMT, PROP_AXIS_NUMBERFORMAT, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::BOUND | beans::PropertyAttribute::MAYBEDEFAULT )); rOutProperties.push_back( - Property( "LinkNumberFormatToSource", + Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT, PROP_AXIS_LINK_NUMBERFORMAT_TO_SOURCE, ::getBooleanCppuType(), beans::PropertyAttribute::BOUND diff --git a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx index 0a4cf662fb2e..e8fc2e03dbf1 100644 --- a/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx +++ b/chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx @@ -39,6 +39,8 @@ #include "WrappedScaleTextProperties.hxx" #include "WrappedNumberFormatProperty.hxx" #include "WrappedTextRotationProperty.hxx" +#include <unonames.hxx> + #include <rtl/ustrbuf.hxx> #include <rtl/math.hxx> @@ -114,7 +116,7 @@ void lcl_AddPropertiesToVector_PointProperties( | beans::PropertyAttribute::MAYBEDEFAULT )); rOutProperties.push_back( - Property( "NumberFormat", + Property( CHART_UNONAME_NUMFMT, PROP_SERIES_NUMBERFORMAT, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::BOUND @@ -153,7 +155,7 @@ void lcl_AddPropertiesToVector_SeriesOnly( | beans::PropertyAttribute::MAYBEDEFAULT )); rOutProperties.push_back( - Property( "LinkNumberFormatToSource", + Property( CHART_UNONAME_LINK_TO_SRC_NUMFMT, PROP_SERIES_LINK_NUMBERFORMAT_TO_SOURCE, ::getBooleanCppuType(), beans::PropertyAttribute::BOUND diff --git a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx index ce73ee3a609c..198dc0cb730d 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx @@ -19,6 +19,7 @@ #include "WrappedNumberFormatProperty.hxx" #include "macros.hxx" +#include <unonames.hxx> using namespace ::com::sun::star; using ::com::sun::star::uno::Reference; @@ -30,7 +31,7 @@ namespace wrapper { WrappedNumberFormatProperty::WrappedNumberFormatProperty( ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ) - : WrappedDirectStateProperty( "NumberFormat", "NumberFormat" ) + : WrappedDirectStateProperty( CHART_UNONAME_NUMFMT, CHART_UNONAME_NUMFMT ) , m_spChart2ModelContact(spChart2ModelContact) , m_pWrappedLinkNumberFormatProperty(NULL) { @@ -56,7 +57,7 @@ void WrappedNumberFormatProperty::setPropertyValue( const Any& rOuterValue, cons m_aOuterValue = rOuterValue; if(xInnerPropertySet.is()) { - bool bUseSourceFormat = !xInnerPropertySet->getPropertyValue( "NumberFormat" ).hasValue(); + bool bUseSourceFormat = !xInnerPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue(); if( bUseSourceFormat ) { uno::Reference< chart2::XChartDocument > xChartDoc( m_spChart2ModelContact->getChart2Document() ); @@ -99,9 +100,9 @@ Any WrappedNumberFormatProperty::getPropertyDefault( const Reference< beans::XPr return uno::makeAny( sal_Int32( 0 ) ); } -WrappedLinkNumberFormatProperty::WrappedLinkNumberFormatProperty( WrappedNumberFormatProperty* pWrappedNumberFormatProperty ) - : WrappedProperty( "LinkNumberFormatToSource", OUString() ) - , m_pWrappedNumberFormatProperty( pWrappedNumberFormatProperty ) +WrappedLinkNumberFormatProperty::WrappedLinkNumberFormatProperty( WrappedNumberFormatProperty* pWrappedNumberFormatProperty ) : + WrappedProperty( CHART_UNONAME_LINK_TO_SRC_NUMFMT, OUString() ), + m_pWrappedNumberFormatProperty( pWrappedNumberFormatProperty ) { if( m_pWrappedNumberFormatProperty ) { @@ -150,7 +151,7 @@ void WrappedLinkNumberFormatProperty::setPropertyValue( const Any& rOuterValue, aValue <<= sal_Int32( 0 ); } - xInnerPropertySet->setPropertyValue( "NumberFormat", aValue ); + xInnerPropertySet->setPropertyValue(CHART_UNONAME_NUMFMT, aValue); } } @@ -162,7 +163,7 @@ Any WrappedLinkNumberFormatProperty::getPropertyValue( const Reference< beans::X OSL_FAIL("missing xInnerPropertySet in WrappedNumberFormatProperty::getPropertyValue"); return getPropertyDefault(0); } - bool bLink = ! xInnerPropertySet->getPropertyValue( "NumberFormat" ).hasValue(); + bool bLink = ! xInnerPropertySet->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue(); return uno::makeAny( bLink ); } diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx index aafc9d3f1fea..3ff0dbcf3d03 100644 --- a/chart2/source/controller/dialogs/DataBrowserModel.cxx +++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx @@ -32,6 +32,7 @@ #include "ExplicitCategoriesProvider.hxx" #include "ChartModel.hxx" +#include <unonames.hxx> #include <com/sun/star/container/XIndexReplace.hpp> #include <com/sun/star/chart2/XAxis.hpp> @@ -334,7 +335,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) Reference< beans::XPropertySet > xSeriesProps( xSeries, uno::UNO_QUERY ); if( xSeriesProps.is() ) - xSeriesProps->getPropertyValue( "NumberFormat" ) >>= nSeriesNumberFormat; + xSeriesProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nSeriesNumberFormat; } else { @@ -407,7 +408,7 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex ) //give the new series the same number format as the former series especially for bubble charts thus the bubble size values can be edited with same format immediately Reference< beans::XPropertySet > xNewSeriesProps( xNewSeries, uno::UNO_QUERY ); if( xNewSeriesProps.is() ) - xNewSeriesProps->setPropertyValue( "NumberFormat" , uno::makeAny( nSeriesNumberFormat ) ); + xNewSeriesProps->setPropertyValue(CHART_UNONAME_NUMFMT , uno::makeAny(nSeriesNumberFormat)); } updateFromModel(); diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx index ee25d44f3d8c..fe8eeb5bdb9d 100644 --- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx @@ -29,6 +29,7 @@ #include "AxisHelper.hxx" #include "CommonConverters.hxx" #include "ChartTypeHelper.hxx" +#include <unonames.hxx> #include <com/sun/star/chart/ChartAxisLabelPosition.hpp> #include <com/sun/star/chart/ChartAxisMarkPosition.hpp> @@ -422,7 +423,7 @@ void AxisItemConverter::FillSpecialItem( sal_uInt16 nWhichId, SfxItemSet & rOutI case SID_ATTR_NUMBERFORMAT_SOURCE: { - bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( "NumberFormat" ).hasValue()); + bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue()); rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet )); } break; @@ -914,9 +915,9 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet rItemSet.Get( nWhichId )).GetValue()); aValue = uno::makeAny(nFmt); - if( GetPropertySet()->getPropertyValue( "NumberFormat" ) != aValue ) + if (GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT) != aValue) { - GetPropertySet()->setPropertyValue( "NumberFormat" , aValue ); + GetPropertySet()->setPropertyValue(CHART_UNONAME_NUMFMT , aValue); bChangedOtherwise = true; } } @@ -929,7 +930,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet bool bUseSourceFormat = (static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )).GetValue() ); - bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( "NumberFormat").hasValue()); + bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue(); bChangedOtherwise = (bUseSourceFormat == bNumberFormatIsSet); if( bChangedOtherwise ) @@ -957,7 +958,7 @@ bool AxisItemConverter::ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet } } // else set a void Any - GetPropertySet()->setPropertyValue( "NumberFormat" , aValue ); + GetPropertySet()->setPropertyValue(CHART_UNONAME_NUMFMT , aValue); } } break; diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx index f03c41075d8d..213208dcc4cd 100644 --- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx @@ -30,6 +30,8 @@ #include "DiagramHelper.hxx" #include "ChartModelHelper.hxx" #include "ChartTypeHelper.hxx" +#include <unonames.hxx> + #include <svx/chrtitem.hxx> #include <com/sun/star/chart2/DataPointLabel.hpp> #include <com/sun/star/chart2/Symbol.hpp> @@ -96,7 +98,7 @@ bool lcl_NumberFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxItemSe bool bChanged = false; if( !xPropertySet.is() ) return bChanged; - OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? OUString( "NumberFormat" ) : OUString( "PercentageNumberFormat" ); + OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" ); sal_uInt16 nSourceWhich = (SID_ATTR_NUMBERFORMAT_VALUE==nWhichId) ? SID_ATTR_NUMBERFORMAT_SOURCE : SCHATTR_PERCENT_NUMBERFORMAT_SOURCE; if( SFX_ITEM_SET != rItemSet.GetItemState( nSourceWhich ) ) @@ -143,7 +145,7 @@ bool lcl_UseSourceFormatFromItemToPropertySet( sal_uInt16 nWhichId, const SfxIte bool bChanged = false; if( !xPropertySet.is() ) return bChanged; - OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? OUString( "NumberFormat" ) : OUString( "PercentageNumberFormat" ); + OUString aPropertyName = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? OUString(CHART_UNONAME_NUMFMT) : OUString( "PercentageNumberFormat" ); sal_uInt16 nFormatWhich = (SID_ATTR_NUMBERFORMAT_SOURCE==nWhichId) ? SID_ATTR_NUMBERFORMAT_VALUE : SCHATTR_PERCENT_NUMBERFORMAT_VALUE; if( SFX_ITEM_SET != rItemSet.GetItemState( nWhichId ) ) @@ -558,7 +560,7 @@ void DataPointItemConverter::FillSpecialItem( case SID_ATTR_NUMBERFORMAT_VALUE: { sal_Int32 nKey = 0; - if( !(GetPropertySet()->getPropertyValue( "NumberFormat" ) >>= nKey) ) + if (!(GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nKey)) nKey = m_nNumberFormat; rOutItemSet.Put( SfxUInt32Item( nWhichId, nKey )); } @@ -575,7 +577,7 @@ void DataPointItemConverter::FillSpecialItem( case SID_ATTR_NUMBERFORMAT_SOURCE: { - bool bNumberFormatIsSet = ( GetPropertySet()->getPropertyValue( "NumberFormat" ).hasValue()); + bool bNumberFormatIsSet = GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT).hasValue(); rOutItemSet.Put( SfxBoolItem( nWhichId, ! bNumberFormatIsSet )); } break; diff --git a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx index 7f9d18886a6e..4cf5baa758dd 100644 --- a/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx @@ -24,6 +24,7 @@ #include "GraphicPropertyItemConverter.hxx" #include "CharacterPropertyItemConverter.hxx" #include "MultipleItemConverter.hxx" +#include <unonames.hxx> #include <svl/intitem.hxx> #include <rtl/math.hxx> @@ -125,9 +126,9 @@ bool RegressionEquationItemConverter::ApplySpecialItem( uno::Any aValue( static_cast< sal_Int32 >( static_cast< const SfxUInt32Item & >( rItemSet.Get( nWhichId )).GetValue())); - if( GetPropertySet()->getPropertyValue( "NumberFormat" ) != aValue ) + if (GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT) != aValue) { - GetPropertySet()->setPropertyValue( "NumberFormat", aValue ); + GetPropertySet()->setPropertyValue(CHART_UNONAME_NUMFMT, aValue); bChanged = true; } } @@ -146,7 +147,7 @@ void RegressionEquationItemConverter::FillSpecialItem( case SID_ATTR_NUMBERFORMAT_VALUE: { sal_Int32 nFormatKey = 0; - if( GetPropertySet()->getPropertyValue( "NumberFormat" ) >>= nFormatKey ) + if (GetPropertySet()->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormatKey) { rOutItemSet.Put( SfxUInt32Item( nWhichId, nFormatKey )); } diff --git a/chart2/source/model/main/Axis.cxx b/chart2/source/model/main/Axis.cxx index 151e658509be..90e7660b858f 100644 --- a/chart2/source/model/main/Axis.cxx +++ b/chart2/source/model/main/Axis.cxx @@ -28,6 +28,8 @@ #include "CloneHelper.hxx" #include "AxisHelper.hxx" #include "EventListenerHelper.hxx" +#include <unonames.hxx> + #include <com/sun/star/chart/ChartAxisArrangeOrderType.hpp> #include <com/sun/star/chart/ChartAxisLabelPosition.hpp> #include <com/sun/star/chart/ChartAxisMarkPosition.hpp> @@ -112,7 +114,7 @@ void lcl_AddPropertiesToVector( | beans::PropertyAttribute::MAYBEDEFAULT )); rOutProperties.push_back( - Property( "NumberFormat", + Property( CHART_UNONAME_NUMFMT, PROP_AXIS_NUMBER_FORMAT, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::BOUND diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx index 1f6ae084146b..2ebfa95fadbe 100644 --- a/chart2/source/model/main/DataPointProperties.cxx +++ b/chart2/source/model/main/DataPointProperties.cxx @@ -21,6 +21,7 @@ #include "macros.hxx" #include "LinePropertiesHelper.hxx" #include "FillProperties.hxx" +#include <unonames.hxx> #include <com/sun/star/beans/PropertyAttribute.hpp> #include <com/sun/star/drawing/FillStyle.hpp> @@ -277,7 +278,7 @@ void DataPointProperties::AddPropertiesToVector( | beans::PropertyAttribute::MAYBEDEFAULT )); rOutProperties.push_back( - Property( "NumberFormat", + Property( CHART_UNONAME_NUMFMT, PROP_DATAPOINT_NUMBER_FORMAT, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::BOUND diff --git a/chart2/source/model/template/ChartTypeTemplate.cxx b/chart2/source/model/template/ChartTypeTemplate.cxx index de109e85a98a..b17952600940 100644 --- a/chart2/source/model/template/ChartTypeTemplate.cxx +++ b/chart2/source/model/template/ChartTypeTemplate.cxx @@ -31,6 +31,8 @@ #include "LegendHelper.hxx" #include "DiagramHelper.hxx" #include "AxisIndexDefines.hxx" +#include <unonames.hxx> + #include <cppuhelper/component_context.hxx> #include <com/sun/star/chart/ChartSolidType.hpp> #include <com/sun/star/chart2/AxisType.hpp> @@ -456,9 +458,9 @@ void SAL_CALL ChartTypeTemplate::resetStyles( const Reference< chart2::XDiagram if( xAxisProp.is()) { // set number format to source format - uno::Any aValue( xAxisProp->getPropertyValue("NumberFormat")); + uno::Any aValue = xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT); if( aValue.hasValue()) - xAxisProp->setPropertyValue("NumberFormat", uno::Any()); + xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any()); } } } @@ -756,9 +758,9 @@ void ChartTypeTemplate::adaptAxes( if( xAxisProp.is()) { // set number format to source format - uno::Any aValue( xAxisProp->getPropertyValue("NumberFormat")); + uno::Any aValue = xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT); if( aValue.hasValue()) - xAxisProp->setPropertyValue("NumberFormat", uno::Any()); + xAxisProp->setPropertyValue(CHART_UNONAME_NUMFMT, uno::Any()); } } } diff --git a/chart2/source/tools/AxisHelper.cxx b/chart2/source/tools/AxisHelper.cxx index df0baa4327e9..48a3a72e76ca 100644 --- a/chart2/source/tools/AxisHelper.cxx +++ b/chart2/source/tools/AxisHelper.cxx @@ -29,6 +29,7 @@ #include "Scaling.hxx" #include "ChartModelHelper.hxx" #include "DataSourceHelper.hxx" +#include <unonames.hxx> #include <unotools/saveopt.hxx> @@ -142,7 +143,7 @@ sal_Int32 AxisHelper::getExplicitNumberFormatKeyForAxis( Reference< chart2::XChartDocument > xChartDoc( xNumberFormatsSupplier, uno::UNO_QUERY ); Reference< beans::XPropertySet > xProp( xAxis, uno::UNO_QUERY ); - if( xProp.is() && !( xProp->getPropertyValue( "NumberFormat" ) >>= nNumberFormatKey ) ) + if( xProp.is() && !( xProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey ) ) { bool bFormatSet = false; //check whether we have a percent scale -> use percent format diff --git a/chart2/source/tools/DataSeriesHelper.cxx b/chart2/source/tools/DataSeriesHelper.cxx index 3b682725b850..11c6dd0cd4b3 100644 --- a/chart2/source/tools/DataSeriesHelper.cxx +++ b/chart2/source/tools/DataSeriesHelper.cxx @@ -22,6 +22,8 @@ #include "DataSource.hxx" #include "macros.hxx" #include "ContainerHelper.hxx" +#include <unonames.hxx> + #include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/chart2/DataPointLabel.hpp> #include <com/sun/star/chart2/data/XTextualDataSequence.hpp> @@ -478,7 +480,7 @@ sal_Int32 getNumberFormatKeyFromAxis( Reference< beans::XPropertySet > xAxisProp( xCorrespondingCoordinateSystem->getAxisByDimension( nDimensionIndex, nAxisIndex ), uno::UNO_QUERY ); if( xAxisProp.is()) - xAxisProp->getPropertyValue( "NumberFormat") >>= nResult; + xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nResult; } catch( const uno::Exception & ex ) { diff --git a/chart2/source/tools/DiagramHelper.cxx b/chart2/source/tools/DiagramHelper.cxx index 27d3c7c3fb0b..dec53afaa768 100644 --- a/chart2/source/tools/DiagramHelper.cxx +++ b/chart2/source/tools/DiagramHelper.cxx @@ -32,6 +32,7 @@ #include "RelativePositionHelper.hxx" #include "ControllerLockGuard.hxx" #include "NumberFormatterWrapper.hxx" +#include <unonames.hxx> #include <com/sun/star/chart/MissingValueTreatment.hpp> #include <com/sun/star/chart/XChartDocument.hpp> @@ -1052,7 +1053,7 @@ void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, c if( xAxisProps.is() && xNumberFormatsSupplier.is() ) { sal_Int32 nNumberFormat = -1; - xAxisProps->getPropertyValue( "NumberFormat" ) >>= nNumberFormat; + xAxisProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormat; Reference< util::XNumberFormats > xNumberFormats = Reference< util::XNumberFormats >( xNumberFormatsSupplier->getNumberFormats() ); if( xNumberFormats.is() ) @@ -1077,7 +1078,7 @@ void lcl_switchToDateCategories( const Reference< XChartDocument >& xChartDoc, c Sequence<sal_Int32> aKeySeq = xNumberFormats->queryKeys( util::NumberFormat::DATE, rLocaleDataWrapper.getLanguageTag().getLocale(), bCreate ); if( aKeySeq.getLength() ) { - xAxisProps->setPropertyValue( "NumberFormat", uno::makeAny(aKeySeq[0]) ); + xAxisProps->setPropertyValue(CHART_UNONAME_NUMFMT, uno::makeAny(aKeySeq[0])); } } } diff --git a/chart2/source/tools/ExplicitCategoriesProvider.cxx b/chart2/source/tools/ExplicitCategoriesProvider.cxx index a1df24a0c641..0ef0caaf8c02 100644 --- a/chart2/source/tools/ExplicitCategoriesProvider.cxx +++ b/chart2/source/tools/ExplicitCategoriesProvider.cxx @@ -27,6 +27,7 @@ #include "ContainerHelper.hxx" #include "macros.hxx" #include "NumberFormatterWrapper.hxx" +#include <unonames.hxx> #include <com/sun/star/chart2/AxisType.hpp> #include <com/sun/star/util/NumberFormat.hpp> @@ -435,7 +436,7 @@ bool lcl_fillDateCategories( const uno::Reference< data::XDataSequence >& xDataS bOwnData = true; Reference< beans::XPropertySet > xAxisProps( xCooSysModel->getAxisByDimension(0,0), uno::UNO_QUERY ); sal_Int32 nAxisNumberFormat = 0; - if( xAxisProps.is() && (xAxisProps->getPropertyValue( "NumberFormat" ) >>= nAxisNumberFormat) ) + if (xAxisProps.is() && (xAxisProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nAxisNumberFormat)) { bOwnDataAnddAxisHasAnyFormat = true; bOwnDataAnddAxisHasDateFormat = DiagramHelper::isDateNumberFormat( nAxisNumberFormat, xNumberFormats ); diff --git a/chart2/source/tools/RegressionEquation.cxx b/chart2/source/tools/RegressionEquation.cxx index 8bc63a91a33a..755b1dacfed7 100644 --- a/chart2/source/tools/RegressionEquation.cxx +++ b/chart2/source/tools/RegressionEquation.cxx @@ -25,6 +25,7 @@ #include "PropertyHelper.hxx" #include "macros.hxx" #include "ContainerHelper.hxx" +#include <unonames.hxx> #include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/drawing/FillStyle.hpp> @@ -88,7 +89,7 @@ void lcl_AddPropertiesToVector( | beans::PropertyAttribute::MAYBEVOID )); rOutProperties.push_back( - Property( "NumberFormat", + Property( CHART_UNONAME_NUMFMT, PROP_EQUATION_NUMBER_FORMAT, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::BOUND diff --git a/chart2/source/view/charttypes/VSeriesPlotter.cxx b/chart2/source/view/charttypes/VSeriesPlotter.cxx index 57ee304a49b1..6b147b6c4cd5 100644 --- a/chart2/source/view/charttypes/VSeriesPlotter.cxx +++ b/chart2/source/view/charttypes/VSeriesPlotter.cxx @@ -51,6 +51,7 @@ #include "CandleStickChart.hxx" #include "BubbleChart.hxx" #include "NetChart.hxx" +#include <unonames.hxx> #include <com/sun/star/chart/ErrorBarStyle.hpp> #include <com/sun/star/chart/TimeUnit.hpp> @@ -1131,7 +1132,7 @@ void VSeriesPlotter::createRegressionCurveEquationShapes( OUStringBuffer aFormula; sal_Int32 nNumberFormatKey = 0; - xEquationProperties->getPropertyValue( "NumberFormat") >>= nNumberFormatKey; + xEquationProperties->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey; if( bShowEquation ) { diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index f04433b11997..4d4c3c8a74ff 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -959,7 +959,7 @@ void SeriesPlotterContainer::setNumberFormatsFromAxes() if( xAxisProp.is()) { sal_Int32 nNumberFormatKey(0); - if( xAxisProp->getPropertyValue( "NumberFormat" ) >>= nNumberFormatKey ) + if( xAxisProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nNumberFormatKey ) { aAxesNumberFormats.setFormat( nNumberFormatKey, nDimensionIndex, nAxisIndex ); } @@ -1870,8 +1870,7 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( if( !xSeriesOrPointProp.is() ) return nFormat; - OUString aPropName( "NumberFormat" ); - if( !(xSeriesOrPointProp->getPropertyValue(aPropName) >>= nFormat) ) + if (!(xSeriesOrPointProp->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat)) { uno::Reference< chart2::XChartType > xChartType( DataSeriesHelper::getChartTypeOfSeries( xSeries, xDiagram ) ); @@ -1879,7 +1878,7 @@ sal_Int32 ExplicitValueProvider::getExplicitNumberFormatKeyForDataLabel( if( ChartTypeHelper::shouldLabelNumberFormatKeyBeDetectedFromYAxis( xChartType ) ) { uno::Reference< beans::XPropertySet > xAttachedAxisProps( DiagramHelper::getAttachedAxis( xSeries, xDiagram ), uno::UNO_QUERY ); - if( xAttachedAxisProps.is() && ( xAttachedAxisProps->getPropertyValue( aPropName ) >>= nFormat ) ) + if (xAttachedAxisProps.is() && (xAttachedAxisProps->getPropertyValue(CHART_UNONAME_NUMFMT) >>= nFormat)) bFormatFound = true; } if( !bFormatFound ) diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx index 6fc067688649..bd087c70f92c 100644 --- a/chart2/source/view/main/VDataSeries.cxx +++ b/chart2/source/view/main/VDataSeries.cxx @@ -26,6 +26,7 @@ #include "ContainerHelper.hxx" #include "DataSeriesHelper.hxx" #include "RegressionCurveHelper.hxx" +#include <unonames.hxx> #include <com/sun/star/chart/MissingValueTreatment.hpp> #include <com/sun/star/chart2/Symbol.hpp> @@ -538,7 +539,7 @@ double VDataSeries::getBubble_Size( sal_Int32 index ) const bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const { - OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString("NumberFormat"); + OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString(CHART_UNONAME_NUMFMT); bool bHasNumberFormat = false; uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( nPointIndex )); sal_Int32 nNumberFormat = -1; @@ -548,7 +549,7 @@ bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPerce } sal_Int32 VDataSeries::getExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const { - OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString("NumberFormat"); + OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString(CHART_UNONAME_NUMFMT); sal_Int32 nNumberFormat = -1; uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( nPointIndex )); if( xPointProp.is() ) |