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

Caolán McNamara caolanm at redhat.com
Thu Nov 7 18:04:47 CET 2013


 sw/source/ui/lingu/hhcwrp.cxx |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

New commits:
commit 9307b65407c1c50f3be8bbe5a664700e945a7efb
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Nov 7 16:59:04 2013 +0000

    safe STRING_MAXLEN -> -1 conversion
    
    Change-Id: If07e632e81e1fda98f587b3c34b009144126d7ef

diff --git a/sw/source/ui/lingu/hhcwrp.cxx b/sw/source/ui/lingu/hhcwrp.cxx
index 0b7d9ba..28e159a 100644
--- a/sw/source/ui/lingu/hhcwrp.cxx
+++ b/sw/source/ui/lingu/hhcwrp.cxx
@@ -603,7 +603,7 @@ void SwHHCWrapper::Convert()
             // not work. Thus since chinese conversion is not interactive we start
             // at the begin of the paragraph to solve the problem, i.e. have the
             // TextConversion service get those characters together in the same call.
-            xub_StrLen nStartIdx = STRING_MAXLEN;
+            sal_Int32 nStartIdx = -1;
             if (editeng::HangulHanjaConversion::IsChinese( GetSourceLanguage() ) )
                 nStartIdx = 0;
             else
@@ -618,11 +618,11 @@ void SwHHCWrapper::Convert()
                 if (aBoundary.startPos < aText.getLength() &&
                     aBoundary.startPos != aBoundary.endPos)
                 {
-                    nStartIdx = static_cast< xub_StrLen >(aBoundary.startPos );
+                    nStartIdx = aBoundary.startPos;
                 }
             }
 
-            if (STRING_MAXLEN != nStartIdx)
+            if (nStartIdx != -1)
                 *m_pConvArgs->pStartIdx = nStartIdx;
         }
     }


More information about the Libreoffice-commits mailing list