incubator-ooo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From l...@apache.org
Subject svn commit: r1352434 - /incubator/ooo/trunk/main/svl/source/numbers/zformat.cxx
Date Thu, 21 Jun 2012 07:33:27 GMT
Author: leiw
Date: Thu Jun 21 07:33:26 2012
New Revision: 1352434

URL: http://svn.apache.org/viewvc?rev=1352434&view=rev
Log:
#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

Modified:
    incubator/ooo/trunk/main/svl/source/numbers/zformat.cxx

Modified: incubator/ooo/trunk/main/svl/source/numbers/zformat.cxx
URL: http://svn.apache.org/viewvc/incubator/ooo/trunk/main/svl/source/numbers/zformat.cxx?rev=1352434&r1=1352433&r2=1352434&view=diff
==============================================================================
--- incubator/ooo/trunk/main/svl/source/numbers/zformat.cxx (original)
+++ incubator/ooo/trunk/main/svl/source/numbers/zformat.cxx Thu Jun 21 07:33:26 2012
@@ -1134,6 +1134,18 @@ LanguageType SvNumberformat::ImpGetLangu
         LANGUAGE_DONTKNOW;
 }
 
+sal_Bool IsSingleSymbol(String& rString, xub_StrLen nPos){
+	sal_Bool ret = sal_False;
+	while(nPos > 0){
+		if(rString.GetChar(nPos) == '*' || rString.GetChar(nPos) == '\\' || rString.GetChar(nPos)
== '_'){
+			ret = !ret;
+			nPos--;
+		}
+		else
+			return ret;
+	}
+	return ret;
+}
 
 short SvNumberformat::ImpNextSymbol(String& rString,
                                  xub_StrLen& nPos,
@@ -1285,8 +1297,10 @@ short SvNumberformat::ImpNextSymbol(Stri
             break;
             case SsGetString:
             {
-                if (cToken == ';')
+                if (cToken == ';' && !IsSingleSymbol(rString, nPos-2))
+				{
                     eState = SsStop;
+				}
                 else
                     sSymbol += cToken;
             }



Mime
View raw message