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

Caolán McNamara caolanm at redhat.com
Mon Apr 3 15:05:51 UTC 2017


 sw/source/filter/ww8/ww8par.cxx |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

New commits:
commit 8c52dca558fc046db7480c7e483ba206b1b4df47
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 3 16:01:38 2017 +0100

    only convert used part of buffer
    
    Change-Id: I133a02ae1cbdb4fb32f81db7214d27c66ccd0a8b

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 3de315055bee..29aa054ad05a 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3118,7 +3118,7 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp
 
         if (m_bRegardHindiDigits && m_bBidi && LangUsesHindiNumbers(nCTLLang))
         {
-            for (sal_Int32 nI = 0; nI < nStrLen; ++nI, ++pBuffer)
+            for (sal_Int32 nI = 0; nI < nEndUsed; ++nI, ++pBuffer)
                 *pBuffer = TranslateToHindiNumbers(*pBuffer);
         }
 
commit 9b3685789b83ad052eb61bd909e37804ed00b76f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Apr 3 15:59:44 2017 +0100

    don't check on every loop
    
    Change-Id: I000a887925db63b5717cc0d062d9da623415f7cc

diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index eb75ce5f0413..3de315055bee 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -3116,9 +3116,11 @@ bool SwWW8ImplReader::ReadPlainChars(WW8_CP& rPos, sal_Int32 nEnd, sal_Int32 nCp
             ? Custom8BitToUnicode(hConverter, p8Bits, nL2, pBuffer, nStrLen)
             : nL2;
 
-        for( sal_Int32 nI = 0; nI < nStrLen; ++nI, ++pBuffer )
-            if (m_bRegardHindiDigits && m_bBidi && LangUsesHindiNumbers(nCTLLang))
+        if (m_bRegardHindiDigits && m_bBidi && LangUsesHindiNumbers(nCTLLang))
+        {
+            for (sal_Int32 nI = 0; nI < nStrLen; ++nI, ++pBuffer)
                 *pBuffer = TranslateToHindiNumbers(*pBuffer);
+        }
 
         pStr->buffer[nEndUsed] = 0;
         pStr->length = nEndUsed;


More information about the Libreoffice-commits mailing list