XML number format: do not enquote space followed by minus, tdf#97837 follow-up
Which with [$kr.-406] #.##0,00;[RED][$kr.-406] -#.##0,00 saved and reloaded gave [$kr.-406] #.##0,00;[RED][$kr.-406]" -"#.##0,00 and thus an almost identical duplicated format with the built-in format. Change-Id: Ie39b97576842bc29ac301d2fe64f7331f6c57fc4
This commit is contained in:
@@ -811,14 +811,16 @@ static void lcl_EnquoteIfNecessary( OUStringBuffer& rContent, const SvXMLNumForm
|
|||||||
bool bQuote = true;
|
bool bQuote = true;
|
||||||
sal_Int32 nLength = rContent.getLength();
|
sal_Int32 nLength = rContent.getLength();
|
||||||
|
|
||||||
if ( ( nLength == 1 &&
|
if ((nLength == 1 && lcl_ValidChar( rContent[0], rParent)) ||
|
||||||
lcl_ValidChar( rContent[0], rParent ) ) ||
|
(nLength == 2 &&
|
||||||
( nLength == 2 &&
|
((rContent[0] == ' ' && rContent[1] == '-') ||
|
||||||
lcl_ValidChar( rContent[0], rParent ) &&
|
(rContent[1] == ' ' && lcl_ValidChar( rContent[0], rParent)))))
|
||||||
rContent[1] == ' ' ) )
|
|
||||||
{
|
{
|
||||||
// don't quote single separator characters like space or percent,
|
// Don't quote single separator characters like space or percent,
|
||||||
// or separator characters followed by space (used in date formats)
|
// or separator characters followed by space (used in date formats).
|
||||||
|
// Or space followed by minus (used in currency formats) that would
|
||||||
|
// lead to almost duplicated formats with built-in formats just with
|
||||||
|
// the difference of quotes.
|
||||||
bQuote = false;
|
bQuote = false;
|
||||||
}
|
}
|
||||||
else if ( rParent.GetType() == XML_TOK_STYLES_PERCENTAGE_STYLE && nLength > 1 )
|
else if ( rParent.GetType() == XML_TOK_STYLES_PERCENTAGE_STYLE && nLength > 1 )
|
||||||
|
Reference in New Issue
Block a user