[Libreoffice-commits] .: svl/source
Katarina Machalkova
bubli at kemper.freedesktop.org
Thu Jul 28 06:12:57 PDT 2011
svl/source/numbers/zformat.cxx | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 10e028a9ea7e925f785558eca3fb4076fd689617
Author: Katarina Machalkova <kmachalkova at suse.cz>
Date: Thu Jul 28 14:50:24 2011 +0200
Don't delete valid [$.*] components of number formats
... such as [RED], [NatNumX] etc.
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index cfc9169..b567c20 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -636,6 +636,7 @@ SvNumberformat::SvNumberformat(String& rString,
sal_Bool bCancel = sal_False;
sal_Bool bCondition = sal_False;
+ sal_Bool bHasValidBracketPrefix = sal_False;
short eSymbolType;
xub_StrLen nPos = 0;
xub_StrLen nPosOld;
@@ -727,6 +728,8 @@ SvNumberformat::SvNumberformat(String& rString,
bCancel = sal_True; // break for
nCheckPos = nPosOld;
}
+ else
+ bHasValidBracketPrefix = sal_True;
}
}
break;
@@ -763,6 +766,7 @@ SvNumberformat::SvNumberformat(String& rString,
sal_uInt8 nNum = sal::static_int_cast< sal_uInt8 >(0 - (eSymbolType - BRACKET_SYMBOLTYPE_NATNUM0));
sStr += String::CreateFromInt32( nNum );
NumFor[nIndex].SetNatNumNum( nNum, sal_False );
+ bHasValidBracketPrefix = sal_True;
}
}
break;
@@ -788,6 +792,7 @@ SvNumberformat::SvNumberformat(String& rString,
sal_uInt8 nNum = sal::static_int_cast< sal_uInt8 >(1 - (eSymbolType - BRACKET_SYMBOLTYPE_DBNUM1));
sStr += static_cast< sal_Unicode >('0' + nNum);
NumFor[nIndex].SetNatNumNum( nNum, sal_True );
+ bHasValidBracketPrefix = sal_True;
}
}
break;
@@ -812,6 +817,7 @@ SvNumberformat::SvNumberformat(String& rString,
sStr.AssignAscii( RTL_CONSTASCII_STRINGPARAM("$-") );
sStr = sStr + maLocale.generateCode();
NumFor[nIndex].SetNatNumLang(maLocale.meLanguage);
+ bHasValidBracketPrefix = sal_True;
}
}
}
@@ -820,7 +826,7 @@ SvNumberformat::SvNumberformat(String& rString,
if ( !bCancel )
{
rString.Erase(nPosOld,nPos-nPosOld);
- if (maLocale.meLanguage != 0)
+ if ( bHasValidBracketPrefix )
{
rString.Insert(sStr,nPosOld);
nPos = nPosOld + sStr.Len();
More information about the Libreoffice-commits
mailing list