[Libreoffice-commits] core.git: include/tools tools/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 10 06:34:12 UTC 2019
include/tools/gen.hxx | 2 +-
tools/source/generic/gen.cxx | 8 ++++++++
2 files changed, 9 insertions(+), 1 deletion(-)
New commits:
commit ed0f690b93d478380366d96655a3efe5848c6737
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Tue Jul 9 14:51:19 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 10 08:33:25 2019 +0200
make tools::Rectangle::AdjustRight respect empty state
and make non-inline so it is easy to disable this for debugging, if need
be
Change-Id: I69c717be91712b73e9d3b8f9c83d26305c052bd5
Reviewed-on: https://gerrit.libreoffice.org/75300
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 897db7a25f79..e29726a5e305 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -409,7 +409,7 @@ public:
inline void Move( long nHorzMoveDelta, long nVertMoveDelta );
void Move( Size const & s ) { Move(s.Width(), s.Height()); }
long AdjustLeft( long nHorzMoveDelta ) { nLeft += nHorzMoveDelta; return nLeft; }
- long AdjustRight( long nHorzMoveDelta ) { nRight += nHorzMoveDelta; return nRight; }
+ long AdjustRight( long nHorzMoveDelta );
long AdjustTop( long nVertMoveDelta ) { nTop += nVertMoveDelta; return nTop; }
long AdjustBottom( long nVertMoveDelta ) { nBottom += nVertMoveDelta; return nBottom; }
inline void SetPos( const Point& rPoint );
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index 020be91ac3c0..d298e6be4c77 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -257,6 +257,14 @@ void tools::Rectangle::shrink(long nShrinkBy)
nBottom -= nShrinkBy;
}
+long tools::Rectangle::AdjustRight(long nHorzMoveDelta)
+{
+ if (nRight == RECT_EMPTY)
+ nRight = nLeft + nHorzMoveDelta - 1;
+ else
+ nRight += nHorzMoveDelta;
+ return nRight;
+}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list