diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-17 17:01:45 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-01-25 07:23:56 +0100 |
commit | fe4de616a4a7cc1d5a2ab701e84477f73a47c61a (patch) | |
tree | 0749b9d44e7b127f66c8a32d1cd5e80f971adc09 | |
parent | 437fffe098429dcc2c65184876b6b8444a7d452c (diff) |
loplugin:useuniqueptr in SvXMLNumFmtExport
Change-Id: I720450a4bee17673907fba2e9a34879d2a98bcae
Reviewed-on: https://gerrit.libreoffice.org/48481
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | include/xmloff/xmlnumfe.hxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfe.cxx | 26 |
2 files changed, 14 insertions, 16 deletions
diff --git a/include/xmloff/xmlnumfe.hxx b/include/xmloff/xmlnumfe.hxx index 79df5c853f5d..75c3b133c036 100644 --- a/include/xmloff/xmlnumfe.hxx +++ b/include/xmloff/xmlnumfe.hxx @@ -52,8 +52,8 @@ private: SvNumberFormatter* pFormatter; OUStringBuffer sTextContent; std::unique_ptr<SvXMLNumUsedList_Impl> pUsedList; - CharClass* pCharClass; - LocaleDataWrapper* pLocaleData; + std::unique_ptr<CharClass> pCharClass; + std::unique_ptr<LocaleDataWrapper> pLocaleData; SAL_DLLPRIVATE void AddCalendarAttr_Impl( const OUString& rCalendar ); SAL_DLLPRIVATE void AddStyleAttr_Impl( bool bLong ); diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx index 1fd79f01be4e..cc7dc555a106 100644 --- a/xmloff/source/style/xmlnumfe.cxx +++ b/xmloff/source/style/xmlnumfe.cxx @@ -229,17 +229,17 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( if ( pFormatter ) { - pCharClass = new CharClass( pFormatter->GetComponentContext(), - pFormatter->GetLanguageTag() ); - pLocaleData = new LocaleDataWrapper( pFormatter->GetComponentContext(), - pFormatter->GetLanguageTag() ); + pCharClass.reset( new CharClass( pFormatter->GetComponentContext(), + pFormatter->GetLanguageTag() ) ); + pLocaleData.reset( new LocaleDataWrapper( pFormatter->GetComponentContext(), + pFormatter->GetLanguageTag() ) ); } else { LanguageTag aLanguageTag( MsLangId::getSystemLanguage() ); - pCharClass = new CharClass( rExport.getComponentContext(), aLanguageTag ); - pLocaleData = new LocaleDataWrapper( rExport.getComponentContext(), aLanguageTag ); + pCharClass.reset( new CharClass( rExport.getComponentContext(), aLanguageTag ) ); + pLocaleData.reset( new LocaleDataWrapper( rExport.getComponentContext(), aLanguageTag ) ); } pUsedList.reset(new SvXMLNumUsedList_Impl); @@ -263,17 +263,17 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( if ( pFormatter ) { - pCharClass = new CharClass( pFormatter->GetComponentContext(), - pFormatter->GetLanguageTag() ); - pLocaleData = new LocaleDataWrapper( pFormatter->GetComponentContext(), - pFormatter->GetLanguageTag() ); + pCharClass.reset( new CharClass( pFormatter->GetComponentContext(), + pFormatter->GetLanguageTag() ) ); + pLocaleData.reset( new LocaleDataWrapper( pFormatter->GetComponentContext(), + pFormatter->GetLanguageTag() ) ); } else { LanguageTag aLanguageTag( MsLangId::getSystemLanguage() ); - pCharClass = new CharClass( rExport.getComponentContext(), aLanguageTag ); - pLocaleData = new LocaleDataWrapper( rExport.getComponentContext(), aLanguageTag ); + pCharClass.reset( new CharClass( rExport.getComponentContext(), aLanguageTag ) ); + pLocaleData.reset( new LocaleDataWrapper( rExport.getComponentContext(), aLanguageTag ) ); } pUsedList.reset(new SvXMLNumUsedList_Impl); @@ -281,8 +281,6 @@ SvXMLNumFmtExport::SvXMLNumFmtExport( SvXMLNumFmtExport::~SvXMLNumFmtExport() { - delete pLocaleData; - delete pCharClass; } // helper methods |