[Libreoffice-commits] core.git: Branch 'libreoffice-4-0' - svl/source

Wang Lei leiw at apache.org
Wed Mar 13 03:29:17 PDT 2013


 svl/source/numbers/zformat.cxx |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 6e392dcccd1cd519dd84a084fb538e01a1959d0b
Author: Wang Lei <leiw at apache.org>
Date:   Thu Jun 21 06:33:26 2012 +0000

    Resolves: #i119943 Underline can not work with ";" in format code
    
    the semicolon will always be regarded as separator
    
    Patch by: Zhang Lu
    Review by: Wang Lei(cherry picked from commit 953b282dbb2552f89ec25455ec838f752abd6a2d)
    
    Conflicts:
    	svl/source/numbers/zformat.cxx
    
    Resolves: #i119943 Underline can not work with ";" in format code
    
    the semicolon will always be regarded as separator
    
    Patch by: Zhang Lu
    Review by: Wang Lei(cherry picked from commit 423e8bc4e684a0790765aa2898bc2843538bc114)
    
    Signed-off-by: Fridrich Å trba <fridrich.strba at bluewin.ch>
    
    Conflicts:
    	svl/source/numbers/zformat.cxx
    
    Change-Id: I1112739fb27939a66d22f198ec9c3a34f383bd9c
    (cherry picked from commit c26bae0b168acaa5702be43a9748457f5d0eafa0)
    Reviewed-on: https://gerrit.libreoffice.org/2694
    Reviewed-by: Tor Lillqvist <tml at iki.fi>
    Tested-by: Tor Lillqvist <tml at iki.fi>

diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index b9dfc17..3aeb686 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1292,6 +1292,22 @@ sal_Unicode toUniChar(sal_uInt8 n)
     return sal_Unicode(c);
 }
 
+bool IsSingleSymbol(OUStringBuffer& rStringBuffer, sal_Int32 nPos)
+{
+    bool ret = false;
+    while(nPos > 0)
+    {
+        if(rStringBuffer[nPos] == '*' || rStringBuffer[nPos] == '\\' || rStringBuffer[nPos] == '_')
+        {
+            ret = !ret;
+            nPos--;
+        }
+        else
+            return ret;
+    }
+    return ret;
+}
+
 } // namespace
 
 OUString SvNumberformat::LocaleType::generateCode() const
@@ -1540,7 +1556,7 @@ short SvNumberformat::ImpNextSymbol(OUStringBuffer& rString,
             }
             break;
         case SsGetString:
-            if (cToken == ';')
+            if (cToken == ';' && (nPos>=2) && !IsSingleSymbol(rString, nPos-2))
             {
                 eState = SsStop;
             }


More information about the Libreoffice-commits mailing list