[PATCH libreoffice-4-0] Resolves: #i119943 Underline can not work with "; " in format...

Fridrich Strba (via Code Review) gerrit at gerrit.libreoffice.org
Wed Mar 13 01:31:41 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2694

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/94/2694/1

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)
---
M svl/source/numbers/zformat.cxx
1 file changed, 17 insertions(+), 1 deletion(-)



diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index b9dfc17..1a6e05a 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -1292,6 +1292,22 @@
     return sal_Unicode(c);
 }
 
+bool IsSingleSymbol(OUStringBuffer& rStringBuffer, xub_StrLen 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 @@
             }
             break;
         case SsGetString:
-            if (cToken == ';')
+            if (cToken == ';' && (nPos>=2) && !IsSingleSymbol(rString, nPos-2))
             {
                 eState = SsStop;
             }

-- 
To view, visit https://gerrit.libreoffice.org/2694
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1112739fb27939a66d22f198ec9c3a34f383bd9c
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Fridrich Strba <fridrich at documentfoundation.org>



More information about the LibreOffice mailing list