diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2021-04-12 09:13:22 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2021-04-12 09:58:28 +0200 |
commit | bd9b009491b9aed5160be870dc82af5709f41af2 (patch) | |
tree | 5b5e3abc5dc3a978a4e666a7eb69489268643445 /sw/source/core | |
parent | 198960184cd7c4bcc0366aadf1d0f61e52c2d7c3 (diff) |
svx: prefix members of SdrObject
So that nOrdNum doesn't cause -Wshadow in
SwDrawVirtObj::AddToDrawingPage().
Change-Id: Ie7b1401f5c3cb07bfa653c4268dbdce7ba7abea5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113966
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source/core')
-rw-r--r-- | sw/source/core/draw/dcontact.cxx | 38 | ||||
-rw-r--r-- | sw/source/core/draw/dflyobj.cxx | 48 |
2 files changed, 43 insertions, 43 deletions
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index f45d7278d59c..9ae68e2a05ef 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -2282,7 +2282,7 @@ void SwDrawVirtObj::AddToDrawingPage(SwFrame const& rAnchorFrame) // insert 'virtual' drawing object into page, set layer and user call. SdrPage* pDrawPg = pOrgMasterSdrObj->getSdrPageFromSdrObject(); // default: insert before master object - auto NOTM_nOrdNum(GetReferencedObj().GetOrdNum()); + auto nOrdNum(GetReferencedObj().GetOrdNum()); // maintain invariant that a shape's textbox immediately follows the shape // also for the multiple SdrDrawVirtObj created for shapes in header/footer @@ -2297,33 +2297,33 @@ void SwDrawVirtObj::AddToDrawingPage(SwFrame const& rAnchorFrame) if (&pAnchoredObj->GetFrameFormat() == pFlyFormat) { assert(dynamic_cast<SwFlyFrame const*>(pAnchoredObj)); - NOTM_nOrdNum = pAnchoredObj->GetDrawObj()->GetOrdNum(); + nOrdNum = pAnchoredObj->GetDrawObj()->GetOrdNum(); // the master SdrObj should have the highest index - assert(NOTM_nOrdNum < GetReferencedObj().GetOrdNum()); + assert(nOrdNum < GetReferencedObj().GetOrdNum()); break; } } } // this happens on initial insertion, the draw object is created first - SAL_INFO_IF(GetReferencedObj().GetOrdNum() == NOTM_nOrdNum, "sw", "AddToDrawingPage: cannot find SdrObject for text box's shape"); + SAL_INFO_IF(GetReferencedObj().GetOrdNum() == nOrdNum, "sw", "AddToDrawingPage: cannot find SdrObject for text box's shape"); } // #i27030# - apply order number of referenced object if ( nullptr != pDrawPg ) { // #i27030# - apply order number of referenced object - pDrawPg->InsertObject(this, NOTM_nOrdNum); + pDrawPg->InsertObject(this, nOrdNum); } else { pDrawPg = getSdrPageFromSdrObject(); if ( pDrawPg ) { - pDrawPg->SetObjectOrdNum(GetOrdNumDirect(), NOTM_nOrdNum); + pDrawPg->SetObjectOrdNum(GetOrdNumDirect(), nOrdNum); } else { - SetOrdNum(NOTM_nOrdNum); + SetOrdNum(nOrdNum); } } SetUserCall( &mrDrawContact ); @@ -2357,30 +2357,30 @@ void SwDrawVirtObj::NbcSetAnchorPos(const Point& rPnt) const tools::Rectangle& SwDrawVirtObj::GetCurrentBoundRect() const { - if(aOutRect.IsEmpty()) + if(m_aOutRect.IsEmpty()) { const_cast<SwDrawVirtObj*>(this)->RecalcBoundRect(); } - return aOutRect; + return m_aOutRect; } const tools::Rectangle& SwDrawVirtObj::GetLastBoundRect() const { - return aOutRect; + return m_aOutRect; } Point SwDrawVirtObj::GetOffset() const { // do NOT use IsEmpty() here, there is already a useful offset // in the position - if(aOutRect == tools::Rectangle()) + if(m_aOutRect == tools::Rectangle()) { return Point(); } else { - return aOutRect.TopLeft() - GetReferencedObj().GetCurrentBoundRect().TopLeft(); + return m_aOutRect.TopLeft() - GetReferencedObj().GetCurrentBoundRect().TopLeft(); } } @@ -2396,7 +2396,7 @@ void SwDrawVirtObj::RecalcBoundRect() // its value by the 'BoundRect' of the referenced object. const Point aOffset(GetOffset()); - aOutRect = ReferencedObj().GetCurrentBoundRect() + aOffset; + m_aOutRect = ReferencedObj().GetCurrentBoundRect() + aOffset; } basegfx::B2DPolyPolygon SwDrawVirtObj::TakeXorPoly() const @@ -2468,7 +2468,7 @@ void SwDrawVirtObj::Resize(const Point& rRef, const Fraction& xFact, const Fract { if(xFact.GetNumerator() != xFact.GetDenominator() || yFact.GetNumerator() != yFact.GetDenominator()) { - tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect(); + tools::Rectangle aBoundRect0; if(m_pUserCall) aBoundRect0 = GetLastBoundRect(); rRefObj.Resize(rRef - GetOffset(), xFact, yFact, bUnsetRelative); SetRectsDirty(); SendUserCall(SdrUserCallType::Resize, aBoundRect0); @@ -2479,7 +2479,7 @@ void SwDrawVirtObj::Rotate(const Point& rRef, Degree100 nAngle, double sn, doubl { if(nAngle) { - tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect(); + tools::Rectangle aBoundRect0; if(m_pUserCall) aBoundRect0 = GetLastBoundRect(); rRefObj.Rotate(rRef - GetOffset(), nAngle, sn, cs); SetRectsDirty(); SendUserCall(SdrUserCallType::Resize, aBoundRect0); @@ -2488,7 +2488,7 @@ void SwDrawVirtObj::Rotate(const Point& rRef, Degree100 nAngle, double sn, doubl void SwDrawVirtObj::Mirror(const Point& rRef1, const Point& rRef2) { - tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect(); + tools::Rectangle aBoundRect0; if(m_pUserCall) aBoundRect0 = GetLastBoundRect(); rRefObj.Mirror(rRef1 - GetOffset(), rRef2 - GetOffset()); SetRectsDirty(); SendUserCall(SdrUserCallType::Resize, aBoundRect0); @@ -2498,7 +2498,7 @@ void SwDrawVirtObj::Shear(const Point& rRef, Degree100 nAngle, double tn, bool b { if(nAngle) { - tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect(); + tools::Rectangle aBoundRect0; if(m_pUserCall) aBoundRect0 = GetLastBoundRect(); rRefObj.Shear(rRef - GetOffset(), nAngle, tn, bVShear); SetRectsDirty(); SendUserCall(SdrUserCallType::Resize, aBoundRect0); @@ -2521,7 +2521,7 @@ const tools::Rectangle& SwDrawVirtObj::GetSnapRect() const void SwDrawVirtObj::SetSnapRect(const tools::Rectangle& rRect) { - tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect(); + tools::Rectangle aBoundRect0; if(m_pUserCall) aBoundRect0 = GetLastBoundRect(); tools::Rectangle aR(rRect); aR -= GetOffset(); rRefObj.SetSnapRect(aR); @@ -2547,7 +2547,7 @@ const tools::Rectangle& SwDrawVirtObj::GetLogicRect() const void SwDrawVirtObj::SetLogicRect(const tools::Rectangle& rRect) { - tools::Rectangle aBoundRect0; if(pUserCall) aBoundRect0 = GetLastBoundRect(); + tools::Rectangle aBoundRect0; if(m_pUserCall) aBoundRect0 = GetLastBoundRect(); tools::Rectangle aR(rRect); aR -= GetOffset(); rRefObj.SetLogicRect(aR); diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index a06f0e8415c3..93a66ba6b625 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -424,8 +424,8 @@ SwVirtFlyDrawObj::SwVirtFlyDrawObj( m_pFlyFrame(pFly) { const SvxProtectItem &rP = m_pFlyFrame->GetFormat()->GetProtect(); - bMovProt = rP.IsPosProtected(); - bSizProt = rP.IsSizeProtected(); + m_bMovProt = rP.IsPosProtected(); + m_bSizProt = rP.IsSizeProtected(); } SwVirtFlyDrawObj::~SwVirtFlyDrawObj() @@ -549,15 +549,15 @@ void SwVirtFlyDrawObj::TakeObjInfo( SdrObjTransformInfoRec& rInfo ) const void SwVirtFlyDrawObj::SetRect() const { if ( GetFlyFrame()->getFrameArea().HasArea() ) - const_cast<SwVirtFlyDrawObj*>(this)->aOutRect = GetFlyFrame()->getFrameArea().SVRect(); + const_cast<SwVirtFlyDrawObj*>(this)->m_aOutRect = GetFlyFrame()->getFrameArea().SVRect(); else - const_cast<SwVirtFlyDrawObj*>(this)->aOutRect = tools::Rectangle(); + const_cast<SwVirtFlyDrawObj*>(this)->m_aOutRect = tools::Rectangle(); } const tools::Rectangle& SwVirtFlyDrawObj::GetCurrentBoundRect() const { SetRect(); - return aOutRect; + return m_aOutRect; } const tools::Rectangle& SwVirtFlyDrawObj::GetLastBoundRect() const @@ -578,7 +578,7 @@ void SwVirtFlyDrawObj::RecalcSnapRect() const tools::Rectangle& SwVirtFlyDrawObj::GetSnapRect() const { SetRect(); - return aOutRect; + return m_aOutRect; } void SwVirtFlyDrawObj::SetSnapRect(const tools::Rectangle& ) @@ -587,8 +587,8 @@ void SwVirtFlyDrawObj::SetSnapRect(const tools::Rectangle& ) SetRect(); SetChanged(); BroadcastObjectChange(); - if (pUserCall!=nullptr) - pUserCall->Changed(*this, SdrUserCallType::Resize, aTmp); + if (m_pUserCall!=nullptr) + m_pUserCall->Changed(*this, SdrUserCallType::Resize, aTmp); } void SwVirtFlyDrawObj::NbcSetSnapRect(const tools::Rectangle& ) @@ -599,7 +599,7 @@ void SwVirtFlyDrawObj::NbcSetSnapRect(const tools::Rectangle& ) const tools::Rectangle& SwVirtFlyDrawObj::GetLogicRect() const { SetRect(); - return aOutRect; + return m_aOutRect; } void SwVirtFlyDrawObj::SetLogicRect(const tools::Rectangle& ) @@ -608,8 +608,8 @@ void SwVirtFlyDrawObj::SetLogicRect(const tools::Rectangle& ) SetRect(); SetChanged(); BroadcastObjectChange(); - if (pUserCall!=nullptr) - pUserCall->Changed(*this, SdrUserCallType::Resize, aTmp); + if (m_pUserCall!=nullptr) + m_pUserCall->Changed(*this, SdrUserCallType::Resize, aTmp); } void SwVirtFlyDrawObj::NbcSetLogicRect(const tools::Rectangle& ) @@ -638,13 +638,13 @@ void SwVirtFlyDrawObj::NbcMove(const Size& rSiz) // working properly. Restore FrameArea and use aOutRect from old FrameArea. TransformableSwFrame* pTransformableSwFrame(static_cast<SwFlyFreeFrame*>(GetFlyFrame())->getTransformableSwFrame()); pTransformableSwFrame->restoreFrameAreas(); - aOutRect = GetFlyFrame()->getFrameArea().SVRect(); + m_aOutRect = GetFlyFrame()->getFrameArea().SVRect(); } - aOutRect.Move( rSiz ); + m_aOutRect.Move( rSiz ); const Point aOldPos( GetFlyFrame()->getFrameArea().Pos() ); - const Point aNewPos( aOutRect.TopLeft() ); - const SwRect aFlyRect( aOutRect ); + const Point aNewPos( m_aOutRect.TopLeft() ); + const SwRect aFlyRect( m_aOutRect ); //If the Fly has an automatic align (right or top), //so preserve the automatic. @@ -833,7 +833,7 @@ void SwVirtFlyDrawObj::NbcCrop(const basegfx::B2DPoint& rRef, double fxFact, dou // working properly. Restore FrameArea and use aOutRect from old FrameArea. TransformableSwFrame* pTransformableSwFrame(static_cast<SwFlyFreeFrame*>(GetFlyFrame())->getTransformableSwFrame()); pTransformableSwFrame->restoreFrameAreas(); - aOutRect = GetFlyFrame()->getFrameArea().SVRect(); + m_aOutRect = GetFlyFrame()->getFrameArea().SVRect(); } // Compute old and new rect. This will give us the deformation to apply to @@ -904,8 +904,8 @@ void SwVirtFlyDrawObj::NbcCrop(const basegfx::B2DPoint& rRef, double fxFact, dou // Set new frame size SwFrameFormat *pFormat = GetFormat(); SwFormatFrameSize aSz( pFormat->GetFrameSize() ); - const tools::Long aNewWidth(aNewRect.GetWidth() + (aOutRect.GetWidth() - aOldRect.GetWidth())); - const tools::Long aNewHeight(aNewRect.GetHeight() + (aOutRect.GetHeight() - aOldRect.GetHeight())); + const tools::Long aNewWidth(aNewRect.GetWidth() + (m_aOutRect.GetWidth() - aOldRect.GetWidth())); + const tools::Long aNewHeight(aNewRect.GetHeight() + (m_aOutRect.GetHeight() - aOldRect.GetHeight())); aSz.SetWidth(aNewWidth); aSz.SetHeight(aNewHeight); pFormat->GetDoc()->SetAttr( aSz, *pFormat ); @@ -1002,7 +1002,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const const basegfx::B2DVector aAbsScale(basegfx::absolute(aScale)); // create new modified, but untransformed OutRect - aOutRect = tools::Rectangle( + m_aOutRect = tools::Rectangle( basegfx::fround(aCenter.getX() - (0.5 * aAbsScale.getX())), basegfx::fround(aCenter.getY() - (0.5 * aAbsScale.getY())), basegfx::fround(aCenter.getX() + (0.5 * aAbsScale.getX())), @@ -1015,7 +1015,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const } else { - ResizeRect( aOutRect, rRef, xFact, yFact ); + ResizeRect( m_aOutRect, rRef, xFact, yFact ); } // Position may also change, remember old one. This is now already @@ -1023,7 +1023,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const Point aOldPos(bUseRightEdge ? GetFlyFrame()->getFrameArea().TopRight() : GetFlyFrame()->getFrameArea().Pos()); // get target size in old coordinate system - Size aSz( aOutRect.Right() - aOutRect.Left() + 1, aOutRect.Bottom()- aOutRect.Top() + 1 ); + Size aSz( m_aOutRect.Right() - m_aOutRect.Left() + 1, m_aOutRect.Bottom()- m_aOutRect.Top() + 1 ); // compare with restored FrameArea if( aSz != GetFlyFrame()->getFrameArea().SSize() ) @@ -1091,7 +1091,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const } //Position can also be changed, get new one - const Point aNewPos(bUseRightEdge ? aOutRect.Right() + 1 : aOutRect.Left(), aOutRect.Top()); + const Point aNewPos(bUseRightEdge ? m_aOutRect.Right() + 1 : m_aOutRect.Left(), m_aOutRect.Top()); if ( aNewPos == aOldPos ) return; @@ -1104,7 +1104,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const const Size aDeltaMove( aNewPos.X() - aOldPos.X(), aNewPos.Y() - aOldPos.Y()); - aOutRect.Move(-aDeltaMove.Width(), -aDeltaMove.Height()); + m_aOutRect.Move(-aDeltaMove.Width(), -aDeltaMove.Height()); // Now, move as needed (no empty delta which was a hack anyways) if(bIsTransformableSwFrame) @@ -1112,7 +1112,7 @@ void SwVirtFlyDrawObj::NbcResize(const Point& rRef, const Fraction& xFact, const // need to save aOutRect to FrameArea, will be restored to aOutRect in // SwVirtFlyDrawObj::NbcMove currently for TransformableSwFrames SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*GetFlyFrame()); - aFrm.setSwRect(aOutRect); + aFrm.setSwRect(m_aOutRect); } // keep old hack - not clear what happens here |