From f188ca44d8a7f7567ea76a3fd635c0fa6fcf4c4b Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Thu, 20 Sep 2012 17:39:46 -0400 Subject: std::auto_ptr is deprecated. For this usage, boost::shared_ptr is probably an appropriate replacement. Change-Id: I89bea80d330f362e60af4ce66a23316d0029e0d8 --- chart2/source/view/main/ChartView.cxx | 35 +++++++++++------------------------ 1 file changed, 11 insertions(+), 24 deletions(-) (limited to 'chart2') diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index f1be1064b154..763994e1a131 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -105,10 +105,9 @@ #include #include -//............................................................................. -namespace chart -{ -//............................................................................. +#include + +namespace chart { using namespace ::com::sun::star; using namespace ::com::sun::star::chart2; @@ -2122,8 +2121,7 @@ void changePositionOfAxisTitle( VTitle* pVTitle, TitleAlignment eAlignment pVTitle->changePosition( aNewPosition ); } -SAL_WNODEPRECATED_DECLARATIONS_PUSH -std::auto_ptr lcl_createTitle( TitleHelper::eTitleType eType +boost::shared_ptr lcl_createTitle( TitleHelper::eTitleType eType , const uno::Reference< drawing::XShapes>& xPageShapes , const uno::Reference< lang::XMultiServiceFactory>& xShapeFactory , const uno::Reference< frame::XModel >& xChartModel @@ -2132,7 +2130,7 @@ std::auto_ptr lcl_createTitle( TitleHelper::eTitleType eType , TitleAlignment eAlignment , bool& rbAutoPosition ) { - std::auto_ptr apVTitle; + boost::shared_ptr apVTitle; // #i109336# Improve auto positioning in chart double fPercentage = lcl_getPageLayoutDistancePercentage(); @@ -2159,7 +2157,7 @@ std::auto_ptr lcl_createTitle( TitleHelper::eTitleType eType if( !aCompleteString.isEmpty() ) { //create title - apVTitle = std::auto_ptr(new VTitle(xTitle)); + apVTitle.reset(new VTitle(xTitle)); rtl::OUString aCID( ObjectIdentifier::createClassifiedIdentifierForObject( xTitle, xChartModel ) ); apVTitle->init(xPageShapes,xShapeFactory,aCID); apVTitle->createShapes( awt::Point(0,0), rPageSize ); @@ -2265,7 +2263,6 @@ std::auto_ptr lcl_createTitle( TitleHelper::eTitleType eType } return apVTitle; } -SAL_WNODEPRECATED_DECLARATIONS_POP bool lcl_createLegend( const uno::Reference< XLegend > & xLegend , const uno::Reference< drawing::XShapes>& xPageShapes @@ -2504,9 +2501,7 @@ void ChartView::createShapes() //------------ create x axis title bool bAutoPosition_XTitle = true; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr apVTitle_X; - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::shared_ptr apVTitle_X; if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 0 ) ) apVTitle_X = lcl_createTitle( TitleHelper::TITLE_AT_STANDARD_X_AXIS_POSITION, xPageShapes, m_xShapeFactory, m_xChartModel , aRemainingSpace, aPageSize, ALIGN_BOTTOM, bAutoPosition_XTitle ); @@ -2515,9 +2510,7 @@ void ChartView::createShapes() //------------ create y axis title bool bAutoPosition_YTitle = true; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr apVTitle_Y; - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::shared_ptr apVTitle_Y; if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 1 ) ) apVTitle_Y = lcl_createTitle( TitleHelper::TITLE_AT_STANDARD_Y_AXIS_POSITION, xPageShapes, m_xShapeFactory, m_xChartModel , aRemainingSpace, aPageSize, ALIGN_LEFT, bAutoPosition_YTitle ); @@ -2526,9 +2519,7 @@ void ChartView::createShapes() //------------ create z axis title bool bAutoPosition_ZTitle = true; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr apVTitle_Z; - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::shared_ptr apVTitle_Z; if( ChartTypeHelper::isSupportingMainAxis( xChartType, nDimension, 2 ) ) apVTitle_Z = lcl_createTitle( TitleHelper::Z_AXIS_TITLE, xPageShapes, m_xShapeFactory, m_xChartModel , aRemainingSpace, aPageSize, ALIGN_RIGHT, bAutoPosition_ZTitle ); @@ -2540,9 +2531,7 @@ void ChartView::createShapes() //------------ create secondary x axis title bool bAutoPosition_SecondXTitle = true; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr apVTitle_SecondX; - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::shared_ptr apVTitle_SecondX; if( ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimension, 0 ) ) apVTitle_SecondX = lcl_createTitle( TitleHelper::SECONDARY_X_AXIS_TITLE, xPageShapes, m_xShapeFactory, m_xChartModel , aRemainingSpace, aPageSize, bIsVertical? ALIGN_RIGHT : ALIGN_TOP, bAutoPosition_SecondXTitle ); @@ -2551,9 +2540,7 @@ void ChartView::createShapes() //------------ create secondary y axis title bool bAutoPosition_SecondYTitle = true; - SAL_WNODEPRECATED_DECLARATIONS_PUSH - std::auto_ptr apVTitle_SecondY; - SAL_WNODEPRECATED_DECLARATIONS_POP + boost::shared_ptr apVTitle_SecondY; if( ChartTypeHelper::isSupportingSecondaryAxis( xChartType, nDimension, 1 ) ) apVTitle_SecondY = lcl_createTitle( TitleHelper::SECONDARY_Y_AXIS_TITLE, xPageShapes, m_xShapeFactory, m_xChartModel , aRemainingSpace, aPageSize, bIsVertical? ALIGN_TOP : ALIGN_RIGHT, bAutoPosition_SecondYTitle ); -- cgit