[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - chart2/inc chart2/source

Kohei Yoshida kohei.yoshida at collabora.com
Sat Jun 21 20:25:52 PDT 2014


 chart2/inc/unonames.hxx                                                     |    2 +
 chart2/source/controller/chartapiwrapper/AxisWrapper.cxx                    |    5 ++-
 chart2/source/controller/chartapiwrapper/DataSeriesPointWrapper.cxx         |    6 ++--
 chart2/source/controller/chartapiwrapper/WrappedNumberFormatProperty.cxx    |   15 +++++-----
 chart2/source/controller/dialogs/DataBrowserModel.cxx                       |    5 ++-
 chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx               |   11 ++++---
 chart2/source/controller/itemsetwrapper/DataPointItemConverter.cxx          |   10 ++++--
 chart2/source/controller/itemsetwrapper/RegressionEquationItemConverter.cxx |    7 ++--
 chart2/source/model/main/Axis.cxx                                           |    4 ++
 chart2/source/model/main/DataPointProperties.cxx                            |    3 +-
 chart2/source/model/template/ChartTypeTemplate.cxx                          |   10 ++++--
 chart2/source/tools/AxisHelper.cxx                                          |    3 +-
 chart2/source/tools/DataSeriesHelper.cxx                                    |    4 ++
 chart2/source/tools/DiagramHelper.cxx                                       |    5 ++-
 chart2/source/tools/ExplicitCategoriesProvider.cxx                          |    3 +-
 chart2/source/tools/RegressionEquation.cxx                                  |    3 +-
 chart2/source/view/charttypes/VSeriesPlotter.cxx                            |    3 +-
 chart2/source/view/main/ChartView.cxx                                       |    7 ++--
 chart2/source/view/main/VDataSeries.cxx                                     |    5 ++-
 19 files changed, 67 insertions(+), 44 deletions(-)

New commits:
commit 18b70a64b4a87706161f0b950da006b63c683619
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date:   Tue Jun 17 11:41:06 2014 -0400

    Use define constant to keep track of all NumberFormat property usage.
    
    Change-Id: I2a544922e03ec8253290ac8bf5a89c9cdd72d8dd
    (cherry picked from commit 2538e30ccc2e98de92de5157ca523fdb347eb537)
    Reviewed-on: https://gerrit.libreoffice.org/9835
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx
index 7962249..2b5f601 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 06d56b3..2c10c61 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 4638487..b2429b6 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 ce73ee3..198dc0c 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 724c078..8a85f8e 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 ee25d44..fe8eeb5 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 f03c410..213208d 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 7f9d188..4cf5baa 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 c3c1e65..d09ea4f 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 1f6ae08..2ebfa95 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 e1296cf..b19ae3f 100644
--- a/chart2/source/model/template/ChartTypeTemplate.cxx
+++ b/chart2/source/model/template/ChartTypeTemplate.cxx
@@ -32,6 +32,8 @@
 #include "DiagramHelper.hxx"
 #include "ChartDebugTrace.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>
@@ -461,9 +463,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());
                 }
             }
         }
@@ -761,9 +763,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 6157fbb..9656ad0 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>
 
@@ -144,7 +145,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 3b68272..11c6dd0 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 27d3c7c..dec53af 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 31a08c7..ce8c412 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>
@@ -439,7 +440,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 bbf2f3f..418fa62 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 c686911..b4b66e6 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 3ad0db6..9822499 100644
--- a/chart2/source/view/main/ChartView.cxx
+++ b/chart2/source/view/main/ChartView.cxx
@@ -907,7 +907,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 );
                             }
@@ -1818,8 +1818,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 ) );
 
@@ -1827,7 +1826,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 10ec3bb..0285382 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>
@@ -582,7 +583,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;
@@ -592,7 +593,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() )


More information about the Libreoffice-commits mailing list