Kaydet (Commit) 208f91ed authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:useuniqueptr in SwTOXInternational

Change-Id: I6d0687f2dbfc1b3d168440c7192ddaf7869ef58d
Reviewed-on: https://gerrit.libreoffice.org/57199
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 62cf9b47
...@@ -69,8 +69,8 @@ struct TextAndReading ...@@ -69,8 +69,8 @@ struct TextAndReading
class SwTOXInternational class SwTOXInternational
{ {
IndexEntrySupplierWrapper* m_pIndexWrapper; std::unique_ptr<IndexEntrySupplierWrapper> m_pIndexWrapper;
CharClass* m_pCharClass; std::unique_ptr<CharClass> m_pCharClass;
LanguageType m_eLang; LanguageType m_eLang;
OUString m_sSortAlgorithm; OUString m_sSortAlgorithm;
SwTOIOptions m_nOptions; SwTOIOptions m_nOptions;
......
...@@ -69,7 +69,7 @@ SwTOXInternational::SwTOXInternational( const SwTOXInternational& rIntl ) : ...@@ -69,7 +69,7 @@ SwTOXInternational::SwTOXInternational( const SwTOXInternational& rIntl ) :
void SwTOXInternational::Init() void SwTOXInternational::Init()
{ {
m_pIndexWrapper = new IndexEntrySupplierWrapper(); m_pIndexWrapper.reset( new IndexEntrySupplierWrapper() );
const lang::Locale aLcl( LanguageTag::convertToLocale( m_eLang ) ); const lang::Locale aLcl( LanguageTag::convertToLocale( m_eLang ) );
m_pIndexWrapper->SetLocale( aLcl ); m_pIndexWrapper->SetLocale( aLcl );
...@@ -86,14 +86,14 @@ void SwTOXInternational::Init() ...@@ -86,14 +86,14 @@ void SwTOXInternational::Init()
else else
m_pIndexWrapper->LoadAlgorithm( aLcl, m_sSortAlgorithm, SW_COLLATOR_IGNORES ); m_pIndexWrapper->LoadAlgorithm( aLcl, m_sSortAlgorithm, SW_COLLATOR_IGNORES );
m_pCharClass = new CharClass( LanguageTag( aLcl )); m_pCharClass.reset( new CharClass( LanguageTag( aLcl )) );
} }
SwTOXInternational::~SwTOXInternational() SwTOXInternational::~SwTOXInternational()
{ {
delete m_pCharClass; m_pCharClass.reset();
delete m_pIndexWrapper; m_pIndexWrapper.reset();
} }
OUString SwTOXInternational::ToUpper( const OUString& rStr, sal_Int32 nPos ) const OUString SwTOXInternational::ToUpper( const OUString& rStr, sal_Int32 nPos ) const
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment