diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2021-08-11 12:32:27 +0900 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2021-08-11 09:18:25 +0200 |
commit | 4cb9b2b3e9bd61ab630aa16d9e382a3b90deb77d (patch) | |
tree | 2e6f9eb02a239ed31e68b667cf89b2f71ebe194e /include | |
parent | 0d356f93e4d5ca073a6e866168f76103c60c6a45 (diff) |
svx: cleanup formatting of svdglue.hxx
Change-Id: I4aa4d25a5097813feeb7d6ebb654b9b0ce0c1c14
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/120302
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/svx/svdglue.hxx | 174 |
1 files changed, 127 insertions, 47 deletions
diff --git a/include/svx/svdglue.hxx b/include/svx/svdglue.hxx index bddaf349c4a8..1bca84ca319f 100644 --- a/include/svx/svdglue.hxx +++ b/include/svx/svdglue.hxx @@ -78,70 +78,150 @@ class SVXCORE_DLLPUBLIC SdrGluePoint { bool bReallyAbsolute:1; // temp for transformations on the reference object bool bUserDefined:1; // #i38892# public: - SdrGluePoint(): nEscDir(SdrEscapeDirection::SMART),nId(0),nAlign(SdrAlign::NONE),bNoPercent(false),bReallyAbsolute(false),bUserDefined(true) {} - SdrGluePoint(const Point& rNewPos): aPos(rNewPos),nEscDir(SdrEscapeDirection::SMART),nId(0),nAlign(SdrAlign::NONE),bNoPercent(false),bReallyAbsolute(false),bUserDefined(true) {} - const Point& GetPos() const { return aPos; } - void SetPos(const Point& rNewPos) { aPos=rNewPos; } - SdrEscapeDirection GetEscDir() const { return nEscDir; } - void SetEscDir(SdrEscapeDirection nNewEsc) { nEscDir=nNewEsc; } - sal_uInt16 GetId() const { return nId; } - void SetId(sal_uInt16 nNewId) { nId=nNewId; } - bool IsPercent() const { return !bNoPercent; } - void SetPercent(bool bOn) { bNoPercent = !bOn; } + SdrGluePoint() + : nEscDir(SdrEscapeDirection::SMART) + , nId(0) + , nAlign(SdrAlign::NONE) + , bNoPercent(false) + , bReallyAbsolute(false) + , bUserDefined(true) + {} + SdrGluePoint(const Point& rNewPos) + : aPos(rNewPos) + , nEscDir(SdrEscapeDirection::SMART) + , nId(0) + , nAlign(SdrAlign::NONE) + , bNoPercent(false) + , bReallyAbsolute(false) + , bUserDefined(true) + {} + const Point& GetPos() const + { + return aPos; + } + void SetPos(const Point& rNewPos) + { + aPos = rNewPos; + } + SdrEscapeDirection GetEscDir() const + { + return nEscDir; + } + void SetEscDir(SdrEscapeDirection nNewEsc) + { + nEscDir = nNewEsc; + } + sal_uInt16 GetId() const + { + return nId; + } + void SetId(sal_uInt16 nNewId) + { + nId = nNewId; + } + bool IsPercent() const + { + return !bNoPercent; + } + void SetPercent(bool bOn) + { + bNoPercent = !bOn; + } // temp for transformations on the reference object - void SetReallyAbsolute(bool bOn, const SdrObject& rObj); + void SetReallyAbsolute(bool bOn, const SdrObject& rObj); // #i38892# - bool IsUserDefined() const { return bUserDefined; } - void SetUserDefined(bool bNew) { bUserDefined = bNew; } - - SdrAlign GetAlign() const { return nAlign; } - void SetAlign(SdrAlign nAlg) { nAlign=nAlg; } - SdrAlign GetHorzAlign() const { return nAlign & static_cast<SdrAlign>(0x00FF); } - void SetHorzAlign(SdrAlign nAlg) { assert((nAlg & static_cast<SdrAlign>(0xFF00)) == SdrAlign::NONE); nAlign = SdrAlign(nAlign & static_cast<SdrAlign>(0xFF00)) | (nAlg & static_cast<SdrAlign>(0x00FF)); } - SdrAlign GetVertAlign() const { return nAlign & static_cast<SdrAlign>(0xFF00); } - void SetVertAlign(SdrAlign nAlg) { assert((nAlg & static_cast<SdrAlign>(0x00FF)) == SdrAlign::NONE); nAlign = SdrAlign(nAlign & static_cast<SdrAlign>(0x00FF)) | (nAlg & static_cast<SdrAlign>(0xFF00)); } - bool IsHit(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const; - void Invalidate(vcl::Window& rWin, const SdrObject* pObj) const; - Point GetAbsolutePos(const SdrObject& rObj) const; - void SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj); - Degree100 GetAlignAngle() const; - void SetAlignAngle(Degree100 nAngle); - static Degree100 EscDirToAngle(SdrEscapeDirection nEsc); + bool IsUserDefined() const + { + return bUserDefined; + } + void SetUserDefined(bool bNew) + { + bUserDefined = bNew; + } + + SdrAlign GetAlign() const + { + return nAlign; + } + void SetAlign(SdrAlign nAlg) + { + nAlign = nAlg; + } + SdrAlign GetHorzAlign() const + { + return nAlign & static_cast<SdrAlign>(0x00FF); + } + void SetHorzAlign(SdrAlign nAlg) + { + assert((nAlg & static_cast<SdrAlign>(0xFF00)) == SdrAlign::NONE); + nAlign = SdrAlign(nAlign & static_cast<SdrAlign>(0xFF00)) | (nAlg & static_cast<SdrAlign>(0x00FF)); + } + SdrAlign GetVertAlign() const + { + return nAlign & static_cast<SdrAlign>(0xFF00); + } + void SetVertAlign(SdrAlign nAlg) + { + assert((nAlg & static_cast<SdrAlign>(0x00FF)) == SdrAlign::NONE); + nAlign = SdrAlign(nAlign & static_cast<SdrAlign>(0x00FF)) | (nAlg & static_cast<SdrAlign>(0xFF00)); + } + + bool IsHit(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const; + void Invalidate(vcl::Window& rWin, const SdrObject* pObj) const; + Point GetAbsolutePos(const SdrObject& rObj) const; + void SetAbsolutePos(const Point& rNewPos, const SdrObject& rObj); + Degree100 GetAlignAngle() const; + void SetAlignAngle(Degree100 nAngle); + static Degree100 EscDirToAngle(SdrEscapeDirection nEsc); static SdrEscapeDirection EscAngleToDir(Degree100 nAngle); - void Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs, const SdrObject* pObj); - void Mirror(const Point& rRef1, const Point& rRef2, Degree100 nAngle, const SdrObject* pObj); - void Shear (const Point& rRef, double tn, bool bVShear, const SdrObject* pObj); + void Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs, const SdrObject* pObj); + void Mirror(const Point& rRef1, const Point& rRef2, Degree100 nAngle, const SdrObject* pObj); + void Shear (const Point& rRef, double tn, bool bVShear, const SdrObject* pObj); }; #define SDRGLUEPOINT_NOTFOUND 0xFFFF -class SVXCORE_DLLPUBLIC SdrGluePointList { +class SVXCORE_DLLPUBLIC SdrGluePointList +{ std::vector<SdrGluePoint> aList; public: SdrGluePointList() {}; - SdrGluePointList(const SdrGluePointList& rSrcList) { *this=rSrcList; } + SdrGluePointList(const SdrGluePointList& rSrcList) + { + *this = rSrcList; + } - SdrGluePointList& operator=(const SdrGluePointList& rSrcList); - sal_uInt16 GetCount() const { return sal_uInt16(aList.size()); } + SdrGluePointList& operator=(const SdrGluePointList& rSrcList); + sal_uInt16 GetCount() const + { + return sal_uInt16(aList.size()); + } // At insert, the object (GluePoint) automatically gets an ID assigned. // Return value is the index of the new GluePoint in the list. - sal_uInt16 Insert(const SdrGluePoint& rGP); - void Delete(sal_uInt16 nPos) + sal_uInt16 Insert(const SdrGluePoint& rGP); + void Delete(sal_uInt16 nPos) { - aList.erase(aList.begin()+nPos); + aList.erase(aList.begin() + nPos); } - SdrGluePoint& operator[](sal_uInt16 nPos) { return aList[nPos]; } - const SdrGluePoint& operator[](sal_uInt16 nPos) const { return aList[nPos]; } - sal_uInt16 FindGluePoint(sal_uInt16 nId) const; - sal_uInt16 HitTest(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const; - void Invalidate(vcl::Window& rWin, const SdrObject* pObj) const; + SdrGluePoint& operator[](sal_uInt16 nPos) + { + return aList[nPos]; + } + const SdrGluePoint& operator[](sal_uInt16 nPos) const + { + return aList[nPos]; + } + sal_uInt16 FindGluePoint(sal_uInt16 nId) const; + sal_uInt16 HitTest(const Point& rPnt, const OutputDevice& rOut, const SdrObject* pObj) const; + void Invalidate(vcl::Window& rWin, const SdrObject* pObj) const; + // temp for transformations on the reference object - void SetReallyAbsolute(bool bOn, const SdrObject& rObj); - void Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs, const SdrObject* pObj); - void Mirror(const Point& rRef1, const Point& rRef2, const SdrObject* pObj); - void Mirror(const Point& rRef1, const Point& rRef2, Degree100 nAngle, const SdrObject* pObj); - void Shear (const Point& rRef, double tn, bool bVShear, const SdrObject* pObj); + void SetReallyAbsolute(bool bOn, const SdrObject& rObj); + void Rotate(const Point& rRef, Degree100 nAngle, double sn, double cs, const SdrObject* pObj); + void Mirror(const Point& rRef1, const Point& rRef2, const SdrObject* pObj); + void Mirror(const Point& rRef1, const Point& rRef2, Degree100 nAngle, const SdrObject* pObj); + void Shear(const Point& rRef, double tn, bool bVShear, const SdrObject* pObj); }; |