tdf#100122 Correctly treat fraction without integer part

If there is no integer part (with format such as ?/?):
- sStr should be skiped
- SFrac should be completed with the right number of ?,
  j==0 must also be treated in ImpNumberFill

Change-Id: I57448eb3b0c68e10779d7fa565379e2604f7f63b
Reviewed-on: https://gerrit.libreoffice.org/25612
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
diff --git a/svl/source/numbers/zformat.cxx b/svl/source/numbers/zformat.cxx
index 172f8021..a80fc53 100644
--- a/svl/source/numbers/zformat.cxx
+++ b/svl/source/numbers/zformat.cxx
@@ -2718,16 +2718,14 @@ bool SvNumberformat::ImpGetFractionOutput(double fNumber,
    else
    {
        bRes |= ImpNumberFill(sFrac, fNumber, k, j, nIx, NF_SYMBOLTYPE_FRACBLANK);
        bCont = false;  // there is no main number?
        if (rInfo.nTypeArray[j] == NF_SYMBOLTYPE_FRACBLANK)
        {
            sFrac.insert(0, rInfo.sStrArray[j]);
            if ( j )
            {
                j--;
            }
            else
            {
                bCont = false;
                bCont = true;  // Yes, there is a main number
            }
        }
    }
@@ -4318,6 +4316,7 @@ bool SvNumberformat::ImpNumberFill( OUStringBuffer& sBuff, // number string
                                    short eSymbolType )    // type of stop condition
{
    bool bRes = false;
    bool bStop = false;
    const ImpSvNumberformatInfo& rInfo = NumFor[nIx].Info();
    // no normal thousands separators if number divided by thousands
    bool bDoThousands = (rInfo.nThousand == 0);
@@ -4325,7 +4324,7 @@ bool SvNumberformat::ImpNumberFill( OUStringBuffer& sBuff, // number string

    k = sBuff.getLength(); // behind last digit

    while (j > 0 && (nType = rInfo.nTypeArray[j]) != eSymbolType ) // Backwards
    while (!bStop && (nType = rInfo.nTypeArray[j]) != eSymbolType ) // Backwards
    {
        switch ( nType )
        {
@@ -4400,7 +4399,10 @@ bool SvNumberformat::ImpNumberFill( OUStringBuffer& sBuff, // number string
            sBuff.insert(k, rInfo.sStrArray[j]);
            break;
        } // of switch
        j--; // Next String
        if ( j )
            j--; // Next String
        else
            bStop = true;
    } // of while
    return bRes;
}