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

Caolán McNamara caolanm at redhat.com
Tue Jun 26 19:38:50 UTC 2018


 sw/source/core/text/itradj.cxx |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 9dea10a6f7ef94c5ff77bc7dfe15e862dd0f7be6
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 26 12:45:19 2018 +0100

    can use simple vector here
    
    Change-Id: Ia1565a946f9ac6d607fb6802b19e561fc9afc66d
    Reviewed-on: https://gerrit.libreoffice.org/56466
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 76e115318422..02348195c5b5 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -132,9 +132,9 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
 
     // kashida positions found in SwScriptInfo are not necessarily valid in every font
     // if two characters are replaced by a ligature glyph, there will be no place for a kashida
-    std::unique_ptr<TextFrameIndex[]> pKashidaPos(new TextFrameIndex[rKashidas]);
-    std::unique_ptr<TextFrameIndex[]> pKashidaPosDropped(new TextFrameIndex[rKashidas]);
-    rSI.GetKashidaPositions ( nIdx, rItr.GetLength(), pKashidaPos.get() );
+    std::vector<TextFrameIndex> aKashidaPos(rKashidas);
+    std::vector<TextFrameIndex> aKashidaPosDropped(rKashidas);
+    rSI.GetKashidaPositions(nIdx, rItr.GetLength(), aKashidaPos.data());
     sal_Int32 nKashidaIdx = 0;
     while ( rKashidas && nIdx < nEnd )
     {
@@ -165,12 +165,12 @@ static bool lcl_CheckKashidaPositions( SwScriptInfo& rSI, SwTextSizeInfo& rInf,
                 nKashidasDropped = rInf.GetOut()->ValidateKashidas(
                     rInf.GetText(), sal_Int32(nIdx), sal_Int32(nNext - nIdx),
                     nKashidasInAttr,
-                    reinterpret_cast<sal_Int32*>(pKashidaPos.get() + nKashidaIdx),
-                    reinterpret_cast<sal_Int32*>(pKashidaPosDropped.get()));
+                    reinterpret_cast<sal_Int32*>(aKashidaPos.data() + nKashidaIdx),
+                    reinterpret_cast<sal_Int32*>(aKashidaPosDropped.data()));
                 rInf.GetOut()->SetLayoutMode ( nOldLayout );
                 if ( nKashidasDropped )
                 {
-                    rSI.MarkKashidasInvalid(nKashidasDropped, pKashidaPosDropped.get());
+                    rSI.MarkKashidasInvalid(nKashidasDropped, aKashidaPosDropped.data());
                     rKashidas -= nKashidasDropped;
                     nGluePortion -= TextFrameIndex(nKashidasDropped);
                 }


More information about the Libreoffice-commits mailing list