summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-12 12:28:24 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-13 08:15:43 +0200
commit630db80d17616d635cf2e5f1d5a0852428b794a3 (patch)
tree956dcce67bd5836ce7a06357576d5398d359248c /vcl/unx
parent71eea07e1f888aea325aff2c07cd8fc6e8db4a8a (diff)
handle empty tools::Rectangle in vcl
Change-Id: I64b5c3c5a19408febe7753db6ea403b91f7f5c83 Reviewed-on: https://gerrit.libreoffice.org/72188 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx12
1 files changed, 8 insertions, 4 deletions
diff --git a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
index 51a83dd7705b..0de96d2be4ca 100644
--- a/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
+++ b/vcl/unx/gtk3/gtk3salnativewidgets-gtk.cxx
@@ -731,15 +731,19 @@ void GtkSalGraphics::PaintScrollbar(GtkStyleContext *context,
{
tools::Rectangle aBtn1Rect = NWGetScrollButtonRect(ControlPart::ButtonLeft, aTrackRect);
tools::Rectangle aBtn2Rect = NWGetScrollButtonRect(ControlPart::ButtonRight, aTrackRect);
- aTrackRect.SetLeft( aBtn1Rect.Right() );
- aTrackRect.SetRight( aBtn2Rect.Left() );
+ if (!aBtn1Rect.IsWidthEmpty())
+ aTrackRect.SetLeft( aBtn1Rect.Right() );
+ if (!aBtn2Rect.IsWidthEmpty())
+ aTrackRect.SetRight( aBtn2Rect.Left() );
}
else
{
tools::Rectangle aBtn1Rect = NWGetScrollButtonRect(ControlPart::ButtonUp, aTrackRect);
tools::Rectangle aBtn2Rect = NWGetScrollButtonRect(ControlPart::ButtonDown, aTrackRect);
- aTrackRect.SetTop( aBtn1Rect.Bottom() + 1 );
- aTrackRect.SetBottom( aBtn2Rect.Top() );
+ if (!aBtn1Rect.IsHeightEmpty())
+ aTrackRect.SetTop( aBtn1Rect.Bottom() + 1 );
+ if (!aBtn2Rect.IsHeightEmpty())
+ aTrackRect.SetBottom( aBtn2Rect.Top() );
}
GtkStyleContext* pScrollbarTroughStyle = scrollbarOrientation == GTK_ORIENTATION_VERTICAL ?