From 3beb146b34fa931e2d63f4738a3ae69fe286545f Mon Sep 17 00:00:00 2001 From: Laurent Balland-Poirier Date: Sat, 30 Apr 2016 21:44:29 +0200 Subject: tdf#31449 Correctly test if fraction has no integer part Test if fraction format has no integer part is modified to take into account all cases: ??/?? or ##/## and do not detect false positive like ? ??/?? Change-Id: Ia8677a5ad496e5df56ce6bf1290323555e46ba0a Reviewed-on: https://gerrit.libreoffice.org/24540 Tested-by: Jenkins Reviewed-by: Eike Rathke Tested-by: Eike Rathke --- svl/source/numbers/zformat.cxx | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'svl') diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx index 935176bdca5d..8da58b524b61 100644 --- a/svl/source/numbers/zformat.cxx +++ b/svl/source/numbers/zformat.cxx @@ -5059,6 +5059,16 @@ sal_Int32 SvNumberformat::GetQuoteEnd( const OUString& rStr, sal_Int32 nPos, return nLen; // End of String } +sal_uInt16 SvNumberformat::GetNumForNumberElementCount( sal_uInt16 nNumFor ) const +{ + if ( nNumFor < 4 ) + { + sal_uInt16 nAnz = NumFor[nNumFor].GetCount(); + return nAnz - ImpGetNumForStringElementCount( nNumFor ); + } + return 0; +} + sal_uInt16 SvNumberformat::ImpGetNumForStringElementCount( sal_uInt16 nNumFor ) const { sal_uInt16 nCnt = 0; -- cgit