From 059f07f9f33460c809a93e0fda1165f5c6f6d805 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Wed, 15 Apr 2020 18:34:58 +0200 Subject: fixes for code creating reversed Rectangles ie. where left > right or top > bottom These are all places where the code is self-evidently doing the wrong thing. Found by adding asserts to tools::Rectangle. In theory, this is legit, and code that wants a proper Rectangle is supposed to be first call Justify on a Rectangle, but lots of places don't do that, and that seems very dodgy to me. So lets work towards Rectangles always being in a valid state. Change-Id: I03296a624bd9b5b193e6aa8778addfb09708cdc7 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92310 Tested-by: Jenkins Reviewed-by: Noel Grandin --- svtools/source/control/ruler.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'svtools') diff --git a/svtools/source/control/ruler.cxx b/svtools/source/control/ruler.cxx index a4f30d9c97a7..8608adc3b7fc 100644 --- a/svtools/source/control/ruler.cxx +++ b/svtools/source/control/ruler.cxx @@ -594,8 +594,8 @@ void Ruler::ImplDrawTicks(vcl::RenderContext& rRenderContext, long nMin, long nM if (nMin < nHorizontalLocation && nHorizontalLocation < nMax) { - ImplVDrawRect(rRenderContext, nHorizontalLocation, nBottom, nHorizontalLocation + DPIOffset, nBottom - 1 * nScale); - ImplVDrawRect(rRenderContext, nHorizontalLocation, nTop, nHorizontalLocation + DPIOffset, nTop + 1 * nScale); + ImplVDrawRect(rRenderContext, nHorizontalLocation, nBottom - 1 * nScale, nHorizontalLocation + DPIOffset, nBottom); + ImplVDrawRect(rRenderContext, nHorizontalLocation, nTop, nHorizontalLocation + DPIOffset, nTop + 1 * nScale); } nHorizontalLocation = nStart - n; -- cgit