diff options
author | Caolán McNamara <caolanm@redhat.com> | 2021-09-09 16:05:23 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2021-09-09 20:41:58 +0200 |
commit | 905d7e3d9cff386a819faa6582cfb1700b529e34 (patch) | |
tree | 9823411b21a2f7ada65ab359ec302e02099c2a3f /vcl/osx | |
parent | 6c50c2dd15da5e9f4a96b8bae1d337a52c71121f (diff) |
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@redhat.com>
Diffstat (limited to 'vcl/osx')
-rw-r--r-- | vcl/osx/salnativewidgets.cxx | 12 |
1 files changed, 7 insertions, 5 deletions
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; } |