[Libreoffice-commits] core.git: include/tools tools/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 10 11:47:37 UTC 2019
include/tools/gen.hxx | 2 +-
tools/source/generic/gen.cxx | 6 ++++++
2 files changed, 7 insertions(+), 1 deletion(-)
New commits:
commit 031d30bd698117e2bcdd0df76f8b669a1e366d2c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jul 10 12:32:15 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 10 13:46:55 2019 +0200
make tools::Rectangle::setY respect empty state
and make non-inline so it is easy to disable this for debugging, if need
be
Change-Id: I6feb94ca2f24246b96757575288c86c0b0c54227
Reviewed-on: https://gerrit.libreoffice.org/75342
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx
index 9dfab3a17019..54a438bfa161 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -461,7 +461,7 @@ public:
/// Set the left edge of the rectangle to x, preserving the width
void setX( long x );
/// Set the top edge of the rectangle to y, preserving the height
- void setY( long y ) { nBottom += y - nTop; nTop = y; }
+ void setY( long y );
void setWidth( long n ) { nRight = nLeft + n; }
void setHeight( long n ) { nBottom = nTop + n; }
/// Returns the string representation of the rectangle, format is "x, y, width, height".
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index db7980ea100a..1b9e4a0d733f 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -282,5 +282,11 @@ void tools::Rectangle::setX( long x )
nLeft = x;
}
+void tools::Rectangle::setY( long y )
+{
+ if (nBottom != RECT_EMPTY)
+ nBottom += y - nTop;
+ nTop = y;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list