diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-20 13:49:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-21 12:11:29 +0200 |
commit | 5ff6bfeafb9c14d2f0fff4464b970dff11de537b (patch) | |
tree | 6f7225cb42a22b27eb6b7ba9c7fb38b46a3a509b /i18npool | |
parent | c4558e4b7b3defe7a128e16781eaececc416195a (diff) |
loplugin:useuniqueptr in OutlineNumbering
Change-Id: I7413ac32e976ffa965de92f9339f838dec5d543a
Reviewed-on: https://gerrit.libreoffice.org/59359
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/source/localedata/localedata.cxx | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index 3f5cabdc1d97..75427fae14cc 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -1359,7 +1359,7 @@ class OutlineNumbering : public cppu::WeakImplHelper < container::XIndexAccess > std::unique_ptr<const OutlineNumberingLevel_Impl[]> m_pOutlineLevels; sal_Int16 m_nCount; public: - OutlineNumbering(const OutlineNumberingLevel_Impl* pOutlineLevels, int nLevels); + OutlineNumbering(std::unique_ptr<const OutlineNumberingLevel_Impl[]> pOutlineLevels, int nLevels); //XIndexAccess virtual sal_Int32 SAL_CALL getCount( ) override; @@ -1392,7 +1392,7 @@ LocaleDataImpl::getOutlineNumberingLevels( const lang::Locale& rLocale ) { int j; - OutlineNumberingLevel_Impl* level = new OutlineNumberingLevel_Impl[ nLevels+1 ]; + std::unique_ptr<OutlineNumberingLevel_Impl[]> level(new OutlineNumberingLevel_Impl[ nLevels+1 ]); sal_Unicode const *** pLevel = pStyle[i]; for( j = 0; j < nLevels; j++ ) { @@ -1430,7 +1430,7 @@ LocaleDataImpl::getOutlineNumberingLevels( const lang::Locale& rLocale ) level[j].nFirstLineOffset = 0; level[j].sTransliteration.clear(); level[j].nNatNum = 0; - aRet[i] = new OutlineNumbering( level, nLevels ); + aRet[i] = new OutlineNumbering( std::move(level), nLevels ); } return aRet; } @@ -1522,8 +1522,8 @@ using namespace ::com::sun::star::beans; using namespace ::com::sun::star::style; using namespace ::com::sun::star::text; -OutlineNumbering::OutlineNumbering(const OutlineNumberingLevel_Impl* pOutlnLevels, int nLevels) : - m_pOutlineLevels(pOutlnLevels), +OutlineNumbering::OutlineNumbering(std::unique_ptr<const OutlineNumberingLevel_Impl[]> pOutlnLevels, int nLevels) : + m_pOutlineLevels(std::move(pOutlnLevels)), m_nCount(sal::static_int_cast<sal_Int16>(nLevels)) { } |