[Libreoffice-commits] core.git: sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Jan 18 13:39:32 UTC 2019


 sw/source/core/txtnode/txtedt.cxx |    7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

New commits:
commit 59a8d22cf3073e240899872b7dc193ddd4d19ef4
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Thu Jan 17 15:21:50 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Jan 18 14:39:03 2019 +0100

    use unique_ptr in SwTextNode
    
    Change-Id: I4962d3480e9318c02d5cb8f031c0fcb1ab19208d
    Reviewed-on: https://gerrit.libreoffice.org/66570
    Reviewed-by: Ashod Nakashian <ashnakash at gmail.com>
    Tested-by: Jenkins

diff --git a/sw/source/core/txtnode/txtedt.cxx b/sw/source/core/txtnode/txtedt.cxx
index e09675f38dd2..358669f3fba6 100644
--- a/sw/source/core/txtnode/txtedt.cxx
+++ b/sw/source/core/txtnode/txtedt.cxx
@@ -1893,11 +1893,9 @@ void SwTextNode::TransliterateText(
         {
             // here we may transliterate over complete language portions...
 
-            SwLanguageIterator* pIter;
+            std::unique_ptr<SwLanguageIterator> pIter;
             if( rTrans.needLanguageForTheMode() )
-                pIter = new SwLanguageIterator( *this, nStt );
-            else
-                pIter = nullptr;
+                pIter.reset(new SwLanguageIterator( *this, nStt ));
 
             sal_Int32 nEndPos = 0;
             LanguageType nLang = LANGUAGE_NONE;
@@ -1934,7 +1932,6 @@ void SwTextNode::TransliterateText(
 
                 nStt = nEndPos;
             } while( nEndPos < nEnd && pIter && pIter->Next() );
-            delete pIter;
         }
 
         if (!aChanges.empty())


More information about the Libreoffice-commits mailing list