summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Power <noel.power@suse.com>2012-11-13 16:30:07 +0000
committerEike Rathke <erack@redhat.com>2012-11-14 12:49:37 +0000
commit0cd1ae1f9b85261e6915471938c5f6c3e0ec9283 (patch)
tree2789e2e4e6c4f7b23856aad89b5a2a9a870fccbc
parentb537d0219f51c909f5409c8a0cee28cfc318c0f2 (diff)
don't always show integer part for fraction formats with hard denom fdo#56205
fixes bug when you have a fraction format with a forced denominator e.g. '?/5' which showed the integer part of the fraction ( as if the format was '# ?/5' ) but even without the space e.g. before fix pi 3.14159265358979 with format '?/8' would be shown as "31/8" after the fix 3.14159265358979 with format '?/8' would be shown as "25/8" Change-Id: I1feb8b78af94b90db1bcc30da248077243dd8dfc Reviewed-on: https://gerrit.libreoffice.org/1047 Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
-rw-r--r--svl/source/numbers/zforscan.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 4916ff2d0432..fb3649c424ea 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -1595,7 +1595,9 @@ xub_StrLen ImpSvNumberformatScan::FinalScan( String& rString )
nCounter = nCntPost;
else if (nCntPre)
nCounter = nCntPre;
- if (!nCntPre)
+ // don't artificially increment nCntPre
+ // for forced denominator
+ if ( ( eScannedType != NUMBERFORMAT_FRACTION ) && (!nCntPre) )
nCntPre++;
}
}