diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-15 10:48:53 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-02-15 12:53:09 +0100 |
commit | dd4fc3b1e3f8a7c69a44c26715b2e3cdb22aede9 (patch) | |
tree | 93e4202e3667d78b8b00930a238152c639bf7872 /include/tools/gen.hxx | |
parent | Find Java 9 with the new registry keys on Windows (diff) | |
download | core-dd4fc3b1e3f8a7c69a44c26715b2e3cdb22aede9.tar.gz core-dd4fc3b1e3f8a7c69a44c26715b2e3cdb22aede9.zip |
introduce Move/Adjust methods to Point,Rect,Size
to make my following changes with the changetoolsgen plugin easier to
read
Change-Id: I514bbea00b8907cc94c4218ca6ab1473bd9efd61
Reviewed-on: https://gerrit.libreoffice.org/49793
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include/tools/gen.hxx')
-rw-r--r-- | include/tools/gen.hxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/include/tools/gen.hxx b/include/tools/gen.hxx index 87e1e54b3eed..0e5289b0765c 100644 --- a/include/tools/gen.hxx +++ b/include/tools/gen.hxx @@ -82,6 +82,8 @@ public: long& Y() { return nB; } void Move( long nHorzMove, long nVertMove ); + void MoveX( long nHorzMove ) { nA += nHorzMove; } + void MoveY( long nVertMove ) { nB += nVertMove; } void RotateAround( long& rX, long& rY, short nOrientation ) const; @@ -191,6 +193,8 @@ public: long& Width() { return nA; } long& Height() { return nB; } + void AdjustWidth( long n ) { nA += n; } + void AdjustHeight( long n ) { nB += n; } long getWidth() const { return Width(); } long getHeight() const { return Height(); } @@ -400,6 +404,10 @@ public: /// Move the top and left edges by a delta, preserving width and height inline void Move( long nHorzMoveDelta, long nVertMoveDelta ); + void MoveLeft( long nHorzMoveDelta ) { nLeft += nHorzMoveDelta; } + void MoveRight( long nHorzMoveDelta ) { nRight += nHorzMoveDelta; } + void MoveTop( long nVertMoveDelta ) { nTop += nVertMoveDelta; } + void MoveBottom( long nVertMoveDelta ) { nBottom += nVertMoveDelta; } inline void SetPos( const Point& rPoint ); void SetSize( const Size& rSize ); inline Size GetSize() const; |