Bug-Ubuntu: https://bugs.launchpad.net/allston/+bug/1111345
Applied-Upstream: http://cgit.freedesktop.org/libreoffice/core/commit/?id=0cd1ae1f9b85261e6915471938c5f6c3e0ec9283
From 359f3ed8b4b872ab73e66084dbf198ccb7e19cb6 Mon Sep 17 00:00:00 2001
From: Noel Power <noel.power@suse.com>
Date: Tue, 13 Nov 2012 16:30:07 +0000
Subject: [PATCH 1/1] 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>
---
 svl/source/numbers/zforscan.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/svl/source/numbers/zforscan.cxx b/svl/source/numbers/zforscan.cxx
index 3c7074a..30fe6d7 100644
--- a/svl/source/numbers/zforscan.cxx
+++ b/svl/source/numbers/zforscan.cxx
@@ -1607,7 +1607,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++;
                         }
                     }
-- 
1.7.10.4

