diff options
author | Wang Lei <leiw@apache.org> | 2012-06-21 06:33:26 +0000 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2013-03-13 09:18:51 +0100 |
commit | c26bae0b168acaa5702be43a9748457f5d0eafa0 (patch) | |
tree | c9884eed3ea125327e846b9399c139894f682dbc /svl | |
parent | 8722f0e7ef690205d042c8a6b1fdf342a34ecbe1 (diff) |
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@bluewin.ch>
Conflicts:
svl/source/numbers/zformat.cxx
Change-Id: I1112739fb27939a66d22f198ec9c3a34f383bd9c
Diffstat (limited to 'svl')
-rw-r--r-- | svl/source/numbers/zformat.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 94fa2c085959..45c1f29ae3e3 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, 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 @@ short SvNumberformat::ImpNextSymbol(OUStringBuffer& rString, } break; case SsGetString: - if (cToken == ';') + if (cToken == ';' && (nPos>=2) && !IsSingleSymbol(rString, nPos-2)) { eState = SsStop; } |