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

Tamas Bunth tamas.bunth at collabora.co.uk
Mon Jun 11 08:42:42 UTC 2018


 dbaccess/source/filter/hsqldb/createparser.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 647a9fec404ebce898a44de63fcf1b1d6f5036e6
Author: Tamas Bunth <tamas.bunth at collabora.co.uk>
Date:   Mon Jun 11 07:59:28 2018 +0200

    tdf#117115 dbahsql: respect escaped '\'
    
    Change-Id: Id408f7a98011d806f01b6c63ae67008c4dba4b0d
    Reviewed-on: https://gerrit.libreoffice.org/55595
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Tamás Bunth <btomi96 at gmail.com>

diff --git a/dbaccess/source/filter/hsqldb/createparser.cxx b/dbaccess/source/filter/hsqldb/createparser.cxx
index 9054a2f9bf72..5b864f4231c6 100644
--- a/dbaccess/source/filter/hsqldb/createparser.cxx
+++ b/dbaccess/source/filter/hsqldb/createparser.cxx
@@ -50,15 +50,16 @@ sal_Int32 lcl_IndexOfUnicode(const OString& rSource, const sal_Int32 nFrom = 0)
 //Convert ascii escaped unicode to utf-8
 OUString lcl_ConvertToUTF8(const OString& rText)
 {
+    OString original = rText;
     OString sResult = rText;
     sal_Int32 nIndex = lcl_IndexOfUnicode(sResult);
     while (nIndex != -1 && nIndex < rText.getLength())
     {
-        const OString sHex = sResult.copy(nIndex + 2, 4);
+        const OString sHex = original.copy(nIndex + 2, 4);
         const sal_Unicode cDec = static_cast<sal_Unicode>(strtol(sHex.getStr(), nullptr, 16));
         const OString sNewChar = OString(&cDec, 1, RTL_TEXTENCODING_UTF8);
         sResult = sResult.replaceAll("\\u" + sHex, sNewChar);
-        nIndex = lcl_IndexOfUnicode(sResult, nIndex);
+        nIndex = lcl_IndexOfUnicode(original, nIndex + 1);
     }
     return OStringToOUString(sResult, RTL_TEXTENCODING_UTF8);
 }


More information about the Libreoffice-commits mailing list