summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-07-15 09:44:10 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-07-15 18:07:29 +0200
commit48480d4f19d2fb92ca4ae0527eec4753cdc439c0 (patch)
treeea84bf9c8867f69bd8dabf5a8ed6a9446b3f9d2e /tools
parent49c9b3723056addb0a443eaee71c8aacbdda4dc6 (diff)
make tools::Rectangle::getBottom return 0 when empty
LayoutConverter::calcAbsRectangle needed to be tweaked because we now end up with a zero width/height instead of a large negative number. Change-Id: I81f04759a1d5bf6f44753a1701596796fad40567 Reviewed-on: https://gerrit.libreoffice.org/75610 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/source/generic/gen.cxx7
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 5755929bd502..0a488a4e51b4 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -308,4 +308,11 @@ long tools::Rectangle::getWidth() const
{
return nRight == RECT_EMPTY ? 0 : nRight - nLeft;
}
+
+/// Returns the difference between bottom and top, assuming the range includes one end, but not the other.
+long tools::Rectangle::getHeight() const
+{
+ return nBottom == RECT_EMPTY ? 0 : nBottom - nTop;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */