include/svx/svdhlpln.hxx | 18 +++++++++--------- svx/source/svdraw/svdhlpln.cxx | 16 ++++++++-------- 2 files changed, 17 insertions(+), 17 deletions(-)
New commits: commit b2fe01ef6154aab63c33706be2739ce2540212c2 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon Jan 8 08:27:31 2024 +0100 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Jan 8 17:56:39 2024 +0100 svx: prefix members of SdrHelpLine See tdf#94879 for motivation. Change-Id: I340040c28aaf64ad79c0d0433686a40b38e351c2 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161781 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/include/svx/svdhlpln.hxx b/include/svx/svdhlpln.hxx index aa850773c4e2..0eed874adf3a 100644 --- a/include/svx/svdhlpln.hxx +++ b/include/svx/svdhlpln.hxx @@ -36,19 +36,19 @@ enum class SdrHelpLineKind { Point, Vertical, Horizontal }; #define SDRHELPLINE_POINT_PIXELSIZE 15 /* actual size = PIXELSIZE*2+1 */ class SdrHelpLine { - Point aPos; // X or Y may be unimportant, depending on the value of eKind - SdrHelpLineKind eKind; + Point m_aPos; // X or Y may be unimportant, depending on the value of eKind + SdrHelpLineKind m_eKind; public: - explicit SdrHelpLine(SdrHelpLineKind eNewKind=SdrHelpLineKind::Point): eKind(eNewKind) {} - SdrHelpLine(SdrHelpLineKind eNewKind, const Point& rNewPos): aPos(rNewPos), eKind(eNewKind) {} - bool operator==(const SdrHelpLine& rCmp) const { return aPos==rCmp.aPos && eKind==rCmp.eKind; } + explicit SdrHelpLine(SdrHelpLineKind eNewKind=SdrHelpLineKind::Point): m_eKind(eNewKind) {} + SdrHelpLine(SdrHelpLineKind eNewKind, const Point& rNewPos): m_aPos(rNewPos), m_eKind(eNewKind) {} + bool operator==(const SdrHelpLine& rCmp) const { return m_aPos==rCmp.m_aPos && m_eKind==rCmp.m_eKind; } bool operator!=(const SdrHelpLine& rCmp) const { return !operator==(rCmp); } - void SetKind(SdrHelpLineKind eNewKind) { eKind=eNewKind; } - SdrHelpLineKind GetKind() const { return eKind; } - void SetPos(const Point& rPnt) { aPos=rPnt; } - const Point& GetPos() const { return aPos; } + void SetKind(SdrHelpLineKind eNewKind) { m_eKind=eNewKind; } + SdrHelpLineKind GetKind() const { return m_eKind; } + void SetPos(const Point& rPnt) { m_aPos=rPnt; } + const Point& GetPos() const { return m_aPos; } PointerStyle GetPointer() const; bool IsHit(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const; diff --git a/svx/source/svdraw/svdhlpln.cxx b/svx/source/svdraw/svdhlpln.cxx index 0d515191ed34..c42aefd4e816 100644 --- a/svx/source/svdraw/svdhlpln.cxx +++ b/svx/source/svdraw/svdhlpln.cxx @@ -26,7 +26,7 @@ PointerStyle SdrHelpLine::GetPointer() const { - switch (eKind) { + switch (m_eKind) { case SdrHelpLineKind::Vertical : return PointerStyle::ESize; case SdrHelpLineKind::Horizontal: return PointerStyle::SSize; default : return PointerStyle::Move; @@ -36,16 +36,16 @@ PointerStyle SdrHelpLine::GetPointer() const bool SdrHelpLine::IsHit(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevice& rOut) const { Size a1Pix(rOut.PixelToLogic(Size(1,1))); - bool bXHit=rPnt.X()>=aPos.X()-nTolLog && rPnt.X()<=aPos.X()+nTolLog+a1Pix.Width(); - bool bYHit=rPnt.Y()>=aPos.Y()-nTolLog && rPnt.Y()<=aPos.Y()+nTolLog+a1Pix.Height(); - switch (eKind) { + bool bXHit=rPnt.X()>=m_aPos.X()-nTolLog && rPnt.X()<=m_aPos.X()+nTolLog+a1Pix.Width(); + bool bYHit=rPnt.Y()>=m_aPos.Y()-nTolLog && rPnt.Y()<=m_aPos.Y()+nTolLog+a1Pix.Height(); + switch (m_eKind) { case SdrHelpLineKind::Vertical : return bXHit; case SdrHelpLineKind::Horizontal: return bYHit; case SdrHelpLineKind::Point: { if (bXHit || bYHit) { Size aRad(rOut.PixelToLogic(Size(SDRHELPLINE_POINT_PIXELSIZE,SDRHELPLINE_POINT_PIXELSIZE))); - return rPnt.X()>=aPos.X()-aRad.Width() && rPnt.X()<=aPos.X()+aRad.Width()+a1Pix.Width() && - rPnt.Y()>=aPos.Y()-aRad.Height() && rPnt.Y()<=aPos.Y()+aRad.Height()+a1Pix.Height(); + return rPnt.X()>=m_aPos.X()-aRad.Width() && rPnt.X()<=m_aPos.X()+aRad.Width()+a1Pix.Width() && + rPnt.Y()>=m_aPos.Y()-aRad.Height() && rPnt.Y()<=m_aPos.Y()+aRad.Height()+a1Pix.Height(); } } break; } // switch @@ -54,10 +54,10 @@ bool SdrHelpLine::IsHit(const Point& rPnt, sal_uInt16 nTolLog, const OutputDevic tools::Rectangle SdrHelpLine::GetBoundRect(const OutputDevice& rOut) const { - tools::Rectangle aRet(aPos,aPos); + tools::Rectangle aRet(m_aPos,m_aPos); Point aOfs(rOut.GetMapMode().GetOrigin()); Size aSiz(rOut.GetOutputSize()); - switch (eKind) { + switch (m_eKind) { case SdrHelpLineKind::Vertical : aRet.SetTop(-aOfs.Y() ); aRet.SetBottom(-aOfs.Y()+aSiz.Height() ); break; case SdrHelpLineKind::Horizontal: aRet.SetLeft(-aOfs.X() ); aRet.SetRight(-aOfs.X()+aSiz.Width() ); break; case SdrHelpLineKind::Point : {