[Libreoffice-commits] core.git: tools/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 10 19:17:52 UTC 2019
tools/source/generic/gen.cxx | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
New commits:
commit bfdd98d214da77b4508bc7d2e9e31817471fe90c
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jul 10 12:38:49 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 10 21:17:01 2019 +0200
make tools::Rectangle::SaturatingSetX/Y respect empty state
Change-Id: Ifef4c2ff967fdfbe122bca99e55d84e8e6c6a635
Reviewed-on: https://gerrit.libreoffice.org/75343
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 1b9e4a0d733f..fc927f50e41e 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -88,13 +88,15 @@ void tools::Rectangle::SaturatingSetSize(const Size& rSize)
void tools::Rectangle::SaturatingSetX(long x)
{
- nRight = o3tl::saturating_add(nRight, x - nLeft);
+ if (nRight != RECT_EMPTY)
+ nRight = o3tl::saturating_add(nRight, x - nLeft);
nLeft = x;
}
void tools::Rectangle::SaturatingSetY(long y)
{
- nBottom = o3tl::saturating_add(nBottom, y - nTop);
+ if (nBottom != RECT_EMPTY)
+ nBottom = o3tl::saturating_add(nBottom, y - nTop);
nTop = y;
}
More information about the Libreoffice-commits
mailing list