editeng/source/editeng/impedit.hxx | 4 ++-- editeng/source/editeng/impedit4.cxx | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-)
New commits: commit 66c3c53d1951bed03173415d9bce1d7c1e5ac960 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Sep 6 17:14:53 2018 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Fri Sep 7 08:49:06 2018 +0200 loplugin:useuniqueptr in ImpEditEngine::Convert Change-Id: Iba910b17ca84e423e15b270fe109a2552d16cfba Reviewed-on: https://gerrit.libreoffice.org/60116 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> 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(); } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits