[Libreoffice-commits] core.git: include/tools tools/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 10 07:58:53 UTC 2019
include/tools/gen.hxx | 2 +-
tools/source/generic/gen.cxx | 9 +++++++++
2 files changed, 10 insertions(+), 1 deletion(-)
New commits:
commit 7554ec519c49782614f474109e1962dfbb392e95
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Jul 10 08:39:11 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Wed Jul 10 09:58:11 2019 +0200
make tools::Rectangle::AdjustBottom respect empty state
and make non-inline so it is easy to disable this for debugging, if need
be
Change-Id: I9a3f7a0356ab625681419f74af0b9884624f3642
Reviewed-on: https://gerrit.libreoffice.org/75336
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 e29726a5e305..ebe44840d964 100644
--- a/include/tools/gen.hxx
+++ b/include/tools/gen.hxx
@@ -411,7 +411,7 @@ public:
long AdjustLeft( long nHorzMoveDelta ) { nLeft += nHorzMoveDelta; return nLeft; }
long AdjustRight( long nHorzMoveDelta );
long AdjustTop( long nVertMoveDelta ) { nTop += nVertMoveDelta; return nTop; }
- long AdjustBottom( long nVertMoveDelta ) { nBottom += nVertMoveDelta; return nBottom; }
+ long AdjustBottom( long nVertMoveDelta );
inline void SetPos( const Point& rPoint );
void SetSize( const Size& rSize );
inline Size GetSize() const;
diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx
index d298e6be4c77..021e421c3b80 100644
--- a/tools/source/generic/gen.cxx
+++ b/tools/source/generic/gen.cxx
@@ -266,5 +266,14 @@ long tools::Rectangle::AdjustRight(long nHorzMoveDelta)
return nRight;
}
+long tools::Rectangle::AdjustBottom( long nVertMoveDelta )
+{
+ if (nBottom == RECT_EMPTY)
+ nBottom = nTop + nVertMoveDelta - 1;
+ else
+ nBottom += nVertMoveDelta;
+ return nBottom;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
More information about the Libreoffice-commits
mailing list