[Libreoffice-commits] core.git: vcl/osx

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Sep 9 18:42:33 UTC 2021


 vcl/osx/salnativewidgets.cxx |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 905d7e3d9cff386a819faa6582cfb1700b529e34
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Sep 9 16:05:23 2021 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Sep 9 20:41:58 2021 +0200

    tdf#144241 don't return a negative width for osx edit region
    
    instead expand the region to the min osx width
    
    Change-Id: I01dc336c97ba9573948e1ca8f3eeb3ac46008819
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/121857
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 5988cfe6a9d0..282a26ca0c60 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -994,13 +994,15 @@ bool AquaSalGraphics::getNativeControlRegion(ControlType nType,
             break;
         case ControlType::Editbox:
             {
-                w = aCtrlBoundRect.GetWidth();
+                const tools::Long nBorderThickness = FOCUS_RING_WIDTH + EDITBOX_BORDER_WIDTH + EDITBOX_INSET_MARGIN;
+                // tdf#144241 don't return a negative width, expand the region to the min osx width
+                w = std::max(nBorderThickness * 2, aCtrlBoundRect.GetWidth());
                 h = EDITBOX_HEIGHT + 2 * FOCUS_RING_WIDTH;
                 rNativeBoundingRegion = tools::Rectangle(Point(x, y), Size(w, h));
-                w -= 2 * (FOCUS_RING_WIDTH + EDITBOX_BORDER_WIDTH + EDITBOX_INSET_MARGIN);
-                h -= 2 * (FOCUS_RING_WIDTH + EDITBOX_BORDER_WIDTH + EDITBOX_INSET_MARGIN);
-                x += FOCUS_RING_WIDTH + EDITBOX_BORDER_WIDTH + EDITBOX_INSET_MARGIN;
-                y += FOCUS_RING_WIDTH + EDITBOX_BORDER_WIDTH + EDITBOX_INSET_MARGIN;
+                w -= 2 * nBorderThickness;
+                h -= 2 * nBorderThickness;
+                x += nBorderThickness;
+                y += nBorderThickness;
                 rNativeContentRegion = tools::Rectangle(Point(x, y), Size(w, h));
                 toReturn = true;
             }


More information about the Libreoffice-commits mailing list