diff options
author | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-07-21 16:34:15 -0400 |
---|---|---|
committer | Kohei Yoshida <kohei.yoshida@collabora.com> | 2014-07-21 20:31:24 -0400 |
commit | b2ffa40c12024886c3c6fd36d198aed2f8434fde (patch) | |
tree | b19643d60bbdcfb70062aa9de71aef49ae6272dc /chart2/source/controller | |
parent | e1840cf944b36b7ead5800a036870e38f4ddb049 (diff) |
Compiler macro in lieu of literal "Label" to make it easier to track it.
Change-Id: I6bc694fcc8f97b308747c097c4fa977d20524377
Diffstat (limited to 'chart2/source/controller')
3 files changed, 14 insertions, 11 deletions
diff --git a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx index 8ea038b79074..1b13ca95e690 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedDataCaptionProperties.cxx @@ -21,6 +21,8 @@ #include "WrappedSeriesOrDiagramProperty.hxx" #include "macros.hxx" #include "FastPropertyIdRanges.hxx" +#include <unonames.hxx> + #include <com/sun/star/chart2/DataPointLabel.hpp> #include <com/sun/star/chart/ChartDataCaption.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> @@ -137,7 +139,7 @@ sal_Int32 WrappedDataCaptionProperty::getValueFromSeries( const Reference< beans sal_Int32 aRet = 0; m_aDefaultValue >>= aRet; chart2::DataPointLabel aLabel; - if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue("Label") >>= aLabel ) ) + if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel ) ) aRet = lcl_LabelToCaption( aLabel ); return aRet; } @@ -148,7 +150,7 @@ void WrappedDataCaptionProperty::setValueToSeries( const Reference< beans::XProp return; chart2::DataPointLabel aLabel = lcl_CaptionToLabel( nCaption ); - xSeriesPropertySet->setPropertyValue( "Label", uno::makeAny( aLabel ) ); + xSeriesPropertySet->setPropertyValue( CHART_UNONAME_LABEL, uno::makeAny( aLabel ) ); } } //namespace wrapper diff --git a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx index 213208dcc4cd..6e8cbc3956ab 100644 --- a/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx +++ b/chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx @@ -310,7 +310,7 @@ bool DataPointItemConverter::ApplySpecialItem( { const SfxBoolItem & rItem = static_cast< const SfxBoolItem & >( rItemSet.Get( nWhichId )); - uno::Any aOldValue( GetPropertySet()->getPropertyValue( "Label" )); + uno::Any aOldValue = GetPropertySet()->getPropertyValue(CHART_UNONAME_LABEL); chart2::DataPointLabel aLabel; if( aOldValue >>= aLabel ) { @@ -323,15 +323,15 @@ bool DataPointItemConverter::ApplySpecialItem( { Reference< chart2::XDataSeries > xSeries( GetPropertySet(), uno::UNO_QUERY); if( (bOldValue ? 1 : 0) != rValue || - DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, "Label" , aOldValue ) ) + DataSeriesHelper::hasAttributedDataPointDifferentValue( xSeries, CHART_UNONAME_LABEL , aOldValue ) ) { - DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "Label" , uno::makeAny( aLabel ) ); + DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_LABEL , uno::makeAny( aLabel ) ); bChanged = true; } } else if( (bOldValue ? 1 : 0) != rValue ) { - GetPropertySet()->setPropertyValue( "Label" , uno::makeAny( aLabel )); + GetPropertySet()->setPropertyValue(CHART_UNONAME_LABEL , uno::makeAny(aLabel)); bChanged = true; } } @@ -537,7 +537,7 @@ void DataPointItemConverter::FillSpecialItem( case SCHATTR_DATADESCR_SHOW_SYMBOL: { chart2::DataPointLabel aLabel; - if( GetPropertySet()->getPropertyValue( "Label" ) >>= aLabel ) + if (GetPropertySet()->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel) { bool bValue = (SCHATTR_DATADESCR_SHOW_NUMBER==nWhichId) ? aLabel.ShowNumber : ( (SCHATTR_DATADESCR_SHOW_PERCENTAGE==nWhichId) ? aLabel.ShowNumberInPercent : ( @@ -548,7 +548,7 @@ void DataPointItemConverter::FillSpecialItem( if( m_bOverwriteLabelsForAttributedDataPointsAlso ) { if( DataSeriesHelper::hasAttributedDataPointDifferentValue( - Reference< chart2::XDataSeries >( GetPropertySet(), uno::UNO_QUERY), "Label" , uno::makeAny(aLabel) ) ) + Reference< chart2::XDataSeries >( GetPropertySet(), uno::UNO_QUERY), CHART_UNONAME_LABEL , uno::makeAny(aLabel) ) ) { rOutItemSet.InvalidateItem(nWhichId); } diff --git a/chart2/source/controller/main/ChartController_Tools.cxx b/chart2/source/controller/main/ChartController_Tools.cxx index cb3bcef71489..186ec57e9274 100644 --- a/chart2/source/controller/main/ChartController_Tools.cxx +++ b/chart2/source/controller/main/ChartController_Tools.cxx @@ -40,6 +40,7 @@ #include "ShapeController.hxx" #include "DiagramHelper.hxx" #include "ObjectNameProvider.hxx" +#include <unonames.hxx> #include <com/sun/star/chart2/DataPointLabel.hpp> #include <com/sun/star/beans/XPropertyState.hpp> @@ -774,7 +775,7 @@ bool ChartController::executeDispatch_Delete() SCH_RESSTR( aObjectType == OBJECTTYPE_DATA_LABEL ? STR_OBJECT_LABEL : STR_OBJECT_DATALABELS )), m_xUndoManager ); chart2::DataPointLabel aLabel; - xObjectProperties->getPropertyValue( "Label" ) >>= aLabel; + xObjectProperties->getPropertyValue(CHART_UNONAME_LABEL) >>= aLabel; aLabel.ShowNumber = false; aLabel.ShowNumberInPercent = false; aLabel.ShowCategoryName = false; @@ -782,10 +783,10 @@ bool ChartController::executeDispatch_Delete() if( aObjectType == OBJECTTYPE_DATA_LABELS ) { uno::Reference< chart2::XDataSeries > xSeries( ObjectIdentifier::getDataSeriesForCID( aCID, getModel() )); - ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, "Label", uno::makeAny(aLabel) ); + ::chart::DataSeriesHelper::setPropertyAlsoToAllAttributedDataPoints( xSeries, CHART_UNONAME_LABEL, uno::makeAny(aLabel) ); } else - xObjectProperties->setPropertyValue( "Label", uno::makeAny(aLabel) ); + xObjectProperties->setPropertyValue( CHART_UNONAME_LABEL, uno::makeAny(aLabel) ); bReturn = true; aUndoGuard.commit(); } |