diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-22 13:29:11 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-03-23 11:05:55 +0100 |
commit | e4a839932a6247e8ddd9b16ae597a705ad71fb43 (patch) | |
tree | 045b18f3ee5e7fa450498feb860bf1d0ad2251b7 | |
parent | deb2151d7392b8bbeb0f0287c17a3eb4f8eb42df (diff) |
loplugin:useuniqueptr in PPTExStyleSheet
Change-Id: Ib830a1be4f840c06ebda9830351d82ad31706be1
Reviewed-on: https://gerrit.libreoffice.org/51738
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sd/source/filter/eppt/epptbase.hxx | 4 | ||||
-rw-r--r-- | sd/source/filter/eppt/pptx-stylesheet.cxx | 15 |
2 files changed, 7 insertions, 12 deletions
diff --git a/sd/source/filter/eppt/epptbase.hxx b/sd/source/filter/eppt/epptbase.hxx index 2f726f3c6925..463067087503 100644 --- a/sd/source/filter/eppt/epptbase.hxx +++ b/sd/source/filter/eppt/epptbase.hxx @@ -292,8 +292,8 @@ class PPTExStyleSheet public: - PPTExCharSheet* mpCharSheet[ PPTEX_STYLESHEETENTRYS ]; - PPTExParaSheet* mpParaSheet[ PPTEX_STYLESHEETENTRYS ]; + std::unique_ptr<PPTExCharSheet> mpCharSheet[ PPTEX_STYLESHEETENTRYS ]; + std::unique_ptr<PPTExParaSheet> mpParaSheet[ PPTEX_STYLESHEETENTRYS ]; PPTExStyleSheet( sal_uInt16 nDefaultTab, PPTExBulletProvider* pBuProv ); ~PPTExStyleSheet(); diff --git a/sd/source/filter/eppt/pptx-stylesheet.cxx b/sd/source/filter/eppt/pptx-stylesheet.cxx index 1dbd28ee8a11..9fcc3c1f5a45 100644 --- a/sd/source/filter/eppt/pptx-stylesheet.cxx +++ b/sd/source/filter/eppt/pptx-stylesheet.cxx @@ -387,21 +387,16 @@ PPTExStyleSheet::PPTExStyleSheet( sal_uInt16 nDefaultTab, PPTExBulletProvider* p { for ( int nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ ) { - mpParaSheet[ nInstance ] = ( nInstance == EPP_TEXTTYPE_notUsed ) ? nullptr : new PPTExParaSheet( nInstance, nDefaultTab, pBuProv ); - mpCharSheet[ nInstance ] = ( nInstance == EPP_TEXTTYPE_notUsed ) ? nullptr : new PPTExCharSheet( nInstance ); + if (nInstance != EPP_TEXTTYPE_notUsed) + { + mpParaSheet[ nInstance ].reset(new PPTExParaSheet( nInstance, nDefaultTab, pBuProv )); + mpCharSheet[ nInstance ].reset(new PPTExCharSheet( nInstance )); + } } } PPTExStyleSheet::~PPTExStyleSheet() { - for ( int nInstance = EPP_TEXTTYPE_Title; nInstance <= EPP_TEXTTYPE_QuarterBody; nInstance++ ) - { - if ( nInstance == EPP_TEXTTYPE_notUsed ) - continue; - - delete mpParaSheet[ nInstance ]; - delete mpCharSheet[ nInstance ]; - } } void PPTExStyleSheet::SetStyleSheet( const css::uno::Reference< css::beans::XPropertySet > & rXPropSet, |