summaryrefslogtreecommitdiff
path: root/xmloff/source/style
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2015-03-31 20:33:15 +0200
committerEike Rathke <erack@redhat.com>2015-04-01 13:27:00 +0000
commit15d00363bbf13f26f5de02f958923a80a4f652eb (patch)
tree2b1212a3ecefa42e85dca8c820fb0ec975464632 /xmloff/source/style
parent853d5f27d684436935ce489159d56468b27db3d9 (diff)
Engineering notation: Slight optimisation
Update of commit Ia18f9e150ca32aa9bbe133c082c3f9330e949f11 Change-Id: I5118619f2ab669f90e0377d9cabdba4778179581 Reviewed-on: https://gerrit.libreoffice.org/15100 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'xmloff/source/style')
-rw-r--r--xmloff/source/style/xmlnumfi.cxx10
1 files changed, 4 insertions, 6 deletions
diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx
index f0f67c429e2a..f7b9e824d3f0 100644
--- a/xmloff/source/style/xmlnumfi.cxx
+++ b/xmloff/source/style/xmlnumfi.cxx
@@ -1230,7 +1230,7 @@ void SvXMLNumFmtElementContext::EndElement()
// exponential interval for engineering notation
if( !aNumInfo.bGrouping && aNumInfo.nExpInterval > aNumInfo.nInteger )
{
- for (sal_Int32 i=0; i<aNumInfo.nExpInterval-aNumInfo.nInteger; i++)
+ for (sal_Int32 i=aNumInfo.nInteger; i<aNumInfo.nExpInterval; i++)
{
rParent.AddToCode( '#' );
}
@@ -1825,12 +1825,10 @@ void SvXMLNumFormatContext::AddNumber( const SvXMLNumberInfo& rInfo )
else
nIndex = -1;
}
- if( rInfo.nExpInterval > nDigits )
+ while ( rInfo.nExpInterval > nDigits )
{
- for (sal_Int32 i=0; i<rInfo.nExpInterval-nDigits; i++)
- {
- aNumStr.insert( 0, '#' );
- }
+ nDigits++;
+ aNumStr.insert( 0, '#' );
}
}