[Libreoffice-commits] .: 6 commits - chart2/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 25 13:58:21 PST 2013


 chart2/source/view/charttypes/AreaChart.cxx |   18 +--
 chart2/source/view/inc/VDataSeries.hxx      |   31 ++---
 chart2/source/view/inc/VSeriesPlotter.hxx   |   35 +-----
 chart2/source/view/main/VDataSeries.cxx     |  146 +++++++++++++---------------
 4 files changed, 101 insertions(+), 129 deletions(-)

New commits:
commit d785b3c41fa6d841ca69b26a6a1ea9ce7a92205d
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Jan 25 16:56:43 2013 -0500

    bnc#590020: Sort data points stably.
    
    std::sort is unstable sort, which is not what we want.  Use std::stable_sort
    to sort data points by X values.  If we use unstable sort, it may mess up
    the order of the sequence when two data points contain identical X values.
    
    Change-Id: I6453a986185b326dc680fbcec6227ea332235b22

diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 60efc95..a5059dc 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -302,7 +302,7 @@ void VDataSeries::doSortByXValues()
         }
 
         //do sort
-        std::sort( aTmp.begin(), aTmp.end(), lcl_LessXOfPoint() );
+        std::stable_sort( aTmp.begin(), aTmp.end(), lcl_LessXOfPoint() );
 
         //fill the sorted points back to the members
         m_aValues_X.Doubles.realloc( m_nPointCount );
commit d0b94f5cfefe89cacc4fd4230396c1d34e4d2cfe
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Jan 25 16:43:24 2013 -0500

    String cleanup.
    
    Change-Id: Ib796e2a101f08f01eb438e8d48c7bffbbd3b19b0

diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index 3c987d6..60efc95 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -215,26 +215,26 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
         {
             try
             {
-                uno::Any aARole = xProp->getPropertyValue( C2U( "Role" ) );
+                uno::Any aARole = xProp->getPropertyValue("Role");
                 rtl::OUString aRole;
                 aARole >>= aRole;
 
-                if( aRole.equals(C2U("values-x")) )
+                if (aRole == "values-x")
                 {
                     m_aValues_X.init( xDataSequence );
                     lcl_clearIfNoValuesButTextIsContained( m_aValues_X, xDataSequence );
                 }
-                else if( aRole.equals(C2U("values-y")) )
+                else if (aRole =="values-y")
                     m_aValues_Y.init( xDataSequence );
-                else if( aRole.equals(C2U("values-min")) )
+                else if (aRole == "values-min")
                     m_aValues_Y_Min.init( xDataSequence );
-                else if( aRole.equals(C2U("values-max")) )
+                else if (aRole == "values-max")
                     m_aValues_Y_Max.init( xDataSequence );
-                else if( aRole.equals(C2U("values-first")) )
+                else if (aRole == "values-first")
                     m_aValues_Y_First.init( xDataSequence );
-                else if( aRole.equals(C2U("values-last")) )
+                else if (aRole == "values-last")
                     m_aValues_Y_Last.init( xDataSequence );
-                else if( aRole.equals(C2U("values-size")) )
+                else if (aRole == "values-size")
                     m_aValues_Bubble_Size.init( xDataSequence );
             }
             catch( const uno::Exception& e )
@@ -265,11 +265,11 @@ VDataSeries::VDataSeries( const uno::Reference< XDataSeries >& xDataSeries )
         try
         {
             //get AttributedDataPoints
-            xProp->getPropertyValue( C2U( "AttributedDataPoints" ) ) >>= m_aAttributedDataPointIndexList;
+            xProp->getPropertyValue("AttributedDataPoints") >>= m_aAttributedDataPointIndexList;
 
-            xProp->getPropertyValue( C2U( "StackingDirection" ) ) >>= m_eStackingDirection;
+            xProp->getPropertyValue("StackingDirection") >>= m_eStackingDirection;
 
-            xProp->getPropertyValue( C2U( "AttachedAxisIndex" ) ) >>= m_nAxisIndex;
+            xProp->getPropertyValue("AttachedAxisIndex") >>= m_nAxisIndex;
             if(m_nAxisIndex<0)
                 m_nAxisIndex=0;
         }
@@ -390,7 +390,7 @@ rtl::OUString VDataSeries::getErrorBarsCID(bool bYError) const
 {
     rtl::OUString aChildParticle( ObjectIdentifier::getStringForType(
                                       bYError ? OBJECTTYPE_DATA_ERRORS_Y : OBJECTTYPE_DATA_ERRORS_X ) );
-    aChildParticle+=(C2U("="));
+    aChildParticle += "=";
 
     return ObjectIdentifier::createClassifiedIdentifierForParticles(
             m_aSeriesParticle, aChildParticle );
@@ -398,7 +398,7 @@ rtl::OUString VDataSeries::getErrorBarsCID(bool bYError) const
 rtl::OUString VDataSeries::getLabelsCID() const
 {
     rtl::OUString aChildParticle( ObjectIdentifier::getStringForType( OBJECTTYPE_DATA_LABELS ) );
-    aChildParticle+=(C2U("="));
+    aChildParticle += "=";
 
     return ObjectIdentifier::createClassifiedIdentifierForParticles(
             m_aSeriesParticle, aChildParticle );
@@ -538,7 +538,7 @@ double VDataSeries::getBubble_Size( sal_Int32 index ) const
 
 bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const
 {
-    rtl::OUString aPropName( bForPercentage ? C2U( "PercentageNumberFormat" ) : C2U( "NumberFormat" ) );
+    OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString("NumberFormat");
     bool bHasNumberFormat = false;
     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( nPointIndex ));
     sal_Int32 nNumberFormat = -1;
@@ -548,7 +548,7 @@ bool VDataSeries::hasExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPerce
 }
 sal_Int32 VDataSeries::getExplicitNumberFormat( sal_Int32 nPointIndex, bool bForPercentage ) const
 {
-    rtl::OUString aPropName( bForPercentage ? C2U( "PercentageNumberFormat" ) : C2U( "NumberFormat" ) );
+    OUString aPropName = bForPercentage ? OUString("PercentageNumberFormat") : OUString("NumberFormat");
     sal_Int32 nNumberFormat = -1;
     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( nPointIndex ));
     if( xPointProp.is() )
@@ -557,19 +557,19 @@ sal_Int32 VDataSeries::getExplicitNumberFormat( sal_Int32 nPointIndex, bool bFor
 }
 void VDataSeries::setRoleOfSequenceForDataLabelNumberFormatDetection( const rtl::OUString& rRole )
 {
-    if( rRole.equals(C2U("values-y")) )
+    if (rRole == "values-y")
         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y;
-    else if( rRole.equals(C2U("values-size")) )
+    else if (rRole == "values-size")
         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Bubble_Size;
-    else if( rRole.equals(C2U("values-min")) )
+    else if (rRole == "values-min")
         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Min;
-    else if( rRole.equals(C2U("values-max")) )
+    else if (rRole == "values-max")
         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Max;
-    else if( rRole.equals(C2U("values-first")) )
+    else if (rRole == "values-first")
         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_First;
-    else if( rRole.equals(C2U("values-last")) )
+    else if (rRole == "values-last")
         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_Y_Last;
-    else if( rRole.equals(C2U("values-x")) )
+    else if (rRole == "values-x")
         m_pValueSequenceForDataLabelNumberFormatDetection = &m_aValues_X;
 }
 bool VDataSeries::shouldLabelNumberFormatKeyBeDetectedFromYAxis() const
@@ -595,7 +595,7 @@ sal_Int32 VDataSeries::getLabelPlacement( sal_Int32 nPointIndex, const uno::Refe
     {
         uno::Reference< beans::XPropertySet > xPointProps( this->getPropertiesOfPoint( nPointIndex ) );
         if( xPointProps.is() )
-            xPointProps->getPropertyValue( C2U( "LabelPlacement" ) ) >>= nLabelPlacement;
+            xPointProps->getPropertyValue("LabelPlacement") >>= nLabelPlacement;
 
         //ensure that the set label placement is supported by this charttype
 
@@ -737,7 +737,8 @@ double VDataSeries::getYMeanValue() const
 {
     if( ::rtl::math::isNan( m_fYMeanValue ) )
     {
-        uno::Reference< XRegressionCurveCalculator > xCalculator( RegressionCurveHelper::createRegressionCurveCalculatorByServiceName( C2U("com.sun.star.chart2.MeanValueRegressionCurve") ) );
+        uno::Reference< XRegressionCurveCalculator > xCalculator(
+            RegressionCurveHelper::createRegressionCurveCalculatorByServiceName("com.sun.star.chart2.MeanValueRegressionCurve"));
         uno::Sequence< double > aXValuesDummy;
         xCalculator->recalculateRegression( aXValuesDummy, getAllY() );
         double fXDummy = 1.0;
@@ -829,7 +830,7 @@ uno::Reference< beans::XPropertySet > VDataSeries::getXErrorBarProperties( sal_I
 
     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( index ));
     if( xPointProp.is() )
-        xPointProp->getPropertyValue( C2U( "ErrorBarX" )) >>= xErrorBarProp;
+        xPointProp->getPropertyValue("ErrorBarX") >>= xErrorBarProp;
     return xErrorBarProp;
 }
 
@@ -839,7 +840,7 @@ uno::Reference< beans::XPropertySet > VDataSeries::getYErrorBarProperties( sal_I
 
     uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( index ));
     if( xPointProp.is() )
-        xPointProp->getPropertyValue( C2U( "ErrorBarY" )) >>= xErrorBarProp;
+        xPointProp->getPropertyValue("ErrorBarY") >>= xErrorBarProp;
     return xErrorBarProp;
 }
 
@@ -851,7 +852,7 @@ bool VDataSeries::hasPointOwnColor( sal_Int32 index ) const
     try
     {
         uno::Reference< beans::XPropertyState > xPointState( this->getPropertiesOfPoint(index), uno::UNO_QUERY_THROW );
-        return (xPointState->getPropertyState( C2U("Color")) != beans::PropertyState_DEFAULT_VALUE );
+        return (xPointState->getPropertyState("Color") != beans::PropertyState_DEFAULT_VALUE );
     }
     catch(const uno::Exception& e)
     {
@@ -878,7 +879,7 @@ bool VDataSeries::isVaryColorsByPoint() const
     bool bVaryColorsByPoint = false;
     Reference< beans::XPropertySet > xSeriesProp( this->getPropertiesOfSeries() );
     if( xSeriesProp.is() )
-        xSeriesProp->getPropertyValue( C2U("VaryColorsByPoint") ) >>= bVaryColorsByPoint;
+        xSeriesProp->getPropertyValue("VaryColorsByPoint") >>= bVaryColorsByPoint;
     return bVaryColorsByPoint;
 }
 
@@ -901,7 +902,7 @@ DataPointLabel* getDataPointLabelFromPropertySet( const uno::Reference< beans::X
     SAL_WNODEPRECATED_DECLARATIONS_POP
     try
     {
-        if( !(xProp->getPropertyValue( C2U( "Label" ) ) >>= *apLabel) )
+        if( !(xProp->getPropertyValue("Label") >>= *apLabel) )
             apLabel.reset();
     }
     catch(const uno::Exception &e)
commit ebed43f4d2bc42784c7acc6014aedb397b2356fd
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Jan 25 16:24:24 2013 -0500

    Replace use of std::auto_ptr with boost::scoped_ptr.
    
    Change-Id: Ie821170f9d5b47660370498611d781fd5ba139c8

diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index ea0a6b8..56aff51 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -21,9 +21,6 @@
 
 #include "PropertyMapper.hxx"
 
-#include <vector>
-//for auto_ptr
-#include <memory>
 #include <com/sun/star/chart2/DataPointLabel.hpp>
 #include <com/sun/star/chart2/Symbol.hpp>
 #include <com/sun/star/chart2/StackingDirection.hpp>
@@ -36,7 +33,9 @@
 #include <com/sun/star/drawing/XShapes.hpp>
 #include <cppuhelper/weakref.hxx>
 
+#include <vector>
 #include <boost/noncopyable.hpp>
+#include <boost/scoped_ptr.hpp>
 
 namespace chart
 {
@@ -233,23 +232,21 @@ private: //member
     sal_Int32               m_nGlobalSeriesIndex;
 
     //some cached values for data labels as they are very expensive
-    SAL_WNODEPRECATED_DECLARATIONS_PUSH
-    mutable ::std::auto_ptr< ::com::sun::star::chart2::DataPointLabel >
+    mutable boost::scoped_ptr<com::sun::star::chart2::DataPointLabel>
                                                     m_apLabel_Series;
-    mutable ::std::auto_ptr< tNameSequence >        m_apLabelPropNames_Series;
-    mutable ::std::auto_ptr< tAnySequence >         m_apLabelPropValues_Series;
-    mutable ::std::auto_ptr< ::com::sun::star::chart2::Symbol >
+    mutable boost::scoped_ptr<tNameSequence>        m_apLabelPropNames_Series;
+    mutable boost::scoped_ptr<tAnySequence>         m_apLabelPropValues_Series;
+    mutable boost::scoped_ptr<com::sun::star::chart2::Symbol>
                                                     m_apSymbolProperties_Series;
 
-    mutable ::std::auto_ptr< ::com::sun::star::chart2::DataPointLabel >
+    mutable boost::scoped_ptr<com::sun::star::chart2::DataPointLabel>
                                                     m_apLabel_AttributedPoint;
-    mutable ::std::auto_ptr< tNameSequence >        m_apLabelPropNames_AttributedPoint;
-    mutable ::std::auto_ptr< tAnySequence >         m_apLabelPropValues_AttributedPoint;
-    mutable ::std::auto_ptr< ::com::sun::star::chart2::Symbol >
+    mutable boost::scoped_ptr<tNameSequence>        m_apLabelPropNames_AttributedPoint;
+    mutable boost::scoped_ptr<tAnySequence>         m_apLabelPropValues_AttributedPoint;
+    mutable boost::scoped_ptr<com::sun::star::chart2::Symbol>
                                                     m_apSymbolProperties_AttributedPoint;
-    mutable ::std::auto_ptr< ::com::sun::star::chart2::Symbol >
+    mutable boost::scoped_ptr<com::sun::star::chart2::Symbol>
                                                     m_apSymbolProperties_InvisibleSymbolForSelection;
-    SAL_WNODEPRECATED_DECLARATIONS_POP
     mutable sal_Int32                               m_nCurrentAttributedPoint;
     ::com::sun::star::awt::Size                     m_aReferenceSize;
 
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index f0e267c..3c987d6 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -39,10 +39,8 @@
 #include <com/sun/star/text/WritingMode.hpp>
 #include <com/sun/star/chart2/data/XDataSource.hpp>
 
-//.............................................................................
-namespace chart
-{
-//.............................................................................
+namespace chart {
+
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::chart2;
 using ::com::sun::star::uno::Reference;
@@ -748,17 +746,17 @@ double VDataSeries::getYMeanValue() const
     return m_fYMeanValue;
 }
 
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-::std::auto_ptr< Symbol > getSymbolPropertiesFromPropertySet(
-        const uno::Reference< beans::XPropertySet >& xProp )
+Symbol* getSymbolPropertiesFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp )
 {
+    SAL_WNODEPRECATED_DECLARATIONS_PUSH
     ::std::auto_ptr< Symbol > apSymbolProps( new Symbol() );
+    SAL_WNODEPRECATED_DECLARATIONS_POP
     try
     {
-        if( xProp->getPropertyValue( C2U( "Symbol" ) ) >>= *apSymbolProps )
+        if( xProp->getPropertyValue("Symbol") >>= *apSymbolProps )
         {
             //use main color to fill symbols
-            xProp->getPropertyValue( C2U( "Color" ) ) >>= apSymbolProps->FillColor;
+            xProp->getPropertyValue("Color") >>= apSymbolProps->FillColor;
             // border of symbols always same as fill color
             apSymbolProps->BorderColor = apSymbolProps->FillColor;
         }
@@ -769,9 +767,8 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
     {
         ASSERT_EXCEPTION( e );
     }
-    return apSymbolProps;
+    return apSymbolProps.release();
 }
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
 
 Symbol* VDataSeries::getSymbolProperties( sal_Int32 index ) const
 {
@@ -779,22 +776,22 @@ Symbol* VDataSeries::getSymbolProperties( sal_Int32 index ) const
     if( isAttributedDataPoint( index ) )
     {
         adaptPointCache( index );
-        if(!m_apSymbolProperties_AttributedPoint.get())
-            m_apSymbolProperties_AttributedPoint = getSymbolPropertiesFromPropertySet( this->getPropertiesOfPoint( index ) );
+        if (!m_apSymbolProperties_AttributedPoint)
+            m_apSymbolProperties_AttributedPoint.reset(
+                getSymbolPropertiesFromPropertySet(this->getPropertiesOfPoint(index)));
         pRet = m_apSymbolProperties_AttributedPoint.get();
         //if a single data point does not have symbols but the dataseries itself has symbols
         //we create an invisible symbol shape to enable selection of that point
         if( !pRet || pRet->Style == SymbolStyle_NONE )
         {
-            if(!m_apSymbolProperties_Series.get())
-                m_apSymbolProperties_Series = getSymbolPropertiesFromPropertySet( this->getPropertiesOfSeries() );
+            if (!m_apSymbolProperties_Series)
+                m_apSymbolProperties_Series.reset(
+                    getSymbolPropertiesFromPropertySet(this->getPropertiesOfSeries()));
             if( m_apSymbolProperties_Series.get() && m_apSymbolProperties_Series->Style != SymbolStyle_NONE )
             {
-                if(!m_apSymbolProperties_InvisibleSymbolForSelection.get())
+                if (!m_apSymbolProperties_InvisibleSymbolForSelection)
                 {
-                    SAL_WNODEPRECATED_DECLARATIONS_PUSH
-                    m_apSymbolProperties_InvisibleSymbolForSelection = ::std::auto_ptr< Symbol >( new Symbol() );
-                    SAL_WNODEPRECATED_DECLARATIONS_POP
+                    m_apSymbolProperties_InvisibleSymbolForSelection.reset(new Symbol);
                     m_apSymbolProperties_InvisibleSymbolForSelection->Style = SymbolStyle_STANDARD;
                     m_apSymbolProperties_InvisibleSymbolForSelection->StandardSymbol = 0;//square
                     m_apSymbolProperties_InvisibleSymbolForSelection->Size = m_apSymbolProperties_Series->Size;
@@ -807,8 +804,9 @@ Symbol* VDataSeries::getSymbolProperties( sal_Int32 index ) const
     }
     else
     {
-        if(!m_apSymbolProperties_Series.get())
-            m_apSymbolProperties_Series = getSymbolPropertiesFromPropertySet( this->getPropertiesOfSeries() );
+        if (!m_apSymbolProperties_Series)
+            m_apSymbolProperties_Series.reset(
+                getSymbolPropertiesFromPropertySet(this->getPropertiesOfSeries()));
         pRet = m_apSymbolProperties_Series.get();
     }
 
@@ -896,11 +894,11 @@ uno::Reference< beans::XPropertySet > VDataSeries::getPropertiesOfSeries() const
     return  uno::Reference<beans::XPropertySet>(m_xDataSeries, uno::UNO_QUERY );
 }
 
-SAL_WNODEPRECATED_DECLARATIONS_PUSH
-::std::auto_ptr< DataPointLabel > getDataPointLabelFromPropertySet(
-        const uno::Reference< beans::XPropertySet >& xProp )
+DataPointLabel* getDataPointLabelFromPropertySet( const uno::Reference< beans::XPropertySet >& xProp )
 {
+    SAL_WNODEPRECATED_DECLARATIONS_PUSH
     ::std::auto_ptr< DataPointLabel > apLabel( new DataPointLabel() );
+    SAL_WNODEPRECATED_DECLARATIONS_POP
     try
     {
         if( !(xProp->getPropertyValue( C2U( "Label" ) ) >>= *apLabel) )
@@ -910,9 +908,8 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH
     {
         ASSERT_EXCEPTION( e );
     }
-    return apLabel;
+    return apLabel.release();
 }
-SAL_WNODEPRECATED_DECLARATIONS_POP
 
 void VDataSeries::adaptPointCache( sal_Int32 nNewPointIndex ) const
 {
@@ -933,13 +930,15 @@ DataPointLabel* VDataSeries::getDataPointLabel( sal_Int32 index ) const
     {
         adaptPointCache( index );
         if( !m_apLabel_AttributedPoint.get() )
-            m_apLabel_AttributedPoint = getDataPointLabelFromPropertySet( this->getPropertiesOfPoint( index ) );
+            m_apLabel_AttributedPoint.reset(
+                getDataPointLabelFromPropertySet(this->getPropertiesOfPoint(index)));
         pRet = m_apLabel_AttributedPoint.get();
     }
     else
     {
-        if(!m_apLabel_Series.get())
-            m_apLabel_Series = getDataPointLabelFromPropertySet( this->getPropertiesOfPoint( index ) );
+        if (!m_apLabel_Series)
+            m_apLabel_Series.reset(
+                getDataPointLabelFromPropertySet(this->getPropertiesOfPoint(index)));
         pRet = m_apLabel_Series.get();
     }
     if( !m_bAllowPercentValueInDataLabel )
@@ -969,16 +968,13 @@ bool VDataSeries::getTextLabelMultiPropertyLists( sal_Int32 index
     if( isAttributedDataPoint( index ) )
     {
         adaptPointCache( index );
-        if(!m_apLabelPropValues_AttributedPoint.get())
+        if (!m_apLabelPropValues_AttributedPoint)
         {
-            pPropNames = new tNameSequence();
-            pPropValues = new tAnySequence();
+            m_apLabelPropNames_AttributedPoint.reset(new tNameSequence);
+            m_apLabelPropValues_AttributedPoint.reset(new tAnySequence);
             xTextProp.set( this->getPropertiesOfPoint( index ));
-            PropertyMapper::getTextLabelMultiPropertyLists( xTextProp, *pPropNames, *pPropValues );
-            SAL_WNODEPRECATED_DECLARATIONS_PUSH
-            m_apLabelPropNames_AttributedPoint = ::std::auto_ptr< tNameSequence >(pPropNames);
-            m_apLabelPropValues_AttributedPoint = ::std::auto_ptr< tAnySequence >(pPropValues);
-            SAL_WNODEPRECATED_DECLARATIONS_POP
+            PropertyMapper::getTextLabelMultiPropertyLists(
+                xTextProp, *m_apLabelPropNames_AttributedPoint, *m_apLabelPropValues_AttributedPoint);
             bDoDynamicFontResize = true;
         }
         pPropNames = m_apLabelPropNames_AttributedPoint.get();
@@ -986,16 +982,13 @@ bool VDataSeries::getTextLabelMultiPropertyLists( sal_Int32 index
     }
     else
     {
-        if(!m_apLabelPropValues_Series.get())
+        if (!m_apLabelPropValues_Series)
         {
-            pPropNames = new tNameSequence();
-            pPropValues = new tAnySequence();
+            m_apLabelPropNames_Series.reset(new tNameSequence);
+            m_apLabelPropValues_Series.reset(new tAnySequence);
             xTextProp.set( this->getPropertiesOfPoint( index ));
-            PropertyMapper::getTextLabelMultiPropertyLists( xTextProp, *pPropNames, *pPropValues );
-            SAL_WNODEPRECATED_DECLARATIONS_PUSH
-            m_apLabelPropNames_Series = ::std::auto_ptr< tNameSequence >(pPropNames);
-            m_apLabelPropValues_Series = ::std::auto_ptr< tAnySequence >(pPropValues);
-            SAL_WNODEPRECATED_DECLARATIONS_POP
+            PropertyMapper::getTextLabelMultiPropertyLists(
+                xTextProp, *m_apLabelPropNames_Series, *m_apLabelPropValues_Series);
             bDoDynamicFontResize = true;
         }
         pPropNames = m_apLabelPropNames_Series.get();
@@ -1023,8 +1016,6 @@ sal_Int32 VDataSeries::getMissingValueTreatment() const
     return m_nMissingValueTreatment;
 }
 
-//.............................................................................
 } //namespace chart
-//.............................................................................
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 339f1cb3c2d9842a823f24dfa1cd872b92cd5b88
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Jan 25 16:05:58 2013 -0500

    Make these classes explicitly non-copyable.
    
    Change-Id: I0dcf277a1b72afe294874b42efaf0b24e1b25b8c

diff --git a/chart2/source/view/inc/VDataSeries.hxx b/chart2/source/view/inc/VDataSeries.hxx
index bdf9a3e..ea0a6b8 100644
--- a/chart2/source/view/inc/VDataSeries.hxx
+++ b/chart2/source/view/inc/VDataSeries.hxx
@@ -36,10 +36,12 @@
 #include <com/sun/star/drawing/XShapes.hpp>
 #include <cppuhelper/weakref.hxx>
 
+#include <boost/noncopyable.hpp>
+
 namespace chart
 {
 
-class VDataSequence
+class VDataSequence : boost::noncopyable
 {
 public:
     void init( const ::com::sun::star::uno::Reference<
@@ -57,7 +59,7 @@ public:
     mutable ::com::sun::star::uno::Sequence< double > Doubles;
 };
 
-class VDataSeries
+class VDataSeries : boost::noncopyable
 {
 public:
     VDataSeries( const ::com::sun::star::uno::Reference<
commit 8b660baccf969b44fc404578efadaff5e5c8850e
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Jan 25 16:00:01 2013 -0500

    A little cleanup.
    
    Change-Id: I69729603bcaadffa06a56296a6ef37af2aef6c54

diff --git a/chart2/source/view/inc/VSeriesPlotter.hxx b/chart2/source/view/inc/VSeriesPlotter.hxx
index 48f57a8..c3bba76 100644
--- a/chart2/source/view/inc/VSeriesPlotter.hxx
+++ b/chart2/source/view/inc/VSeriesPlotter.hxx
@@ -39,10 +39,7 @@ namespace com { namespace sun { namespace star {
     }
 }}}
 
-//.............................................................................
-namespace chart
-{
-//.............................................................................
+namespace chart {
 
 class NumberFormatterWrapper;
 
@@ -73,17 +70,12 @@ private:
     tNumberFormatMap m_aNumberFormatMap;
 };
 
-//-----------------------------------------------------------------------------
 /**
-*/
-
-//enum StackType { STACK_NORMAL, STACK_NONE, STACK_BESIDES, STACK_ONTOP, STACK_BEHIND };
-
+ * A list of series that have the same CoordinateSystem. They are used to be
+ * plotted maybe in a stacked manner by a plotter.
+ */
 class VDataSeriesGroup
 {
-    //a list of series that have the same CoordinateSystem
-    //they are used to be plotted maybe in a stacked manner by a plotter
-
 public:
     VDataSeriesGroup();
     VDataSeriesGroup( VDataSeries* pSeries );
@@ -127,9 +119,6 @@ private:
 
 class VSeriesPlotter : public PlotterBase, public MinimumAndMaximumSupplier, public LegendEntryProvider
 {
-    //-------------------------------------------------------------------------
-    // public methods
-    //-------------------------------------------------------------------------
 public:
     virtual ~VSeriesPlotter();
 
@@ -245,9 +234,6 @@ public:
 
     ::std::vector< VDataSeries* > getAllSeries();
 
-    //-------------------------------------------------------------------------
-    //-------------------------------------------------------------------------
-
     static VSeriesPlotter* createSeriesPlotter( const ::com::sun::star::uno::Reference<
                                 ::com::sun::star::chart2::XChartType >& xChartTypeModel
                                 , sal_Int32 nDimensionCount
@@ -282,14 +268,11 @@ public:
     bool WantToPlotInFrontOfAxisLine();
     virtual bool shouldSnapRectToUsedArea();
 
-    //-------------------------------------------------------------------------
-    //-------------------------------------------------------------------------
-    //-------------------------------------------------------------------------
-private: //methods
+private:
     //no default constructor
     VSeriesPlotter();
 
-protected: //methods
+protected:
 
     VSeriesPlotter( const ::com::sun::star::uno::Reference<
                 ::com::sun::star::chart2::XChartType >& xChartTypeModel
@@ -408,7 +391,7 @@ protected: //methods
 
     VDataSeries* getFirstSeries() const;
 
-protected: //member
+protected:
     PlottingPositionHelper*    m_pMainPosHelper;
 
     ::com::sun::star::uno::Reference<
@@ -434,7 +417,7 @@ protected: //member
     ::com::sun::star::uno::Sequence< sal_Int32 >    m_aCoordinateSystemResolution;
     bool m_bPointsWereSkipped;
 
-private: //member
+private:
     typedef std::map< sal_Int32 , ExplicitScaleData > tSecondaryValueScales;
     tSecondaryValueScales   m_aSecondaryValueScales;
 
@@ -443,9 +426,7 @@ private: //member
     ::com::sun::star::awt::Size      m_aPageReferenceSize;
 };
 
-//.............................................................................
 } //namespace chart
-//.............................................................................
 #endif
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 20f03d3607089c16f34ece59a9384ca1d50e410e
Author: Kohei Yoshida <kohei.yoshida at gmail.com>
Date:   Fri Jan 25 15:19:48 2013 -0500

    C2U macros no longer necessary.
    
    Change-Id: Ia7b3d03e6d00dd2a57cd40dc9a63507652cac84d

diff --git a/chart2/source/view/charttypes/AreaChart.cxx b/chart2/source/view/charttypes/AreaChart.cxx
index fa0ec3d..a9e207c 100644
--- a/chart2/source/view/charttypes/AreaChart.cxx
+++ b/chart2/source/view/charttypes/AreaChart.cxx
@@ -97,9 +97,9 @@ AreaChart::AreaChart( const uno::Reference<XChartType>& xChartTypeModel
     {
         if( m_xChartTypeModelProps.is() )
         {
-            m_xChartTypeModelProps->getPropertyValue( C2U( "CurveStyle" ) ) >>= m_eCurveStyle;
-            m_xChartTypeModelProps->getPropertyValue( C2U( "CurveResolution" ) ) >>= m_nCurveResolution;
-            m_xChartTypeModelProps->getPropertyValue( C2U( "SplineOrder" ) ) >>= m_nSplineOrder;
+            m_xChartTypeModelProps->getPropertyValue("CurveStyle") >>= m_eCurveStyle;
+            m_xChartTypeModelProps->getPropertyValue("CurveResolution") >>= m_nCurveResolution;
+            m_xChartTypeModelProps->getPropertyValue("SplineOrder") >>= m_nSplineOrder;
         }
     }
     catch( uno::Exception& e )
@@ -377,7 +377,7 @@ bool AreaChart::impl_createLine( VDataSeries* pSeries
                 , pSeries->getPropertiesOfSeries()
                 , PropertyMapper::getPropertyNameMapForLineSeriesProperties() );
         //because of this name this line will be used for marking
-        m_pShapeFactory->setShapeName( xShape, C2U("MarkHandles") );
+        m_pShapeFactory->setShapeName(xShape, "MarkHandles");
     }
     return true;
 }
@@ -458,7 +458,7 @@ bool AreaChart::impl_createArea( VDataSeries* pSeries
                 , pSeries->getPropertiesOfSeries()
                 , PropertyMapper::getPropertyNameMapForFilledSeriesProperties() );
     //because of this name this line will be used for marking
-    m_pShapeFactory->setShapeName( xShape, C2U("MarkHandles") );
+    m_pShapeFactory->setShapeName(xShape, "MarkHandles");
     return true;
 }
 
@@ -814,8 +814,8 @@ void AreaChart::createShapes()
                         {
                             bool bShowPositive = false;
                             bool bShowNegative = false;
-                            xErrorBarProp->getPropertyValue( C2U( "ShowPositiveError" )) >>= bShowPositive;
-                            xErrorBarProp->getPropertyValue( C2U( "ShowNegativeError" )) >>= bShowNegative;
+                            xErrorBarProp->getPropertyValue("ShowPositiveError") >>= bShowPositive;
+                            xErrorBarProp->getPropertyValue("ShowNegativeError") >>= bShowNegative;
                             bCreateYErrorBar = bShowPositive || bShowNegative;
                         }
 
@@ -824,8 +824,8 @@ void AreaChart::createShapes()
                         {
                             bool bShowPositive = false;
                             bool bShowNegative = false;
-                            xErrorBarProp->getPropertyValue( C2U( "ShowPositiveError" )) >>= bShowPositive;
-                            xErrorBarProp->getPropertyValue( C2U( "ShowNegativeError" )) >>= bShowNegative;
+                            xErrorBarProp->getPropertyValue("ShowPositiveError") >>= bShowPositive;
+                            xErrorBarProp->getPropertyValue("ShowNegativeError") >>= bShowNegative;
                             bCreateXErrorBar = bShowPositive || bShowNegative;
                         }
                     }


More information about the Libreoffice-commits mailing list