diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-06 17:14:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-09-07 08:49:06 +0200 |
commit | 66c3c53d1951bed03173415d9bce1d7c1e5ac960 (patch) | |
tree | f1ed39b9db51b9fbb1876659ef3fe09b947439ab | |
parent | 9e17d32da3cec059f9f994d502ff67dbcbf3bb50 (diff) |
loplugin:useuniqueptr in ImpEditEngine::Convert
Change-Id: Iba910b17ca84e423e15b270fe109a2552d16cfba
Reviewed-on: https://gerrit.libreoffice.org/60116
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | editeng/source/editeng/impedit.hxx | 4 | ||||
-rw-r--r-- | editeng/source/editeng/impedit4.cxx | 5 |
2 files changed, 4 insertions, 5 deletions
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx index ab454ad703f1..5945e9d449f3 100644 --- a/editeng/source/editeng/impedit.hxx +++ b/editeng/source/editeng/impedit.hxx @@ -478,7 +478,7 @@ private: mutable css::uno::Reference < css::i18n::XBreakIterator > xBI; mutable css::uno::Reference < css::i18n::XExtendedInputSequenceChecker > xISC; - ConvInfo * pConvInfo; + std::unique_ptr<ConvInfo> pConvInfo; OUString aAutoCompleteText; @@ -957,7 +957,7 @@ public: void Convert( EditView* pEditView, LanguageType nSrcLang, LanguageType nDestLang, const vcl::Font *pDestFont, sal_Int32 nOptions, bool bIsInteractive, bool bMultipleDoc ); void ImpConvert( OUString &rConvTxt, LanguageType &rConvTxtLang, EditView* pEditView, LanguageType nSrcLang, const ESelection &rConvRange, bool bAllowImplicitChangesForNotConvertibleText, LanguageType nTargetLang, const vcl::Font *pTargetFont ); - ConvInfo * GetConvInfo() const { return pConvInfo; } + ConvInfo * GetConvInfo() const { return pConvInfo.get(); } bool HasConvertibleTextPortion( LanguageType nLang ); void SetLanguageAndFont( const ESelection &rESel, LanguageType nLang, sal_uInt16 nLangWhichId, diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx index 31b3cd6c4e3d..ec711845fade 100644 --- a/editeng/source/editeng/impedit4.cxx +++ b/editeng/source/editeng/impedit4.cxx @@ -1528,7 +1528,7 @@ void ImpEditEngine::Convert( EditView* pEditView, // initialize pConvInfo EditSelection aCurSel( pEditView->pImpEditView->GetEditSelection() ); aCurSel.Adjust( aEditDoc ); - pConvInfo = new ConvInfo; + pConvInfo.reset(new ConvInfo); pConvInfo->bMultipleDoc = bMultipleDoc; pConvInfo->aConvStart = CreateEPaM( aCurSel.Min() ); @@ -1595,8 +1595,7 @@ void ImpEditEngine::Convert( EditView* pEditView, pEditView->pImpEditView->DrawSelectionXOR(); pEditView->ShowCursor( true, false ); } - delete pConvInfo; - pConvInfo = nullptr; + pConvInfo.reset(); } |