summaryrefslogtreecommitdiff
path: root/xmloff/source/style/xmlnumfe.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'xmloff/source/style/xmlnumfe.cxx')
-rw-r--r--xmloff/source/style/xmlnumfe.cxx16
1 files changed, 14 insertions, 2 deletions
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 7f8a33e7fce5..3070831b1e40 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -1178,6 +1178,7 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
bool bCurrFound = false;
bool bInInteger = true;
bool bExpSign = true;
+ bool bDecAlign = false; // decimal alignment with "?"
sal_Int32 nExpDigits = 0;
sal_Int32 nIntegerSymbols = 0; // for embedded-text, including "#"
sal_Int32 nTrailingThousands = 0; // thousands-separators after all digits
@@ -1206,9 +1207,17 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
}
else if ( !bInInteger && pElemStr )
{
- for ( sal_Int32 i = pElemStr->getLength()-1; i >= 0 && (*pElemStr)[i] == '#'; i-- )
+ for ( sal_Int32 i = pElemStr->getLength()-1; i >= 0 ; i-- )
{
- nMinDecimals --;
+ sal_Unicode aChar = (*pElemStr)[i];
+ if ( aChar == '#' || aChar == '?' )
+ {
+ nMinDecimals --;
+ if ( aChar == '?' )
+ bDecAlign = true;
+ }
+ else
+ break;
}
}
if ( bInInteger && pElemStr )
@@ -1428,6 +1437,9 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
OUStringBuffer sDashStr;
if (bDecDashes && nPrecision > 0)
comphelper::string::padToLength(sDashStr, nPrecision, '-');
+ // "?" in decimal part are replaced by space character
+ if (bDecAlign && nPrecision > 0)
+ sDashStr = " ";
WriteNumberElement_Impl(nDecimals, nMinDecimals, nInteger, sDashStr.makeStringAndClear(),
bThousand, nTrailingThousands, aEmbeddedEntries);