summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/controller/inc/AxisItemConverter.hxx6
-rw-r--r--chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx16
2 files changed, 8 insertions, 14 deletions
diff --git a/chart2/source/controller/inc/AxisItemConverter.hxx b/chart2/source/controller/inc/AxisItemConverter.hxx
index ad742691ada5..3a82e54124af 100644
--- a/chart2/source/controller/inc/AxisItemConverter.hxx
+++ b/chart2/source/controller/inc/AxisItemConverter.hxx
@@ -56,15 +56,15 @@ protected:
virtual bool ApplySpecialItem( sal_uInt16 nWhichId, const SfxItemSet & rItemSet ) override;
private:
- std::vector< ItemConverter * > m_aConverters;
+ std::vector< std::unique_ptr<ItemConverter> > m_aConverters;
css::uno::Reference<
css::chart2::XAxis > m_xAxis;
css::uno::Reference<
css::chart2::XChartDocument > m_xChartDoc;
- ExplicitScaleData* m_pExplicitScale;
- ExplicitIncrementData* m_pExplicitIncrement;
+ std::unique_ptr<ExplicitScaleData> m_pExplicitScale;
+ std::unique_ptr<ExplicitIncrementData> m_pExplicitIncrement;
};
}}
diff --git a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
index 6b59fcb5394f..b0ba96674cf9 100644
--- a/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/AxisItemConverter.cxx
@@ -80,22 +80,20 @@ AxisItemConverter::AxisItemConverter(
::chart::ExplicitIncrementData const * pIncrement /* = NULL */,
const awt::Size* pRefSize ) :
ItemConverter( rPropertySet, rItemPool ),
- m_xChartDoc( xChartDoc ),
- m_pExplicitScale( nullptr ),
- m_pExplicitIncrement( nullptr )
+ m_xChartDoc( xChartDoc )
{
Reference< lang::XMultiServiceFactory > xNamedPropertyContainerFactory( xChartDoc, uno::UNO_QUERY );
if( pScale )
- m_pExplicitScale = new ::chart::ExplicitScaleData( *pScale );
+ m_pExplicitScale.reset( new ::chart::ExplicitScaleData( *pScale ) );
if( pIncrement )
- m_pExplicitIncrement = new ::chart::ExplicitIncrementData( *pIncrement );
+ m_pExplicitIncrement.reset( new ::chart::ExplicitIncrementData( *pIncrement ) );
- m_aConverters.push_back( new GraphicPropertyItemConverter(
+ m_aConverters.emplace_back( new GraphicPropertyItemConverter(
rPropertySet, rItemPool, rDrawModel,
xNamedPropertyContainerFactory,
GraphicObjectType::LineProperties ));
- m_aConverters.push_back(
+ m_aConverters.emplace_back(
new CharacterPropertyItemConverter(rPropertySet, rItemPool, pRefSize, "ReferencePageSize"));
m_xAxis.set( Reference< chart2::XAxis >( rPropertySet, uno::UNO_QUERY ) );
@@ -104,10 +102,6 @@ AxisItemConverter::AxisItemConverter(
AxisItemConverter::~AxisItemConverter()
{
- delete m_pExplicitScale;
- delete m_pExplicitIncrement;
-
- std::for_each(m_aConverters.begin(), m_aConverters.end(), std::default_delete<ItemConverter>());
}
void AxisItemConverter::FillItemSet( SfxItemSet & rOutItemSet ) const