include/svx/svdsnpv.hxx | 136 +++++++++++++++++++++--------------------- svx/source/svdraw/svddrgv.cxx | 4 - svx/source/svdraw/svdsnpv.cxx | 60 +++++++++--------- 3 files changed, 100 insertions(+), 100 deletions(-)
New commits: commit 9a92a4355ee60ab5d161eb67a1f255f4d6c4b5b8 Author: Miklos Vajna <vmik...@collabora.com> AuthorDate: Mon Sep 30 08:06:22 2024 +0200 Commit: Miklos Vajna <vmik...@collabora.com> CommitDate: Mon Sep 30 09:24:05 2024 +0200 svx: prefix members of SdrSnapView See tdf#94879 for motivation. Change-Id: I898a1c638258397a1964e409db413b00ba3f149f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174212 Reviewed-by: Miklos Vajna <vmik...@collabora.com> Tested-by: Jenkins diff --git a/include/svx/svdsnpv.hxx b/include/svx/svdsnpv.hxx index 15f2814dcfa2..373bbf1d0fbb 100644 --- a/include/svx/svdsnpv.hxx +++ b/include/svx/svdsnpv.hxx @@ -99,31 +99,31 @@ protected: // #114409#-2 Migrate HelpLine class ImplHelpLineOverlay* mpHelpLineOverlay; - Size aMagnSiz; - Fraction aSnapWdtX; - Fraction aSnapWdtY; - - sal_uInt16 nMagnSizPix; - Degree100 nSnapAngle; - Degree100 nEliminatePolyPointLimitAngle; - - SdrCrookMode eCrookMode; - - bool bSnapEnab : 1; - bool bGridSnap : 1; - bool bBordSnap : 1; - bool bHlplSnap : 1; - bool bOFrmSnap : 1; - bool bOPntSnap : 1; - bool bOConSnap : 1; - bool bMoveSnapOnlyTopLeft : 1; // Special for dialogeditor - bool bOrtho : 1; - bool bBigOrtho : 1; - bool bAngleSnapEnab : 1; - bool bMoveOnlyDragging : 1; // only move objects while Resize/Rotate/... - bool bSlantButShear : 1; // use slant instead of shear - bool bCrookNoContortion : 1; // no contorsion while Crook - bool bEliminatePolyPoints : 1; + Size maMagnSiz; + Fraction maSnapWdtX; + Fraction maSnapWdtY; + + sal_uInt16 mnMagnSizPix; + Degree100 mnSnapAngle; + Degree100 mnEliminatePolyPointLimitAngle; + + SdrCrookMode meCrookMode; + + bool mbSnapEnab : 1; + bool mbGridSnap : 1; + bool mbBordSnap : 1; + bool mbHlplSnap : 1; + bool mbOFrmSnap : 1; + bool mbOPntSnap : 1; + bool mbOConSnap : 1; + bool mbMoveSnapOnlyTopLeft : 1; // Special for dialogeditor + bool mbOrtho : 1; + bool mbBigOrtho : 1; + bool mbAngleSnapEnab : 1; + bool mbMoveOnlyDragging : 1; // only move objects while Resize/Rotate/... + bool mbSlantButShear : 1; // use slant instead of shear + bool mbCrookNoContortion : 1; // no contorsion while Crook + bool mbEliminatePolyPoints : 1; protected: // #i71538# make constructors of SdrView sub-components protected to avoid incomplete incarnations which may get casted to SdrView @@ -141,16 +141,16 @@ public: virtual void BrkAction() override; // break actions for derived classes e.g. interrupt dragging. virtual void TakeActionRect(tools::Rectangle& rRect) const override; - void SetSnapGridWidth(const Fraction& rX, const Fraction& rY) { aSnapWdtX=rX; aSnapWdtY=rY; } - const Fraction& GetSnapGridWidthX() const { return aSnapWdtX; } - const Fraction& GetSnapGridWidthY() const { return aSnapWdtY; } + void SetSnapGridWidth(const Fraction& rX, const Fraction& rY) { maSnapWdtX=rX; maSnapWdtY=rY; } + const Fraction& GetSnapGridWidthX() const { return maSnapWdtX; } + const Fraction& GetSnapGridWidthY() const { return maSnapWdtY; } - void SetSnapMagnetic(const Size& rSiz) { if (rSiz!=aMagnSiz) { aMagnSiz=rSiz; } } - void SetSnapMagneticPixel(sal_uInt16 nPix) { nMagnSizPix=nPix; } - sal_uInt16 GetSnapMagneticPixel() const { return nMagnSizPix; } + void SetSnapMagnetic(const Size& rSiz) { if (rSiz!=maMagnSiz) { maMagnSiz=rSiz; } } + void SetSnapMagneticPixel(sal_uInt16 nPix) { mnMagnSizPix=nPix; } + sal_uInt16 GetSnapMagneticPixel() const { return mnMagnSizPix; } // RecalcLogicSnapMagnetic has to be called for every change of OutputDevices and every change of the MapMode! - void RecalcLogicSnapMagnetic(const OutputDevice& rOut) { SetSnapMagnetic(rOut.PixelToLogic(Size(nMagnSizPix,nMagnSizPix))); } + void RecalcLogicSnapMagnetic(const OutputDevice& rOut) { SetSnapMagnetic(rOut.PixelToLogic(Size(mnMagnSizPix,mnMagnSizPix))); } void SetActualWin(const OutputDevice* pWin) { SdrPaintView::SetActualWin(pWin); if (pWin!=nullptr) RecalcLogicSnapMagnetic(*pWin); } // Coordinates referred to the view! @@ -161,26 +161,26 @@ public: void CheckSnap(const Point& rPt, tools::Long& nBestXSnap, tools::Long& nBestYSnap, bool& bXSnapped, bool& bYSnapped) const; // All attitudes to snap are persistent. - bool IsSnapEnabled() const { return bSnapEnab; } - bool IsGridSnap() const { return bGridSnap; } // Snap to grid - bool IsBordSnap() const { return bBordSnap; } // Snap to border - bool IsHlplSnap() const { return bHlplSnap; } // Snap to auxiliary line - bool IsOFrmSnap() const { return bOFrmSnap; } // Snap to LogFram from surrounding drawing objects - bool IsOPntSnap() const { return bOPntSnap; } // Snap to distinct points from surrounding drawing objects - bool IsOConSnap() const { return bOConSnap; } // Snap to connectors of the drawing objects - void SetSnapEnabled(bool bOn) { bSnapEnab=bOn; } - void SetGridSnap(bool bOn) { bGridSnap=bOn; } - void SetBordSnap(bool bOn) { bBordSnap=bOn; } - void SetHlplSnap(bool bOn) { bHlplSnap=bOn; } - void SetOFrmSnap(bool bOn) { bOFrmSnap=bOn; } - void SetOPntSnap(bool bOn) { bOPntSnap=bOn; } - void SetOConSnap(bool bOn) { bOConSnap=bOn; } + bool IsSnapEnabled() const { return mbSnapEnab; } + bool IsGridSnap() const { return mbGridSnap; } // Snap to grid + bool IsBordSnap() const { return mbBordSnap; } // Snap to border + bool IsHlplSnap() const { return mbHlplSnap; } // Snap to auxiliary line + bool IsOFrmSnap() const { return mbOFrmSnap; } // Snap to LogFram from surrounding drawing objects + bool IsOPntSnap() const { return mbOPntSnap; } // Snap to distinct points from surrounding drawing objects + bool IsOConSnap() const { return mbOConSnap; } // Snap to connectors of the drawing objects + void SetSnapEnabled(bool bOn) { mbSnapEnab=bOn; } + void SetGridSnap(bool bOn) { mbGridSnap=bOn; } + void SetBordSnap(bool bOn) { mbBordSnap=bOn; } + void SetHlplSnap(bool bOn) { mbHlplSnap=bOn; } + void SetOFrmSnap(bool bOn) { mbOFrmSnap=bOn; } + void SetOPntSnap(bool bOn) { mbOPntSnap=bOn; } + void SetOConSnap(bool bOn) { mbOConSnap=bOn; } // Usually every 4 corners of Object-SnapRects are snapped for Move-Dragging. // The following attitudes e.g. if you only want to snap the left corner on the top (e.g. DialogEditor) // persistent, Default=FALSE. - void SetMoveSnapOnlyTopLeft(bool bOn) { bMoveSnapOnlyTopLeft=bOn; } - bool IsMoveSnapOnlyTopLeft() const { return bMoveSnapOnlyTopLeft; } + void SetMoveSnapOnlyTopLeft(bool bOn) { mbMoveSnapOnlyTopLeft=bOn; } + bool IsMoveSnapOnlyTopLeft() const { return mbMoveSnapOnlyTopLeft; } // #114409#-1 Migrate PageOrigin void BegSetPageOrg(const Point& rPnt); @@ -218,10 +218,10 @@ public: // - Shear (Dragging) // - circular arc/-sector/-section angle (Create and Dragging) // persistent. - void SetAngleSnapEnabled(bool bOn) { bAngleSnapEnab=bOn; } - bool IsAngleSnapEnabled() const { return bAngleSnapEnab; } - void SetSnapAngle(Degree100 nAngle) { nSnapAngle=nAngle; } - Degree100 GetSnapAngle() const { return nSnapAngle; } + void SetAngleSnapEnabled(bool bOn) { mbAngleSnapEnab=bOn; } + bool IsAngleSnapEnabled() const { return mbAngleSnapEnab; } + void SetSnapAngle(Degree100 nAngle) { mnSnapAngle=nAngle; } + Degree100 GetSnapAngle() const { return mnSnapAngle; } // different effects from Ortho (depending on the context): // - Create @@ -242,8 +242,8 @@ public: // - circle object angle: nothing // - line keeps while Dragging the angle and is only stretched/ contracted // Default value for Ortho is off. persistent. - void SetOrtho(bool bOn) { bOrtho=bOn; } // incomplete - bool IsOrtho() const { return bOrtho; } + void SetOrtho(bool bOn) { mbOrtho=bOn; } // incomplete + bool IsOrtho() const { return mbOrtho; } // BigOrtho is only relevant if Ortho is switched on. // Example: rectangle is created and ortho is switched on (--> square) @@ -254,34 +254,34 @@ public: // If BigOrtho is switched on, you get a square with edge length of 80. // The same also applies to Resize. // Default value for BigOrtho is on. persistent. - void SetBigOrtho(bool bOn) { bBigOrtho=bOn; } - bool IsBigOrtho() const { return bBigOrtho; } + void SetBigOrtho(bool bOn) { mbBigOrtho=bOn; } + bool IsBigOrtho() const { return mbBigOrtho; } // If MoveOnlyDragging=sal_True only the center of the marked objects is // transformed when Resize/Rotate/Shear/Mirror/Crook is executed. // Size, form and rotation angle of the objects are conserved only their positions // are changed. persistent. Default=FALSE. (ni) - void SetMoveOnlyDragging(bool bOn) { bMoveOnlyDragging=bOn; } - bool IsMoveOnlyDragging() const { return bMoveOnlyDragging; } + void SetMoveOnlyDragging(bool bOn) { mbMoveOnlyDragging=bOn; } + bool IsMoveOnlyDragging() const { return mbMoveOnlyDragging; } // Use Slant instead of Shear. persistent. Default=FALSE. - void SetSlantButShear(bool bOn) { bSlantButShear=bOn; } - bool IsSlantButShear() const { return bSlantButShear; } + void SetSlantButShear(bool bOn) { mbSlantButShear=bOn; } + bool IsSlantButShear() const { return mbSlantButShear; } // Don't contort object while Crook. persistent. Default=FALSE. (ni) - void SetCrookNoContortion(bool bOn) { bCrookNoContortion=bOn; } - bool IsCrookNoContortion() const { return bCrookNoContortion; } + void SetCrookNoContortion(bool bOn) { mbCrookNoContortion=bOn; } + bool IsCrookNoContortion() const { return mbCrookNoContortion; } // Crook-Mode. persistent. Default=SdrCrookMode::Rotate. (ni) - void SetCrookMode(SdrCrookMode eMode) { eCrookMode=eMode; } - SdrCrookMode GetCrookMode() const { return eCrookMode; } + void SetCrookMode(SdrCrookMode eMode) { meCrookMode=eMode; } + SdrCrookMode GetCrookMode() const { return meCrookMode; } // Special for IBM: While Dragging of a traverse station, it is deleted // if its adjacent lines are almost a solid line. - void SetEliminatePolyPoints(bool bOn) { bEliminatePolyPoints=bOn; } - bool IsEliminatePolyPoints() const { return bEliminatePolyPoints; } - void SetEliminatePolyPointLimitAngle(Degree100 nAngle) { nEliminatePolyPointLimitAngle=nAngle; } - Degree100 GetEliminatePolyPointLimitAngle() const { return nEliminatePolyPointLimitAngle; } + void SetEliminatePolyPoints(bool bOn) { mbEliminatePolyPoints=bOn; } + bool IsEliminatePolyPoints() const { return mbEliminatePolyPoints; } + void SetEliminatePolyPointLimitAngle(Degree100 nAngle) { mnEliminatePolyPointLimitAngle=nAngle; } + Degree100 GetEliminatePolyPointLimitAngle() const { return mnEliminatePolyPointLimitAngle; } }; /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/svdraw/svddrgv.cxx b/svx/source/svdraw/svddrgv.cxx index 82be2f067c80..051e559c94cd 100644 --- a/svx/source/svdraw/svddrgv.cxx +++ b/svx/source/svdraw/svddrgv.cxx @@ -539,7 +539,7 @@ bool SdrDragView::EndDragObj(bool bCopy) { sal_Int32 nSavedHdlCount=0; - if (bEliminatePolyPoints) + if (mbEliminatePolyPoints) { nSavedHdlCount=GetMarkablePointCount(); } @@ -558,7 +558,7 @@ bool SdrDragView::EndDragObj(bool bCopy) mpCurrentSdrDragMethod.reset(); - if (bEliminatePolyPoints) + if (mbEliminatePolyPoints) { if (nSavedHdlCount!=GetMarkablePointCount()) { diff --git a/svx/source/svdraw/svdsnpv.cxx b/svx/source/svdraw/svdsnpv.cxx index f4ea1ab6bef8..4311726b1831 100644 --- a/svx/source/svdraw/svdsnpv.cxx +++ b/svx/source/svdraw/svdsnpv.cxx @@ -170,25 +170,25 @@ SdrSnapView::SdrSnapView( : SdrPaintView(rSdrModel, pOut) ,mpPageOriginOverlay(nullptr) ,mpHelpLineOverlay(nullptr) - ,nMagnSizPix(4) - ,nSnapAngle(1500) - ,nEliminatePolyPointLimitAngle(0) - ,eCrookMode(SdrCrookMode::Rotate) - ,bSnapEnab(true) - ,bGridSnap(true) - ,bBordSnap(true) - ,bHlplSnap(true) - ,bOFrmSnap(true) - ,bOPntSnap(false) - ,bOConSnap(true) - ,bMoveSnapOnlyTopLeft(false) - ,bOrtho(false) - ,bBigOrtho(true) - ,bAngleSnapEnab(false) - ,bMoveOnlyDragging(false) - ,bSlantButShear(false) - ,bCrookNoContortion(false) - ,bEliminatePolyPoints(false) + ,mnMagnSizPix(4) + ,mnSnapAngle(1500) + ,mnEliminatePolyPointLimitAngle(0) + ,meCrookMode(SdrCrookMode::Rotate) + ,mbSnapEnab(true) + ,mbGridSnap(true) + ,mbBordSnap(true) + ,mbHlplSnap(true) + ,mbOFrmSnap(true) + ,mbOPntSnap(false) + ,mbOConSnap(true) + ,mbMoveSnapOnlyTopLeft(false) + ,mbOrtho(false) + ,mbBigOrtho(true) + ,mbAngleSnapEnab(false) + ,mbMoveOnlyDragging(false) + ,mbSlantButShear(false) + ,mbCrookNoContortion(false) + ,mbEliminatePolyPoints(false) { } @@ -260,7 +260,7 @@ Point SdrSnapView::GetSnapPos(const Point& rPnt, const SdrPageView* pPV) const #define NOT_SNAPPED 0x7FFFFFFF SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const { - if (!bSnapEnab) return SdrSnap::NOTSNAPPED; + if (!mbSnapEnab) return SdrSnap::NOTSNAPPED; tools::Long x=rPnt.X(); tools::Long y=rPnt.Y(); if (pPV==nullptr) { @@ -271,9 +271,9 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const tools::Long dx=NOT_SNAPPED; tools::Long dy=NOT_SNAPPED; tools::Long dx1,dy1; - tools::Long mx=aMagnSiz.Width(); - tools::Long my=aMagnSiz.Height(); - if (mbHlplVisible && bHlplSnap && !IsDragHelpLine()) + tools::Long mx=maMagnSiz.Width(); + tools::Long my=maMagnSiz.Height(); + if (mbHlplVisible && mbHlplSnap && !IsDragHelpLine()) { const SdrHelpLineList& rHLL=pPV->GetHelpLines(); sal_uInt16 nCount=rHLL.GetCount(); @@ -301,7 +301,7 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const } // switch } } - if (mbBordVisible && bBordSnap) { + if (mbBordVisible && mbBordSnap) { SdrPage* pPage=pPV->GetPage(); tools::Long xs=pPage->GetWidth(); tools::Long ys=pPage->GetHeight(); @@ -319,7 +319,7 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const a=y ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // left edge of paper a=y- ys ; if (std::abs(a)<=my) { dy1=-a; if (std::abs(dy1)<std::abs(dy)) dy=dy1; } // right edge of paper } - if (bOFrmSnap || bOPntSnap) { + if (mbOFrmSnap || mbOPntSnap) { sal_uInt32 nMaxPointSnapCount=200; sal_uInt32 nMaxFrameSnapCount=200; @@ -334,7 +334,7 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const aRect.AdjustTop( -my ); aRect.AdjustBottom(my ); if (aRect.Contains(rPnt)) { - if (bOPntSnap && nMaxPointSnapCount>0) + if (mbOPntSnap && nMaxPointSnapCount>0) { sal_uInt32 nCount(pO->GetSnapPointCount()); for (sal_uInt32 i(0); i < nCount && nMaxPointSnapCount > 0; i++) @@ -349,7 +349,7 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const nMaxPointSnapCount--; } } - if (bOFrmSnap && nMaxFrameSnapCount>0) { + if (mbOFrmSnap && nMaxFrameSnapCount>0) { tools::Rectangle aLog(pO->GetSnapRect()); tools::Rectangle aR1(aLog); aR1.AdjustLeft( -mx ); @@ -367,9 +367,9 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const } } } - if(bGridSnap) + if(mbGridSnap) { - double fSnapWidth(aSnapWdtX); + double fSnapWidth(maSnapWdtX); if(dx == NOT_SNAPPED && fSnapWidth != 0.0) { double fx = static_cast<double>(x); @@ -384,7 +384,7 @@ SdrSnap SdrSnapView::SnapPos(Point& rPnt, const SdrPageView* pPV) const x = static_cast<tools::Long>(static_cast<double>(x) * fSnapWidth + static_cast<double>(pPV->GetPageOrigin().X())); dx = 0; } - fSnapWidth = double(aSnapWdtY); + fSnapWidth = double(maSnapWdtY); if(dy == NOT_SNAPPED && fSnapWidth) { double fy = static_cast<double>(y);