Resolves: tdf#148336 portion width can be zero

Change-Id: I9dcbf024882a0ca055d1847345ab2b8084d5871d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132510
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
diff --git a/sw/source/core/txtnode/fntcache.cxx b/sw/source/core/txtnode/fntcache.cxx
index e1c33c8..e400993 100644
--- a/sw/source/core/txtnode/fntcache.cxx
+++ b/sw/source/core/txtnode/fntcache.cxx
@@ -2001,11 +2001,12 @@ Size SwFntObj::GetTextSize( SwDrawTextInfo& rInf )
    else
        rInf.SetKanaDiff( 0 );

    aTextSize.setWidth(aKernArray[sal_Int32(nLn) - 1]);


    if ( rInf.GetKern() && nLn )
        aTextSize.AdjustWidth((sal_Int32(nLn) - 1) * rInf.GetKern());
    if (nLn)
    {
        aTextSize.setWidth(aKernArray[sal_Int32(nLn) - 1]);
        if (rInf.GetKern())
            aTextSize.AdjustWidth((sal_Int32(nLn) - 1) * rInf.GetKern());
    }

    OSL_ENSURE( !rInf.GetShell() ||
            ( USHRT_MAX != GetGuessedLeading() && USHRT_MAX != GetExternalLeading() ),