[Libreoffice-commits] core.git: cui/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 17 21:07:18 UTC 2018


 cui/source/tabpages/numfmt.cxx |   13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

New commits:
commit b9505d6be5ff62930ec68a1baeb7c4bcf01442a4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Mon Dec 17 17:42:09 2018 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Mon Dec 17 22:06:56 2018 +0100

    Related: tdf#122120 left align text if preview won't fit
    
    in the number format page
    
    Change-Id: Ic398e5302ee54dfd437e07fdf892269e6eefd8fa
    Reviewed-on: https://gerrit.libreoffice.org/65284
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/tabpages/numfmt.cxx b/cui/source/tabpages/numfmt.cxx
index 46b3279b3a18..79430d39afc0 100644
--- a/cui/source/tabpages/numfmt.cxx
+++ b/cui/source/tabpages/numfmt.cxx
@@ -168,8 +168,17 @@ void SvxNumberPreview::Paint(vcl::RenderContext& rRenderContext, const ::tools::
                 aTmpStr = aTmpStr.replaceAt(mnPos, 0, OUString(mnChar));
         }
     }
-    Point aPosText = Point((mnPos != -1) ? 0 : nLeadSpace,
-                           (aSzWnd.Height() - GetTextHeight()) / 2);
+    long nX;
+    if (mnPos != -1)
+        nX = 0;
+    else
+    {
+        //tdf#122120 if it won't fit anyway, then left align it
+        if (nLeadSpace > 0)
+            nX = nLeadSpace;
+        nX = 0;
+    }
+    Point aPosText = Point(nX, (aSzWnd.Height() - GetTextHeight()) / 2);
     rRenderContext.DrawText(aPosText, aTmpStr);
     rRenderContext.Pop();
 }


More information about the Libreoffice-commits mailing list