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;
}