diff options
author | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-05 22:05:51 +0100 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2012-03-05 22:12:31 +0100 |
commit | a1410ef073d2117cb2a3c9d9a4e9ecff7d911344 (patch) | |
tree | 974221c1d90f055e39cd5972775880d9b013d32b /chart2 | |
parent | 3f78f26aa8db1d3ae56d9e509e0a8e5b4518821b (diff) |
move some auto_ptr to boost::scoped_ptr
Diffstat (limited to 'chart2')
-rw-r--r-- | chart2/source/view/axes/VCartesianAxis.cxx | 70 | ||||
-rw-r--r-- | chart2/source/view/axes/VCartesianAxis.hxx | 4 |
2 files changed, 27 insertions, 47 deletions
diff --git a/chart2/source/view/axes/VCartesianAxis.cxx b/chart2/source/view/axes/VCartesianAxis.cxx index 8291efb8681e..264450d3bda3 100644 --- a/chart2/source/view/axes/VCartesianAxis.cxx +++ b/chart2/source/view/axes/VCartesianAxis.cxx @@ -51,7 +51,7 @@ #include <svx/unoshtxt.hxx> #include <algorithm> -#include <memory> +#include <boost/scoped_ptr.hpp> //............................................................................. namespace chart @@ -553,17 +553,14 @@ void VCartesianAxis::createAllTickInfos( ::std::vector< ::std::vector< TickInfo VAxisBase::createAllTickInfos(rAllTickInfos); } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -::std::auto_ptr< TickIter > VCartesianAxis::createLabelTickIterator( sal_Int32 nTextLevel ) +TickIter* VCartesianAxis::createLabelTickIterator( sal_Int32 nTextLevel ) { if( nTextLevel>=0 && nTextLevel < static_cast< sal_Int32 >(m_aAllTickInfos.size()) ) - return ::std::auto_ptr< TickIter >( new PureTickIter( m_aAllTickInfos[nTextLevel] ) ); - return ::std::auto_ptr< TickIter >(); + new PureTickIter( m_aAllTickInfos[nTextLevel] ); + return NULL; } -SAL_WNODEPRECATED_DECLARATIONS_POP -SAL_WNODEPRECATED_DECLARATIONS_PUSH -::std::auto_ptr< TickIter > VCartesianAxis::createMaximumLabelTickIterator( sal_Int32 nTextLevel ) +TickIter* VCartesianAxis::createMaximumLabelTickIterator( sal_Int32 nTextLevel ) { if( isComplexCategoryAxis() || isDateAxis() ) { @@ -576,13 +573,12 @@ SAL_WNODEPRECATED_DECLARATIONS_PUSH if( !m_aAllTickInfos.empty() ) { sal_Int32 nLongestLabelIndex = m_bUseTextLabels ? this->getIndexOfLongestLabel( m_aTextLabels ) : 0; - return ::std::auto_ptr< TickIter >( new MaxLabelTickIter( m_aAllTickInfos[0], nLongestLabelIndex ) ); + new MaxLabelTickIter( m_aAllTickInfos[0], nLongestLabelIndex ); } } } - return ::std::auto_ptr< TickIter >(); + return NULL; } -SAL_WNODEPRECATED_DECLARATIONS_POP sal_Int32 VCartesianAxis::getTextLevelCount() const { @@ -1332,16 +1328,14 @@ void VCartesianAxis::doStaggeringOfLabels( const AxisLabelProperties& rAxisLabel B2DVector aCummulatedLabelsDistance(0,0); for( sal_Int32 nTextLevel=0; nTextLevel<nTextLevelCount; nTextLevel++ ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< TickIter > apTickIter = createLabelTickIterator( nTextLevel ); - SAL_WNODEPRECATED_DECLARATIONS_POP - if(apTickIter.get()) - { - double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; - aCummulatedLabelsDistance += lcl_getLabelsDistance( *apTickIter.get() - , pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties ) - , fRotationAngleDegree ); - } + boost::scoped_ptr< TickIter > apTickIter(createLabelTickIterator( nTextLevel )); + if(apTickIter) + { + double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; + aCummulatedLabelsDistance += lcl_getLabelsDistance( *apTickIter.get() + , pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties ) + , fRotationAngleDegree ); + } } } else if( rAxisLabelProperties.getIsStaggered() ) @@ -1367,9 +1361,7 @@ void VCartesianAxis::createLabels() //create labels if( m_aAxisProperties.m_bDisplayLabels ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() ); - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() ); TickFactory_2D* pTickFactory2D = apTickFactory2D.get(); if( !pTickFactory2D ) return; @@ -1388,10 +1380,8 @@ void VCartesianAxis::createLabels() sal_Int32 nScreenDistanceBetweenTicks = -1; for( sal_Int32 nTextLevel=0; nTextLevel<nTextLevelCount; nTextLevel++ ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< TickIter > apTickIter = createLabelTickIterator( nTextLevel ); - SAL_WNODEPRECATED_DECLARATIONS_POP - if(apTickIter.get()) + boost::scoped_ptr< TickIter > apTickIter(createLabelTickIterator( nTextLevel )); + if(apTickIter) { if(nTextLevel==0) { @@ -1428,9 +1418,7 @@ void VCartesianAxis::createMaximumLabels() //create labels if( m_aAxisProperties.m_bDisplayLabels ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() ); - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() ); TickFactory_2D* pTickFactory2D = apTickFactory2D.get(); if( !pTickFactory2D ) return; @@ -1450,10 +1438,8 @@ void VCartesianAxis::createMaximumLabels() sal_Int32 nTextLevelCount = getTextLevelCount(); for( sal_Int32 nTextLevel=0; nTextLevel<nTextLevelCount; nTextLevel++ ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< TickIter > apTickIter = createMaximumLabelTickIterator( nTextLevel ); - SAL_WNODEPRECATED_DECLARATIONS_POP - if(apTickIter.get()) + boost::scoped_ptr< TickIter > apTickIter(createMaximumLabelTickIterator( nTextLevel )); + if(apTickIter) { while( !createTextShapes( m_xTextTarget, *apTickIter.get(), aAxisLabelProperties, pTickFactory2D, -1 ) ) { @@ -1470,9 +1456,7 @@ void VCartesianAxis::updatePositions() //update positions of labels if( m_aAxisProperties.m_bDisplayLabels ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() ); - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() ); TickFactory_2D* pTickFactory2D = apTickFactory2D.get(); if( !pTickFactory2D ) return; @@ -1567,9 +1551,7 @@ void VCartesianAxis::createShapes() if( !prepareShapeCreation() ) return; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() ); - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::scoped_ptr< TickFactory_2D > apTickFactory2D( this->createTickFactory2D() ); TickFactory_2D* pTickFactory2D = apTickFactory2D.get(); if( !pTickFactory2D ) return; @@ -1593,10 +1575,8 @@ void VCartesianAxis::createShapes() sal_Int32 nTextLevelCount = getTextLevelCount(); for( sal_Int32 nTextLevel=0; nTextLevel<nTextLevelCount; nTextLevel++ ) { - SAL_WNODEPRECATED_DECLARATIONS_PUSH - ::std::auto_ptr< TickIter > apTickIter = createLabelTickIterator( nTextLevel ); - SAL_WNODEPRECATED_DECLARATIONS_POP - if( apTickIter.get() ) + boost::scoped_ptr< TickIter > apTickIter(createLabelTickIterator( nTextLevel )); + if( apTickIter ) { double fRotationAngleDegree = m_aAxisLabelProperties.fRotationAngleDegree; B2DVector aLabelsDistance( lcl_getLabelsDistance( *apTickIter.get(), pTickFactory2D->getDistanceAxisTickToText( m_aAxisProperties, false ), fRotationAngleDegree ) ); diff --git a/chart2/source/view/axes/VCartesianAxis.hxx b/chart2/source/view/axes/VCartesianAxis.hxx index 68c93bb2e101..55ba354b1c87 100644 --- a/chart2/source/view/axes/VCartesianAxis.hxx +++ b/chart2/source/view/axes/VCartesianAxis.hxx @@ -66,8 +66,8 @@ public: virtual void createAllTickInfos( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos ); void createAllTickInfosFromComplexCategories( ::std::vector< ::std::vector< TickInfo > >& rAllTickInfos, bool bShiftedPosition ); - ::std::auto_ptr< TickIter > createLabelTickIterator( sal_Int32 nTextLevel ); - ::std::auto_ptr< TickIter > createMaximumLabelTickIterator( sal_Int32 nTextLevel ); + TickIter* createLabelTickIterator( sal_Int32 nTextLevel ); + TickIter* createMaximumLabelTickIterator( sal_Int32 nTextLevel ); sal_Int32 getTextLevelCount() const; //------------------------------------------------------------------------- |