summaryrefslogtreecommitdiff
path: root/xmloff/source
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2015-10-28 16:17:23 +0100
committerEike Rathke <erack@redhat.com>2015-11-04 10:36:01 +0000
commit3f970cf247ad96d1663462acb0be7f1c767d1ebf (patch)
tree1253cfc66b6cadb55f8571ac9cd7dad3ca8e542c /xmloff/source
parentbdffd36de86d37124fb49d8cadea8b5e03c1bf34 (diff)
tdf#93296 dashes in decimal part => 0 min decimal places
During import, as well during export, "0.--" must be considered as 0 min decimal places Change-Id: I33d06dd95c0678660bc0bb222972f82ef54f2c6e Reviewed-on: https://gerrit.libreoffice.org/19647 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'xmloff/source')
-rw-r--r--xmloff/source/style/xmlnumfe.cxx3
-rw-r--r--xmloff/source/style/xmlnumfi.cxx2
2 files changed, 4 insertions, 1 deletions
diff --git a/xmloff/source/style/xmlnumfe.cxx b/xmloff/source/style/xmlnumfe.cxx
index 2d6043d0d54a..6801d3c05fbf 100644
--- a/xmloff/source/style/xmlnumfe.cxx
+++ b/xmloff/source/style/xmlnumfe.cxx
@@ -1201,7 +1201,10 @@ void SvXMLNumFmtExport::ExportPart_Impl( const SvNumberformat& rFormat, sal_uInt
if ( bExpFound && pElemStr )
nExpDigits += pElemStr->getLength();
else if ( !bDecDashes && pElemStr && (*pElemStr)[0] == '-' )
+ {
bDecDashes = true;
+ nMinDecimals = 0;
+ }
else if ( !bInInteger && pElemStr )
{
for ( sal_Int32 i = pElemStr->getLength()-1; i >= 0 && (*pElemStr)[i] == '#'; i-- )
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index eca9301e83c5..c375a78824ef 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1006,7 +1006,7 @@ SvXMLNumFmtElementContext::SvXMLNumFmtElementContext( SvXMLImport& rImport,
}
if ( aNumInfo.nMinDecimalDigits == -1)
{
- if ( bVarDecimals )
+ if ( bVarDecimals || aNumInfo.bDecReplace )
aNumInfo.nMinDecimalDigits = 0;
else
aNumInfo.nMinDecimalDigits = aNumInfo.nDecimals;