sw/source/core/crsr/viscrs.cxx | 6 sw/source/core/draw/dcontact.cxx | 2 sw/source/core/draw/dflyobj.cxx | 4 sw/source/core/fields/postithelper.cxx | 2 sw/source/core/frmedt/feshview.cxx | 10 - sw/source/core/frmedt/fetab.cxx | 6 sw/source/core/frmedt/fews.cxx | 2 sw/source/core/layout/anchoredobject.cxx | 2 sw/source/core/layout/atrfrm.cxx | 2 sw/source/core/layout/calcmove.cxx | 34 ++-- sw/source/core/layout/findfrm.cxx | 2 sw/source/core/layout/fly.cxx | 12 - sw/source/core/layout/flylay.cxx | 8 - sw/source/core/layout/frmtool.cxx | 8 - sw/source/core/layout/ftnfrm.cxx | 8 - sw/source/core/layout/laycache.cxx | 12 - sw/source/core/layout/pagechg.cxx | 11 - sw/source/core/layout/paintfrm.cxx | 87 +++++------- sw/source/core/layout/ssfrm.cxx | 20 +- sw/source/core/layout/tabfrm.cxx | 6 sw/source/core/layout/wsfrm.cxx | 26 +-- sw/source/core/objectpositioning/anchoredobjectposition.cxx | 6 sw/source/core/text/EnhancedPDFExportHelper.cxx | 2 sw/source/core/text/frmcrsr.cxx | 8 - sw/source/core/text/inftxt.cxx | 6 sw/source/core/text/itrcrsr.cxx | 44 ++---- sw/source/core/text/itrform2.cxx | 4 sw/source/core/text/txtdrop.cxx | 5 sw/source/core/text/txtfrm.cxx | 16 +- sw/source/core/view/viewsh.cxx | 28 +-- sw/source/uibase/uiview/viewtab.cxx | 22 +-- sw/source/uibase/wrtsh/move.cxx | 4 sw/source/uibase/wrtsh/wrtsh1.cxx | 4 33 files changed, 198 insertions(+), 221 deletions(-)
New commits: commit 61e1bcc2fbf5fabf51ded2e251d332cb6abbe437 Author: Mike Kaganski <[email protected]> AuthorDate: Wed Dec 17 00:32:47 2025 +0500 Commit: Mike Kaganski <[email protected]> CommitDate: Wed Dec 17 06:10:01 2025 +0100 Minimize use of non-const SwRect::Pos() Use dedicated setters instead. This makes the code clearer for me. Change-Id: I6280583792994d2fc1843a8af61ba5df644a72f3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/195740 Tested-by: Jenkins Reviewed-by: Mike Kaganski <[email protected]> diff --git a/sw/source/core/crsr/viscrs.cxx b/sw/source/core/crsr/viscrs.cxx index c301d7a9085c..390c606b79cd 100644 --- a/sw/source/core/crsr/viscrs.cxx +++ b/sw/source/core/crsr/viscrs.cxx @@ -152,16 +152,16 @@ SwRect SwVisibleCursor::SetPos() m_aTextCursor.SetOrientation( 900_deg10 ); aRect = SwRect( m_rState.m_aCharRect.Pos(), Size( m_rState.m_aCharRect.Height(), nTmpY ) ); - aRect.Pos().setX(aRect.Pos().getX() + m_rState.m_aCursorHeight.getX()); + aRect.SetPosX(aRect.Pos().getX() + m_rState.m_aCursorHeight.getX()); if (m_rState.IsOverwriteCursor()) - aRect.Pos().setY(aRect.Pos().getY() + aRect.Width()); + aRect.SetPosY(aRect.Pos().getY() + aRect.Width()); } else { m_aTextCursor.SetOrientation(); aRect = SwRect( m_rState.m_aCharRect.Pos(), Size( m_rState.m_aCharRect.Width(), nTmpY ) ); - aRect.Pos().setY(aRect.Pos().getY() + m_rState.m_aCursorHeight.getX()); + aRect.SetPosY(aRect.Pos().getY() + m_rState.m_aCursorHeight.getX()); } // check if cursor should show the current cursor bidi level diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx index 1f1566453ce4..2421f2a3622c 100644 --- a/sw/source/core/draw/dcontact.cxx +++ b/sw/source/core/draw/dcontact.cxx @@ -906,7 +906,7 @@ void SwDrawContact::NotifyBackgroundOfAllVirtObjs(const tools::Rectangle* pOldBo if( pOldBoundRect && pPage ) { SwRect aOldRect( *pOldBoundRect ); - aOldRect.Pos() += pDrawVirtObj->GetOffset(); + aOldRect += pDrawVirtObj->GetOffset(); if( aOldRect.HasArea() ) ::Notify_Background( pDrawVirtObj, pPage, aOldRect, PrepareHint::FlyFrameLeave,true); diff --git a/sw/source/core/draw/dflyobj.cxx b/sw/source/core/draw/dflyobj.cxx index acb7a9748cf6..326e9ba1c11b 100644 --- a/sw/source/core/draw/dflyobj.cxx +++ b/sw/source/core/draw/dflyobj.cxx @@ -1299,8 +1299,8 @@ SdrObject* SwVirtFlyDrawObj::CheckMacroHit( const SdrObjMacroHitRec& rRec ) cons if( aRect.Contains( rRec.aPos ) ) { - aRect.Pos().setX(aRect.Pos().getX() + rRec.nTol); - aRect.Pos().setY(aRect.Pos().getY() + rRec.nTol); + aRect.SetPosX(aRect.Pos().getX() + rRec.nTol); + aRect.SetPosY(aRect.Pos().getY() + rRec.nTol); aRect.AddHeight( -(2 * rRec.nTol) ); aRect.AddWidth( -(2 * rRec.nTol) ); diff --git a/sw/source/core/fields/postithelper.cxx b/sw/source/core/fields/postithelper.cxx index 9e44c55a797a..1e6993f6b629 100644 --- a/sw/source/core/fields/postithelper.cxx +++ b/sw/source/core/fields/postithelper.cxx @@ -179,7 +179,7 @@ SwPostItHelper::SwLayoutStatus SwPostItHelper::getLayoutInfos( } o_rInfo.mPageFrame = pPage->getFrameArea(); o_rInfo.mPagePrtArea = pPage->getFramePrintArea(); - o_rInfo.mPagePrtArea.Pos() += o_rInfo.mPageFrame.Pos(); + o_rInfo.mPagePrtArea += o_rInfo.mPageFrame.Pos(); o_rInfo.mnPageNumber = pPage->GetPhyPageNum(); o_rInfo.meSidebarPosition = pPage->SidebarPosition(); o_rInfo.mRedlineAuthor = 0; diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index da3f89930b5b..06a4f6aa3c4d 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -892,7 +892,7 @@ const SwFrameFormat* SwFEShell::SelFlyGrabCursor() SwRect& rChrRect = const_cast<SwRect&>(GetCharRect()); rChrRect = pFly->getFramePrintArea(); - rChrRect.Pos() += pFly->getFrameArea().Pos(); + rChrRect += pFly->getFrameArea().Pos(); GetCursorDocPos() = rChrRect.Pos(); } return pFly->GetFormat(); @@ -928,7 +928,7 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst ) bCheckNeighbours = true; pFly->InvalidatePos(); SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*pFly); - aFrm.Pos().AdjustY(1 ); + aFrm.SetPosY(aFrm.Pos().Y() + 1); } pPage = pFly->FindPageFrame(); @@ -979,7 +979,7 @@ static void lcl_NotifyNeighbours( const SdrMarkList *pLst ) { pAct->InvalidatePos(); SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*pAct); - aFrm.Pos().AdjustY(1 ); + aFrm.SetPosY(aFrm.Pos().Y() + 1); } } } @@ -2655,7 +2655,7 @@ bool SwFEShell::GotoFly( const UIName& rName, FlyCntType eType, bool bSelFrame ) SwRect& rChrRect = const_cast<SwRect&>(GetCharRect()); rChrRect = pFrame->getFramePrintArea(); - rChrRect.Pos() += pFrame->getFrameArea().Pos(); + rChrRect += pFrame->getFrameArea().Pos(); GetCursorDocPos() = rChrRect.Pos(); } } @@ -2843,7 +2843,7 @@ void SwFEShell::CheckUnboundObjects() : *static_cast<SwNoTextFrame const*>(pAnch)->GetNode() ); aAnch.SetType( RndStdIds::FLY_AT_PARA ); aAnch.SetAnchor( &aPos ); - const_cast<SwRect&>(GetCharRect()).Pos() = aPt; + const_cast<SwRect&>(GetCharRect()).Pos(aPt); } // First the action here, to assure GetCharRect delivers current values. diff --git a/sw/source/core/frmedt/fetab.cxx b/sw/source/core/frmedt/fetab.cxx index 92373faa1428..a4c17d77be79 100644 --- a/sw/source/core/frmedt/fetab.cxx +++ b/sw/source/core/frmedt/fetab.cxx @@ -1693,7 +1693,7 @@ static const SwCellFrame *lcl_FindFrame( SwDoc & rDoc, const SwLayoutFrame *pLay const bool bRTL = pFrame->IsRightToLeft(); SwRect aTabRect = pFrame->getFramePrintArea(); - aTabRect.Pos() += pFrame->getFrameArea().Pos(); + aTabRect += pFrame->getFrameArea().Pos(); const SwTwips nLeft = bRTL ? aRectFnSet.GetRight(aTabRect) : @@ -1715,7 +1715,7 @@ static const SwCellFrame *lcl_FindFrame( SwDoc & rDoc, const SwLayoutFrame *pLay if ( pPrev ) { SwRect aPrevRect = pPrev->getFramePrintArea(); - aPrevRect.Pos() += pPrev->getFrameArea().Pos(); + aPrevRect += pPrev->getFrameArea().Pos(); if( aPrevRect.Contains( rPt ) ) { @@ -1801,7 +1801,7 @@ static const SwCellFrame *lcl_FindFrame( SwDoc & rDoc, const SwLayoutFrame *pLay // used for mouse move of columns/rows const SwTabFrame* pTabFrame = pFrame->FindTabFrame(); SwRect aTabRect = pTabFrame->getFramePrintArea(); - aTabRect.Pos() += pTabFrame->getFrameArea().Pos(); + aTabRect += pTabFrame->getFrameArea().Pos(); SwRectFnSet aRectFnSet(*pTabFrame); diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 1f721e6bf1ba..20e6bd14b9b4 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -938,7 +938,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, if ( _bFollowTextFlow ) { aVertEnvironRect = rVertEnvironLayFrame.getFramePrintArea(); - aVertEnvironRect.Pos() += rVertEnvironLayFrame.getFrameArea().Pos(); + aVertEnvironRect += rVertEnvironLayFrame.getFrameArea().Pos(); // #i18732# - adjust vertical 'virtual' anchor position // (<aPos.Y()> respectively <aPos.X()>), if object is vertical aligned // to page areas. diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx index c8c418fa310f..d71a1599c1c6 100644 --- a/sw/source/core/layout/anchoredobject.cxx +++ b/sw/source/core/layout/anchoredobject.cxx @@ -173,7 +173,7 @@ SwTwips SwAnchoredObject::GetRelCharY( const SwFrame* pFrame ) const void SwAnchoredObject::AddLastCharY( tools::Long nDiff ) { - maLastCharRect.Pos().AdjustY(nDiff ); + maLastCharRect.SetPosY(maLastCharRect.Pos().Y() + nDiff); } void SwAnchoredObject::ResetLastCharRectHeight() diff --git a/sw/source/core/layout/atrfrm.cxx b/sw/source/core/layout/atrfrm.cxx index 1d80a2918c9f..edc33f3243e1 100644 --- a/sw/source/core/layout/atrfrm.cxx +++ b/sw/source/core/layout/atrfrm.cxx @@ -2884,7 +2884,7 @@ SwRect SwFrameFormat::FindLayoutRect( const bool bPrtArea, const Point* pPoint ) else { aRet = pFrame->getFrameArea(); - aRet.Pos().AdjustY( -1 ); + aRet.SetPosY(aRet.Pos().Y() - 1); } pFrame = nullptr; // the rect is finished by now } diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 1fdc0c047e5e..4e7233b040e4 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -108,7 +108,7 @@ bool SwContentFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool & ) const IDocumentSettingAccess& rIDSA = pNewPage->GetFormat()->getIDocumentSettingAccess(); SwTwips nSpace = 0; SwRect aRect( pNewUpper->getFramePrintArea() ); - aRect.Pos() += pNewUpper->getFrameArea().Pos(); + aRect += pNewUpper->getFrameArea().Pos(); const SwFrame *pPrevFrame = pNewUpper->Lower(); while ( pPrevFrame ) { @@ -602,23 +602,23 @@ void SwFrame::MakePos() // cells may now leave their uppers if( aRectFnSet.IsVert() && SwFrameType::Cell & nMyType ) { - aFrm.Pos().setX(aFrm.Pos().getX() - aFrm.Width() + pPrv->getFrameArea().Width()); + aFrm.SetPosX(aFrm.Pos().getX() - aFrm.Width() + pPrv->getFrameArea().Width()); } } else if( aRectFnSet.IsVert() && FRM_NOTE_VERT & nMyType ) { if ( aRectFnSet.IsVertL2R() ) { - aFrm.Pos().setX(aFrm.Pos().getX() + pPrv->getFrameArea().Width()); + aFrm.SetPosX(aFrm.Pos().getX() + pPrv->getFrameArea().Width()); } else { - aFrm.Pos().setX(aFrm.Pos().getX() - aFrm.Width()); + aFrm.SetPosX(aFrm.Pos().getX() - aFrm.Width()); } } else { - aFrm.Pos().setY(aFrm.Pos().getY() + pPrv->getFrameArea().Height()); + aFrm.SetPosY(aFrm.Pos().getY() + pPrv->getFrameArea().Height()); } } else if ( GetUpper() ) @@ -663,16 +663,16 @@ void SwFrame::MakePos() // cells may now leave their uppers if( aRectFnSet.IsVert() && SwFrameType::Cell & nMyType ) { - aFrm.Pos().setX(aFrm.Pos().getX() - aFrm.Width() + pPrv->getFrameArea().Width()); + aFrm.SetPosX(aFrm.Pos().getX() - aFrm.Width() + pPrv->getFrameArea().Width()); } } else if( aRectFnSet.IsVert() && FRM_NOTE_VERT & nMyType ) { - aFrm.Pos().setX(aFrm.Pos().getX() - aFrm.Width()); + aFrm.SetPosX(aFrm.Pos().getX() - aFrm.Width()); } else { - aFrm.Pos().setY(aFrm.Pos().getY() + pPrv->getFrameArea().Height()); + aFrm.SetPosY(aFrm.Pos().getY() + pPrv->getFrameArea().Height()); } } else @@ -682,41 +682,40 @@ void SwFrame::MakePos() if( GetUpper()->IsFlyFrame() ) { - aFrm.Pos() += static_cast<SwFlyFrame*>(GetUpper())->ContentPos(); + aFrm += static_cast<SwFlyFrame*>(GetUpper())->ContentPos(); } else { - aFrm.Pos() += GetUpper()->getFramePrintArea().Pos(); + aFrm += GetUpper()->getFramePrintArea().Pos(); } if( FRM_NEIGHBOUR & nMyType && IsRightToLeft() ) { if( aRectFnSet.IsVert() ) { - aFrm.Pos().setY(aFrm.Pos().getY() + GetUpper()->getFramePrintArea().Height() - aFrm.Height()); + aFrm.SetPosY(aFrm.Pos().getY() + GetUpper()->getFramePrintArea().Height() - aFrm.Height()); } else { - aFrm.Pos().setX(aFrm.Pos().getX() + GetUpper()->getFramePrintArea().Width() - aFrm.Width()); + aFrm.SetPosX(aFrm.Pos().getX() + GetUpper()->getFramePrintArea().Width() - aFrm.Width()); } } else if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && FRM_NOTE_VERT & nMyType ) { - aFrm.Pos().setX(aFrm.Pos().getX() - aFrm.Width() + GetUpper()->getFramePrintArea().Width()); + aFrm.SetPosX(aFrm.Pos().getX() - aFrm.Width() + GetUpper()->getFramePrintArea().Width()); } } } else { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().setX(0); - aFrm.Pos().setY(0); + aFrm.Pos(0, 0); } if( IsBodyFrame() && aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() && GetUpper() ) { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().setX(aFrm.Pos().getX() + GetUpper()->getFramePrintArea().Width() - aFrm.Width()); + aFrm.SetPosX(aFrm.Pos().getX() + GetUpper()->getFramePrintArea().Width() - aFrm.Width()); } setFrameAreaPositionValid(true); @@ -1176,8 +1175,7 @@ void SwContentFrame::MakePrtArea( const SwBorderAttrs &rAttrs ) { SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this); - aPrt.Pos().setX(0); - aPrt.Pos().setY(0); + aPrt.Pos(0, 0); aRectFnSet.SetWidth( aPrt, aRectFnSet.GetWidth(getFrameArea()) ); aRectFnSet.SetHeight( aPrt, 0 ); } diff --git a/sw/source/core/layout/findfrm.cxx b/sw/source/core/layout/findfrm.cxx index f7a3bbd36d9d..cb6d0222ce6c 100644 --- a/sw/source/core/layout/findfrm.cxx +++ b/sw/source/core/layout/findfrm.cxx @@ -724,7 +724,7 @@ const SwPageFrame* SwRootFrame::GetPageAtPos( const Point& rPt, const Size* pSiz SwRect aRect; if ( pSize ) { - aRect.Pos() = rPt; + aRect.Pos(rPt); aRect.SSize( *pSize ); } diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index e1c2a35e8a24..eff4eb6619dd 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -242,8 +242,7 @@ SwFlyFrame::SwFlyFrame( SwFlyFrameFormat *pFormat, SwFrame* pSib, SwFrame *pAnch // Put it somewhere outside so that out document is not formatted unnecessarily often SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().setX(FAR_AWAY); - aFrm.Pos().setY(FAR_AWAY); + aFrm.Pos(FAR_AWAY, FAR_AWAY); } void SwFlyFrame::Chain( SwFrame* _pAnch ) @@ -1496,8 +1495,7 @@ void SwFlyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorderA // Remove safety switch (see SwFrame::CTor) { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().setX(0); - aFrm.Pos().setY(0); + aFrm.Pos(0, 0); } // #i68520# @@ -2066,7 +2064,7 @@ void SwFlyFrame::MakeObjPos() SwRectFnSet aRectFnSet(*GetAnchorFrame()); SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); aFrm.Pos( aObjPositioning.GetRelPos() ); - aFrm.Pos() += aRectFnSet.GetPos(GetAnchorFrame()->getFrameArea()); + aFrm += aRectFnSet.GetPos(GetAnchorFrame()->getFrameArea()); } // #i69335# @@ -3363,7 +3361,7 @@ bool SwFlyFrame::SetObjTop_( const SwTwips _nTop ) { const bool bChanged( getFrameArea().Pos().getY() != _nTop ); SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().setY(_nTop); + aFrm.SetPosY(_nTop); return bChanged; } @@ -3371,7 +3369,7 @@ bool SwFlyFrame::SetObjLeft_( const SwTwips _nLeft ) { const bool bChanged( getFrameArea().Pos().getX() != _nLeft ); SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().setX(_nLeft); + aFrm.SetPosX(_nLeft); return bChanged; } diff --git a/sw/source/core/layout/flylay.cxx b/sw/source/core/layout/flylay.cxx index fdfd175de6d8..ea565f766a9c 100644 --- a/sw/source/core/layout/flylay.cxx +++ b/sw/source/core/layout/flylay.cxx @@ -511,7 +511,7 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz ) if ( !bDisableOffPagePositioning || nOld <= nClipBot) { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().setY( std::max( aClip.Top(), nClipBot - aFrm.Height() ) ); + aFrm.SetPosY( std::max( aClip.Top(), nClipBot - aFrm.Height() ) ); } if ( getFrameArea().Top() != nOld ) @@ -531,7 +531,7 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz ) if ( !bDisableOffPagePositioning || nOld <= nClipRig ) { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().setX( std::max( aClip.Left(), nClipRig - aFrm.Width() ) ); + aFrm.SetPosX( std::max( aClip.Left(), nClipRig - aFrm.Width() ) ); } if ( getFrameArea().Left() != nOld ) @@ -542,7 +542,7 @@ void SwFlyFreeFrame::CheckClip( const SwFormatFrameSize &rSz ) if( rH.GetHoriOrient() == text::HoriOrientation::LEFT ) { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().setX( nOld ); + aFrm.SetPosX( nOld ); } else { @@ -1405,7 +1405,7 @@ bool CalcClipRect( const SdrObject *pSdrObj, SwRect &rRect, bool bMove ) } } rRect = pUp->getFramePrintArea(); - rRect.Pos() += pUp->getFrameArea().Pos(); + rRect += pUp->getFrameArea().Pos(); if ( pUp->GetType() & (SwFrameType::Header | SwFrameType::Footer) ) { rRect.Left ( pUp->GetUpper()->getFrameArea().Left() ); diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx index f226acbc0aa1..8f8abf11c886 100644 --- a/sw/source/core/layout/frmtool.cxx +++ b/sw/source/core/layout/frmtool.cxx @@ -1494,11 +1494,11 @@ static void lcl_SetPos( SwFrame& _rNewFrame, // notifications for a new calculated position after its formatting. if ( aRectFnSet.IsVert() ) { - aFrm.Pos().AdjustX( -1 ); + aFrm.SetPosX(aFrm.Pos().X() - 1); } else { - aFrm.Pos().AdjustY(1 ); + aFrm.SetPosY(aFrm.Pos().Y() + 1); } } @@ -3384,7 +3384,7 @@ static void lcl_NotifyContent( const SdrObject *pThis, SwContentFrame *pCnt, auto pTextFrame = static_cast<SwTextFrame*>(pCnt); SwRect aCntPrt( pCnt->getFramePrintArea() ); - aCntPrt.Pos() += pCnt->getFrameArea().Pos(); + aCntPrt += pCnt->getFrameArea().Pos(); if (eHint == PrepareHint::FlyFrameArrive) { @@ -4006,7 +4006,7 @@ bool IsExtraData( const SwDoc& rDoc ) SwRect SwPageFrame::PrtWithoutHeaderAndFooter() const { SwRect aPrtWithoutHeaderFooter( getFramePrintArea() ); - aPrtWithoutHeaderFooter.Pos() += getFrameArea().Pos(); + aPrtWithoutHeaderFooter += getFrameArea().Pos(); const SwFrame* pLowerFrame = Lower(); while ( pLowerFrame ) diff --git a/sw/source/core/layout/ftnfrm.cxx b/sw/source/core/layout/ftnfrm.cxx index 308f9deddb08..0779e1661afd 100644 --- a/sw/source/core/layout/ftnfrm.cxx +++ b/sw/source/core/layout/ftnfrm.cxx @@ -453,7 +453,7 @@ SwTwips SwFootnoteContFrame::GrowFrame(SwTwips nDist, SwResizeLimitReason& reaso if( IsVertical() && !IsVertLR() ) { - aFrm.Pos().AdjustX( -nDist ); + aFrm.SetPosX(aFrm.Pos().X() - nDist); } } tools::Long nGrow = nDist - nAvail, @@ -500,7 +500,7 @@ SwTwips SwFootnoteContFrame::GrowFrame(SwTwips nDist, SwResizeLimitReason& reaso if( IsVertical() && !IsVertLR() ) { - aFrm.Pos().AdjustX(nDist ); + aFrm.SetPosX(aFrm.Pos().X() + nDist); } } @@ -2987,8 +2987,8 @@ bool SwContentFrame::MoveFootnoteCntFwd( bool bMakePage, SwFootnoteBossFrame *pO { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*pNewUp); - aFrm.Pos() = pTmpFootnote->getFrameArea().Pos(); - aFrm.Pos().AdjustY(1 ); // for notifications + aFrm.Pos(pTmpFootnote->getFrameArea().Pos()); + aFrm.SetPosY(aFrm.Pos().Y() + 1); // for notifications } // If the section frame has a successor then the latter needs diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx index 7b758822dd3c..d7327c51abcf 100644 --- a/sw/source/core/layout/laycache.cxx +++ b/sw/source/core/layout/laycache.cxx @@ -756,8 +756,8 @@ bool SwLayHelper::CheckInsert( SwNodeOffset nNodeIndex ) { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*mrpFrame); - aFrm.Pos() = mrpLay->getFrameArea().Pos(); - aFrm.Pos().AdjustY(1 ); + aFrm.Pos(mrpLay->getFrameArea().Pos()); + aFrm.SetPosY(aFrm.Pos().Y() + 1); } mrpPrv = mrpFrame; @@ -862,8 +862,8 @@ bool SwLayHelper::CheckInsert( SwNodeOffset nNodeIndex ) { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*pSct); - aFrm.Pos() = mrpLay->getFrameArea().Pos(); - aFrm.Pos().AdjustY(1 ); //because of the notifications + aFrm.Pos(mrpLay->getFrameArea().Pos()); + aFrm.SetPosY(aFrm.Pos().Y() + 1); //because of the notifications } mrpLay = pSct; @@ -967,8 +967,8 @@ void SwLayHelper::CheckFlyCache_( SwPageFrame* pPage ) { // we get the stored information SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*pFly); - aFrm.Pos().setX( pFlyCache->Left() + pPage->getFrameArea().Left() ); - aFrm.Pos().setY( pFlyCache->Top() + pPage->getFrameArea().Top() ); + aFrm.Pos( pFlyCache->Left() + pPage->getFrameArea().Left(), + pFlyCache->Top() + pPage->getFrameArea().Top() ); if ( mpImpl->IsUseFlyCache() ) { diff --git a/sw/source/core/layout/pagechg.cxx b/sw/source/core/layout/pagechg.cxx index d62bb5b48d55..de760fbe6bac 100644 --- a/sw/source/core/layout/pagechg.cxx +++ b/sw/source/core/layout/pagechg.cxx @@ -113,7 +113,7 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder if( IsVertical() && !IsVertLR() && nWidth != aFrm.Width() ) { - aFrm.Pos().setX(aFrm.Pos().getX() + aFrm.Width() - nWidth); + aFrm.SetPosX(aFrm.Pos().getX() + aFrm.Width() - nWidth); } aFrm.Width( nWidth ); @@ -172,8 +172,7 @@ void SwBodyFrame::Format( vcl::RenderContext* /*pRenderContext*/, const SwBorder if( bNoGrid ) { SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this); - aPrt.Pos().setX(0); - aPrt.Pos().setY(0); + aPrt.Pos(0, 0); aPrt.Height( getFrameArea().Height() ); aPrt.Width( getFrameArea().Width() ); } @@ -1952,16 +1951,14 @@ void SwRootFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) { setFrameAreaPositionValid(true); SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().setX(DOCUMENTBORDER); - aFrm.Pos().setY(DOCUMENTBORDER); + aFrm.Pos(DOCUMENTBORDER, DOCUMENTBORDER); } if ( !isFramePrintAreaValid() ) { setFramePrintAreaValid(true); SwFrameAreaDefinition::FramePrintAreaWriteAccess aPrt(*this); - aPrt.Pos().setX(0); - aPrt.Pos().setY(0); + aPrt.Pos(0, 0); aPrt.SSize( getFrameArea().SSize() ); } diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index f9812b76b2fa..53e25976cc89 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -1250,14 +1250,14 @@ static void lcl_CalcBorderRect( SwRect &rRect, const SwFrame *pFrame, if( pFrame->IsSctFrame() ) { rRect = pFrame->getFramePrintArea(); - rRect.Pos() += pFrame->getFrameArea().Pos(); + rRect += pFrame->getFrameArea().Pos(); } else if ( pFrame->IsCellFrame() ) rRect = pFrame->getFrameArea(); else { rRect = pFrame->getFramePrintArea(); - rRect.Pos() += pFrame->getFrameArea().Pos(); + rRect += pFrame->getFrameArea().Pos(); SwRectFnSet fnRect(*pFrame); @@ -1828,47 +1828,42 @@ void DrawGraphic( switch ( ePos ) { case GPOS_LT: - aGrf.Pos() = rOrg.Pos(); + aGrf.Pos(rOrg.Pos()); break; case GPOS_MT: - aGrf.Pos().setY( rOrg.Top() ); - aGrf.Pos().setX( rOrg.Left() + rOrg.Width()/2 - aGrfSize.Width()/2 ); + aGrf.Pos(rOrg.Left() + rOrg.Width() / 2 - aGrfSize.Width() / 2, rOrg.Top()); break; case GPOS_RT: - aGrf.Pos().setY( rOrg.Top() ); - aGrf.Pos().setX( rOrg.Right() - aGrfSize.Width() ); + aGrf.Pos(rOrg.Right() - aGrfSize.Width(), rOrg.Top()); break; case GPOS_LM: - aGrf.Pos().setY( rOrg.Top() + rOrg.Height()/2 - aGrfSize.Height()/2 ); - aGrf.Pos().setX( rOrg.Left() ); + aGrf.Pos(rOrg.Left(), rOrg.Top() + rOrg.Height() / 2 - aGrfSize.Height() / 2); break; case GPOS_MM: - aGrf.Pos().setY( rOrg.Top() + rOrg.Height()/2 - aGrfSize.Height()/2 ); - aGrf.Pos().setX( rOrg.Left() + rOrg.Width()/2 - aGrfSize.Width()/2 ); + aGrf.Pos(rOrg.Left() + rOrg.Width() / 2 - aGrfSize.Width() / 2, + rOrg.Top() + rOrg.Height() / 2 - aGrfSize.Height() / 2); break; case GPOS_RM: - aGrf.Pos().setY( rOrg.Top() + rOrg.Height()/2 - aGrfSize.Height()/2 ); - aGrf.Pos().setX( rOrg.Right() - aGrfSize.Width() ); + aGrf.Pos(rOrg.Right() - aGrfSize.Width(), + rOrg.Top() + rOrg.Height() / 2 - aGrfSize.Height() / 2); break; case GPOS_LB: - aGrf.Pos().setY( rOrg.Bottom() - aGrfSize.Height() ); - aGrf.Pos().setX( rOrg.Left() ); + aGrf.Pos(rOrg.Left(), rOrg.Bottom() - aGrfSize.Height()); break; case GPOS_MB: - aGrf.Pos().setY( rOrg.Bottom() - aGrfSize.Height() ); - aGrf.Pos().setX( rOrg.Left() + rOrg.Width()/2 - aGrfSize.Width()/2 ); + aGrf.Pos(rOrg.Left() + rOrg.Width() / 2 - aGrfSize.Width() / 2, + rOrg.Bottom() - aGrfSize.Height()); break; case GPOS_RB: - aGrf.Pos().setY( rOrg.Bottom() - aGrfSize.Height() ); - aGrf.Pos().setX( rOrg.Right() - aGrfSize.Width() ); + aGrf.Pos(rOrg.Right() - aGrfSize.Width(), rOrg.Bottom() - aGrfSize.Height()); break; case GPOS_AREA: @@ -1896,7 +1891,7 @@ void DrawGraphic( // set left-top-corner of background graphic to left-top-corner of the // area, from which the background brush is determined. - aGrf.Pos() = rOrg.Pos(); + aGrf.Pos(rOrg.Pos()); // setup clipping at output device auto popIt = rOutDev.ScopedPush(vcl::PushFlags::CLIPREGION); rOutDev.IntersectClipRegion( rOut.SVRect() ); @@ -2447,7 +2442,7 @@ void SwTabFramePainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) cons const SwFrame* pUpper = mrTabFrame.GetUpper(); SwRect aUpper( pUpper->getFramePrintArea() ); - aUpper.Pos() += pUpper->getFrameArea().Pos(); + aUpper += pUpper->getFrameArea().Pos(); SwRect aUpperAligned( aUpper ); ::SwAlignRect( aUpperAligned, gProp.pSGlobalShell, &rDev ); @@ -2502,7 +2497,7 @@ void SwTabFramePainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) cons if ( bHori ) { aRepaintRect.Height( 2 * nRepaintRectSize ); - aRepaintRect.Pos().AdjustY( -nRepaintRectSize ); + aRepaintRect.SetPosY(aRepaintRect.Pos().Y() - nRepaintRectSize); // To decide on visibility it is also necessary to expand the RepaintRect // to left/right according existing BorderLine overlap matchings, else there @@ -2513,13 +2508,13 @@ void SwTabFramePainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) cons const double fLineWidthMaxLeft(std::max(aStyles[1].GetWidth(), aStyles[3].GetWidth())); const double fLineWidthMaxRight(std::max(aStyles[4].GetWidth(), aStyles[6].GetWidth())); aRepaintRect.Width(aRepaintRect.Width() + (fLineWidthMaxLeft + fLineWidthMaxRight)); - aRepaintRect.Pos().AdjustX( -fLineWidthMaxLeft ); + aRepaintRect.SetPosX(aRepaintRect.Pos().X() - fLineWidthMaxLeft); } } else { aRepaintRect.Width( 2 * nRepaintRectSize ); - aRepaintRect.Pos().AdjustX( -nRepaintRectSize ); + aRepaintRect.SetPosX(aRepaintRect.Pos().X() - nRepaintRectSize); // Accordingly to horizontal case, but for top/bottom // aStyles[3] == aTFromR, aStyles[1] == aTFromL, aStyles[6] == aBFromR, aStyles[4] == aBFromL @@ -2528,7 +2523,7 @@ void SwTabFramePainter::PaintLines(OutputDevice& rDev, const SwRect& rRect) cons const double fLineWidthMaxTop(std::max(aStyles[3].GetWidth(), aStyles[1].GetWidth())); const double fLineWidthMaxBottom(std::max(aStyles[6].GetWidth(), aStyles[4].GetWidth())); aRepaintRect.Height(aRepaintRect.Height() + (fLineWidthMaxTop + fLineWidthMaxBottom)); - aRepaintRect.Pos().AdjustY( -fLineWidthMaxTop ); + aRepaintRect.SetPosY(aRepaintRect.Pos().Y() - fLineWidthMaxTop); } } @@ -3911,7 +3906,7 @@ void SwColumnFrame::PaintBreak( ) const return; SwRect aRect( pCnt->getFramePrintArea() ); - aRect.Pos() += pCnt->getFrameArea().Pos(); + aRect += pCnt->getFrameArea().Pos(); // Draw the line basegfx::B2DPoint aStart( double( aRect.Left() ), aRect.Top() ); @@ -4664,7 +4659,7 @@ void SwTabFrame::PaintSwFrame(vcl::RenderContext& rRenderContext, SwRect const& { // #i6467# - intersect output rectangle with table frame SwRect aTabRect( getFramePrintArea() ); - aTabRect.Pos() += getFrameArea().Pos(); + aTabRect += getFrameArea().Pos(); SwRect aTabOutRect( rRect ); aTabOutRect.Intersection( aTabRect ); SwViewOption::DrawRect( &rRenderContext, aTabOutRect, COL_LIGHTGRAY ); @@ -5750,7 +5745,7 @@ void SwFootnoteContFrame::PaintSwFrameShadowAndBorder( //If the rectangle is completely inside the PrtArea, no border needs to //be painted. SwRect aRect( getFramePrintArea() ); - aRect.Pos() += getFrameArea().Pos(); + aRect += getFrameArea().Pos(); if ( !aRect.Contains( rRect ) ) PaintLine( rRect, pPage ); } @@ -5943,7 +5938,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co bool bBorder = bLeft || bRight; while( nY > nRight ) { - aTmp.Pos().setX( nY ); + aTmp.SetPosX(nY); if( bGrid ) { nY -= nGrid; @@ -5958,7 +5953,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co while( aVert.Top() <= nBottom ) { PaintBorderLine(rRect,aVert,this,pCol); - aVert.Pos().AdjustY(nGrid ); + aVert.SetPosY(aVert.Pos().Y() + nGrid); } } else if( bBorder ) @@ -5969,7 +5964,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co PaintBorderLine(rRect,aVert,this,pCol); if( bRight ) { - aVert.Pos().setY( nGridBottom ); + aVert.SetPosY(nGridBottom); PaintBorderLine(rRect,aVert,this,pCol); } } @@ -5990,7 +5985,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co PaintBorderLine(rRect,aVert,this,pCol); if( bRight ) { - aVert.Pos().setY( nGridBottom ); + aVert.SetPosY(nGridBottom); PaintBorderLine(rRect,aVert,this,pCol); } } @@ -6000,7 +5995,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co } while( nY >= aInter.Left() ) { - aTmp.Pos().setX( nY ); + aTmp.SetPosX(nY); PaintBorderLine( rRect, aTmp, this, pCol); if( bGrid ) { @@ -6016,7 +6011,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co while( aVert.Top() <= nBottom ) { PaintBorderLine(rRect,aVert,this,pCol); - aVert.Pos().AdjustY(nGrid ); + aVert.SetPosY(aVert.Pos().Y() + nGrid); } } else if( bBorder ) @@ -6027,7 +6022,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co PaintBorderLine(rRect,aVert,this,pCol); if( bRight ) { - aVert.Pos().setY( nGridBottom ); + aVert.SetPosY(nGridBottom); PaintBorderLine(rRect,aVert,this,pCol); } } @@ -6048,7 +6043,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co PaintBorderLine(rRect,aVert,this,pCol); if( bRight ) { - aVert.Pos().setY( nGridBottom ); + aVert.SetPosY(nGridBottom); PaintBorderLine(rRect,aVert,this,pCol); } } @@ -6074,7 +6069,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co bool bBorder = bLeft || bRight; while( nY < aInter.Top() ) { - aTmp.Pos().setY(nY); + aTmp.SetPosY(nY); if( bGrid ) { nY += nGrid; @@ -6089,7 +6084,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co while( aVert.Left() <= nRight ) { PaintBorderLine(rRect,aVert,this,pCol); - aVert.Pos().AdjustX(nGridWidth ); //for textgrid refactor + aVert.SetPosX(aVert.Pos().X() + nGridWidth); //for textgrid refactor } } else if ( bBorder ) @@ -6100,7 +6095,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co PaintBorderLine(rRect,aVert,this,pCol); if( bRight ) { - aVert.Pos().setX( nGridRight ); + aVert.SetPosX(nGridRight); PaintBorderLine(rRect,aVert,this,pCol); } } @@ -6121,7 +6116,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co PaintBorderLine(rRect,aVert,this,pCol); if( bRight ) { - aVert.Pos().setX(nGridRight); + aVert.SetPosX(nGridRight); PaintBorderLine(rRect,aVert,this,pCol); } } @@ -6131,7 +6126,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co } while( nY <= nBottom ) { - aTmp.Pos().setY(nY); + aTmp.SetPosY(nY); PaintBorderLine( rRect, aTmp, this, pCol); if( bGrid ) { @@ -6146,7 +6141,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co while( aVert.Left() <= nRight ) { PaintBorderLine( rRect, aVert, this, pCol); - aVert.Pos().setX(aVert.Pos().getX() + nGridWidth); //for textgrid refactor + aVert.SetPosX(aVert.Pos().getX() + nGridWidth); //for textgrid refactor } } else if( bBorder ) @@ -6157,7 +6152,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co PaintBorderLine(rRect,aVert,this,pCol); if( bRight ) { - aVert.Pos().setX(nGridRight); + aVert.SetPosX(nGridRight); PaintBorderLine(rRect,aVert,this,pCol); } } @@ -6178,7 +6173,7 @@ void SwPageFrame::PaintGrid( OutputDevice const * pOut, SwRect const &rRect ) co PaintBorderLine(rRect,aVert,this,pCol); if( bRight ) { - aVert.Pos().setX(nGridRight); + aVert.SetPosX(nGridRight); PaintBorderLine(rRect,aVert,this,pCol); } } @@ -7548,7 +7543,7 @@ std::vector<basegfx::B2DPolygon> SwHeadFootFrame::GetSubsidiaryLinesPolygons(con return aPolygons; SwRect aArea( getFramePrintArea() ); - aArea.Pos() += getFrameArea().Pos(); + aArea += getFrameArea().Pos(); if (!rViewShell.GetViewOptions()->IsTextBoundariesFull( )) aPolygons = lcl_CreatePageAreaDelimiterPolygons(aArea, true /* header/footer*/); else @@ -7629,7 +7624,7 @@ void SwLayoutFrame::PaintSubsidiaryLines( const SwPageFrame *pPage, const bool bUseFrameArea = bCell || IsSctFrame(); SwRect aOriginal( bUseFrameArea ? getFrameArea() : getFramePrintArea() ); if ( !bUseFrameArea ) - aOriginal.Pos() += getFrameArea().Pos(); + aOriginal += getFrameArea().Pos(); ::SwAlignRect( aOriginal, gProp.pSGlobalShell, gProp.pSGlobalShell->GetOut() ); diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx index 98b875736d35..3ab3b5cdecd0 100644 --- a/sw/source/core/layout/ssfrm.cxx +++ b/sw/source/core/layout/ssfrm.cxx @@ -107,17 +107,17 @@ void SwFrame::MakeBelowPos( const SwFrame* pUp, const SwFrame* pPrv, bool bNotif if( pPrv ) { aFrm.Pos( pPrv->getFrameArea().Pos() ); - aFrm.Pos().AdjustY(pPrv->getFrameArea().Height() ); + aFrm.SetPosY(aFrm.Pos().Y() + pPrv->getFrameArea().Height()); } else { aFrm.Pos( pUp->getFrameArea().Pos() ); - aFrm.Pos() += pUp->getFramePrintArea().Pos(); + aFrm += pUp->getFramePrintArea().Pos(); } if( bNotify ) { - aFrm.Pos().AdjustY(1 ); + aFrm.SetPosY(aFrm.Pos().Y() + 1); } } @@ -128,18 +128,18 @@ void SwFrame::MakeLeftPos( const SwFrame* pUp, const SwFrame* pPrv, bool bNotify if( pPrv ) { aFrm.Pos( pPrv->getFrameArea().Pos() ); - aFrm.Pos().AdjustX( -(aFrm.Width()) ); + aFrm.SetPosX(aFrm.Pos().X() - aFrm.Width()); } else { aFrm.Pos( pUp->getFrameArea().Pos() ); - aFrm.Pos() += pUp->getFramePrintArea().Pos(); - aFrm.Pos().AdjustX(pUp->getFramePrintArea().Width() - aFrm.Width() ); + aFrm += pUp->getFramePrintArea().Pos(); + aFrm.SetPosX(aFrm.Pos().X() + pUp->getFramePrintArea().Width() - aFrm.Width()); } if( bNotify ) { - aFrm.Pos().AdjustX( -1 ); + aFrm.SetPosX(aFrm.Pos().X() - 1); } } @@ -150,17 +150,17 @@ void SwFrame::MakeRightPos( const SwFrame* pUp, const SwFrame* pPrv, bool bNotif if( pPrv ) { aFrm.Pos( pPrv->getFrameArea().Pos() ); - aFrm.Pos().AdjustX(pPrv->getFrameArea().Width() ); + aFrm.SetPosX(aFrm.Pos().X() + pPrv->getFrameArea().Width()); } else { aFrm.Pos( pUp->getFrameArea().Pos() ); - aFrm.Pos() += pUp->getFramePrintArea().Pos(); + aFrm += pUp->getFramePrintArea().Pos(); } if( bNotify ) { - aFrm.Pos().AdjustX(1 ); + aFrm.SetPosX(aFrm.Pos().X() + 1); } } diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index bf525e7c313c..8d7ab18c2eed 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -4328,7 +4328,7 @@ bool SwTabFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool &rReformat ) if( !bMoveAnyway ) { SwRect aRect( pNewUpper->getFramePrintArea() ); - aRect.Pos() += pNewUpper->getFrameArea().Pos(); + aRect += pNewUpper->getFrameArea().Pos(); const SwFrame *pPrevFrame = pNewUpper->Lower(); while ( pPrevFrame && pPrevFrame != this ) { @@ -5672,7 +5672,7 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) if( IsVertical() && !IsVertLR() ) { - aFrm.Pos().AdjustX(nReal ); + aFrm.SetPosX(aFrm.Pos().X() + nReal); } } @@ -5691,7 +5691,7 @@ SwTwips SwRowFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) if( IsVertical() && !IsVertLR() ) { - aFrm.Pos().AdjustX( -nReal ); + aFrm.SetPosX(aFrm.Pos().X() - nReal); } } nReal = nTmp; diff --git a/sw/source/core/layout/wsfrm.cxx b/sw/source/core/layout/wsfrm.cxx index 8d8b78460ae3..6f53cccf3899 100644 --- a/sw/source/core/layout/wsfrm.cxx +++ b/sw/source/core/layout/wsfrm.cxx @@ -155,12 +155,12 @@ void SwFrameAreaDefinition::transform_translate(const Point& rOffset) if (aFrm.Pos().X() != FAR_AWAY) { - aFrm.Pos().AdjustX(rOffset.X() ); + aFrm.SetPosX(aFrm.Pos().X() + rOffset.X()); } if (aFrm.Pos().Y() != FAR_AWAY) { - aFrm.Pos().AdjustY(rOffset.Y() ); + aFrm.SetPosY(aFrm.Pos().Y() + rOffset.Y()); } } @@ -1695,7 +1695,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) SwRect aInva( pUp->getFrameArea() ); if ( pViewShell ) { - aInva.Pos().setX( pViewShell->VisArea().Left() ); + aInva.SetPosX(pViewShell->VisArea().Left()); aInva.Width( pViewShell->VisArea().Width() ); } if ( nDiff > 0 ) @@ -1922,7 +1922,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() ) { - aFrm.Pos().AdjustX(nAdd ); + aFrm.SetPosX(aFrm.Pos().X() + nAdd); } } @@ -1947,7 +1947,7 @@ SwTwips SwFrame::AdjustNeighbourhood( SwTwips nDiff, bool bTst ) if( aRectFnSet.IsVert() && !aRectFnSet.IsVertL2R() ) { - aFrm.Pos().AdjustX(nReal ); + aFrm.SetPosX(aFrm.Pos().X() + nReal); } } @@ -2181,7 +2181,7 @@ SwTwips SwContentFrame::GrowFrame(SwTwips nDist, SwResizeLimitReason& reason, bo if( IsVertical() && !IsVertLR() ) { - aFrm.Pos().AdjustX( -nDist ); + aFrm.SetPosX(aFrm.Pos().X() - nDist); } } @@ -2227,7 +2227,7 @@ SwTwips SwContentFrame::GrowFrame(SwTwips nDist, SwResizeLimitReason& reason, bo if( IsVertical()&& !IsVertLR() ) { - aFrm.Pos().AdjustX( -nDist ); + aFrm.SetPosX(aFrm.Pos().X() - nDist); } } @@ -2326,7 +2326,7 @@ SwTwips SwContentFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) if( IsVertical() && !IsVertLR() ) { - aFrm.Pos().AdjustX(nDist ); + aFrm.SetPosX(aFrm.Pos().X() + nDist); } } @@ -2772,7 +2772,7 @@ SwTwips SwLayoutFrame::GrowFrame(SwTwips nDist, SwResizeLimitReason& reason, boo if( bChgPos && !IsVertLR() ) { - aFrm.Pos().AdjustX( -nDist ); + aFrm.SetPosX(aFrm.Pos().X() - nDist); } bMoveAccFrame = true; @@ -2866,7 +2866,7 @@ SwTwips SwLayoutFrame::GrowFrame(SwTwips nDist, SwResizeLimitReason& reason, boo if( bChgPos && !IsVertLR() ) { - aFrm.Pos().setX( nFramePos - nReal ); + aFrm.SetPosX(nFramePos - nReal); } bMoveAccFrame = true; @@ -3001,7 +3001,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) if( bChgPos && !IsVertLR() ) { - aFrm.Pos().AdjustX(nReal ); + aFrm.SetPosX(aFrm.Pos().X() + nReal); } bMoveAccFrame = true; @@ -3026,7 +3026,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) if( bChgPos && !IsVertLR() ) { - aFrm.Pos().AdjustX(nRealDist - nReal ); + aFrm.SetPosX(aFrm.Pos().X() + nRealDist - nReal); } OSL_ENSURE( !IsAccessibleFrame(), "bMoveAccFrame has to be set!" ); @@ -3043,7 +3043,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo ) if( bChgPos && !IsVertLR() ) { - aFrm.Pos().AdjustX(nTmp - nReal ); + aFrm.SetPosX(aFrm.Pos().X() + nTmp - nReal); } OSL_ENSURE( !IsAccessibleFrame(), "bMoveAccFrame has to be set!" ); diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index 5f2210438b7e..f3a25eb390c7 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -1075,8 +1075,7 @@ SwTwips SwAnchoredObjectPosition::AdjustHoriRelPosForDrawAside( nAdjustedRelPosX = nTmp; } } - aTmpObjRect.Pos().setY( rAnchorTextFrame.getFrameArea().Top() + - nAdjustedRelPosX ); + aTmpObjRect.SetPosY(rAnchorTextFrame.getFrameArea().Top() + nAdjustedRelPosX); } } else @@ -1114,8 +1113,7 @@ SwTwips SwAnchoredObjectPosition::AdjustHoriRelPosForDrawAside( nAdjustedRelPosX = nTmp; } } - aTmpObjRect.Pos().setX( rAnchorTextFrame.getFrameArea().Left() + - nAdjustedRelPosX ); + aTmpObjRect.SetPosX(rAnchorTextFrame.getFrameArea().Left() + nAdjustedRelPosX); } } // end of <if (bVert)> } // end of <if DrawAsideFly(..)> diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx index 357b2dfdda84..f61e88f2b00f 100644 --- a/sw/source/core/text/EnhancedPDFExportHelper.cxx +++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx @@ -3326,7 +3326,7 @@ void SwEnhancedPDFExportHelper::MakeHeaderFooterLinks( vcl::PDFExtOutDevData& rP // Add offset to current page: const SwPageFrame* pPageFrame = pTmpFrame->FindPageFrame(); SwRect aHFLinkRect( rLinkRect ); - aHFLinkRect.Pos() = pPageFrame->getFrameArea().Pos() + aOffset; + aHFLinkRect.Pos(pPageFrame->getFrameArea().Pos() + aOffset); // #i97135# the gcc_x64 optimizer gets aHFLinkRect != rLinkRect wrong // fool it by comparing the position only (the width and height are the diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx index b709561c37f9..8ccf62981872 100644 --- a/sw/source/core/text/frmcrsr.cxx +++ b/sw/source/core/text/frmcrsr.cxx @@ -430,7 +430,7 @@ bool SwTextFrame::GetAutoPos( SwRect& rOrig, const SwPosition &rPos ) const aLine.GetCharRect( &rOrig, nOffset, &aTmpState, nMaxY ); if( aTmpState.m_aRealHeight.X() >= 0 ) { - rOrig.Pos().AdjustY(aTmpState.m_aRealHeight.X() ); + rOrig.SetPosY(rOrig.Pos().Y() + aTmpState.m_aRealHeight.X()); rOrig.Height( aTmpState.m_aRealHeight.Y() ); } @@ -869,7 +869,7 @@ bool SwTextFrame::UnitUp_( SwPaM *pPam, const SwTwips nOffset, if ( bPrevLine || bSecondOfDouble ) { aCharBox.Width( aCharBox.SSize().Width() / 2 ); - aCharBox.Pos().setX( aCharBox.Pos().X() - 150 ); + aCharBox.SetPosX(aCharBox.Pos().X() - 150); // See comment in SwTextFrame::GetModelPositionForViewPoint() #if OSL_DEBUG_LEVEL > 0 @@ -927,7 +927,7 @@ bool SwTextFrame::UnitUp_( SwPaM *pPam, const SwTwips nOffset, } if ( !pPrevPrev ) return pTmpPrev->SwContentFrame::UnitUp( pPam, nOffset, bSetInReadOnly ); - aCharBox.Pos().setY( pPrevPrev->getFrameArea().Bottom() - 1 ); + aCharBox.SetPosY(pPrevPrev->getFrameArea().Bottom() - 1); return pPrevPrev->GetKeyCursorOfst( pPam->GetPoint(), aCharBox.Pos() ); } } @@ -1306,7 +1306,7 @@ bool SwTextFrame::UnitDown_(SwPaM *pPam, const SwTwips nOffset, // We take a shortcut for follows if( pTmpFollow ) { - aCharBox.Pos().setY( pTmpFollow->getFrameArea().Top() + 1 ); + aCharBox.SetPosY(pTmpFollow->getFrameArea().Top() + 1); return static_cast<const SwTextFrame*>(pTmpFollow)->GetKeyCursorOfst( pPam->GetPoint(), aCharBox.Pos() ); } diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx index 8110a64b95e0..2904c2135f51 100644 --- a/sw/source/core/text/inftxt.cxx +++ b/sw/source/core/text/inftxt.cxx @@ -1149,8 +1149,7 @@ void SwTextPaintInfo::DrawRedArrow( const SwLinePortion &rPor ) const sal_Unicode cChar; if( static_cast<const SwArrowPortion&>(rPor).IsLeft() ) { - aRect.Pos().AdjustY(20 - GetAscent() ); - aRect.Pos().AdjustX(20 ); + aRect += { 20, 20 - GetAscent() }; if( aSize.Height() > rPor.Height() ) aRect.Height( rPor.Height() ); cChar = CHAR_LEFT_ARROW; @@ -1159,8 +1158,7 @@ void SwTextPaintInfo::DrawRedArrow( const SwLinePortion &rPor ) const { if( aSize.Height() > rPor.Height() ) aRect.Height( rPor.Height() ); - aRect.Pos().AdjustY( -(aRect.Height() + 20) ); - aRect.Pos().AdjustX( -(aRect.Width() + 20) ); + aRect -= { aRect.Width() + 20, aRect.Height() + 20 }; cChar = CHAR_RIGHT_ARROW; } diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx index 6df97bb533b0..3b659e19be36 100644 --- a/sw/source/core/text/itrcrsr.cxx +++ b/sw/source/core/text/itrcrsr.cxx @@ -83,7 +83,7 @@ static void lcl_GetCharRectInsideField( SwTextSizeInfo& rInf, SwRect& rOrig, break; nFieldIdx += nFieldLen; - rOrig.Pos().AdjustX(pPor->Width() ); + rOrig.SetPosX(rOrig.Pos().X() + pPor->Width()); pPor = pPor->GetNextPortion(); } while ( true ); @@ -111,7 +111,7 @@ static void lcl_GetCharRectInsideField( SwTextSizeInfo& rInf, SwRect& rOrig, const_cast<SwLinePortion*>(pPor)->SetLen( nOldLen ); - rOrig.Pos().AdjustX(nX1 ); + rOrig.SetPosX(rOrig.Pos().X() + nX1); rOrig.Width( ( nX2 > nX1 ) ? ( nX2 - nX1 ) : 1 ); @@ -510,10 +510,10 @@ void SwTextCursor::GetEndCharRect(SwRect* pOrig, const TextFrameIndex nOfst, const Size aCharSize( 1, nTmpHeight ); pOrig->Pos( GetTopLeft() ); pOrig->SSize( aCharSize ); - pOrig->Pos().AdjustX(nLast ); + pOrig->SetPosX(pOrig->Pos().X() + nLast); const SwTwips nTmpRight = Right() - 1; if( pOrig->Left() > nTmpRight ) - pOrig->Pos().setX( nTmpRight ); + pOrig->SetPosX(nTmpRight); if ( pCMS && pCMS->m_bRealHeight ) { @@ -736,7 +736,7 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst, if( pPor->IsMultiPortion() ) { GetInfo().SetMulti( true ); - pOrig->Pos().AdjustY(nTmpAscent - nPorAscent ); + pOrig->SetPosY(pOrig->Pos().Y() + nTmpAscent - nPorAscent); if( pCMS && pCMS->m_b2Lines ) { @@ -806,7 +806,7 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst, else nOffset = GetLineHeight(); - pOrig->Pos().AdjustY(nOffset ); + pOrig->SetPosY(pOrig->Pos().Y() + nOffset); Next(); } @@ -886,11 +886,11 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst, if ( nTmp ) nTmp--; - pOrig->Pos().setX( nX + aOldPos.X() ); + pOrig->SetPosX(nX + aOldPos.X()); if( static_cast<SwMultiPortion*>(pPor)->IsRevers() ) - pOrig->Pos().setY( aOldPos.Y() + nTmp ); + pOrig->SetPosY(aOldPos.Y() + nTmp); else - pOrig->Pos().setY( aOldPos.Y() + pOrig->SetPosY(aOldPos.Y() + pPor->Height() - nTmp - pOrig->Height() ); if ( pCMS && pCMS->m_bRealHeight ) { @@ -917,20 +917,19 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst, } else { - pOrig->Pos().AdjustY(aOldPos.Y() ); + pOrig->SetPosY(pOrig->Pos().Y() + aOldPos.Y()); if ( static_cast<SwMultiPortion*>(pPor)->IsBidi() ) { const SwTwips nPorWidth = pPor->Width() + pPor->CalcSpacing( nSpaceAdd, aInf ); const SwTwips nInsideOfst = pOrig->Pos().X(); - pOrig->Pos().setX( nX + nPorWidth - - nInsideOfst - pOrig->Width() ); + pOrig->SetPosX(nX + nPorWidth - nInsideOfst - pOrig->Width()); } else - pOrig->Pos().AdjustX(nX ); + pOrig->SetPosX(pOrig->Pos().X() + nX); if( static_cast<SwMultiPortion*>(pPor)->HasBrackets() ) - pOrig->Pos().AdjustX( + pOrig->SetPosX(pOrig->Pos().X() + static_cast<SwDoubleLinePortion*>(pPor)->PreWidth() ); } @@ -1211,7 +1210,7 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst, { // we came from inside the bidi portion, we want to blink // behind the portion - pOrig->Pos().AdjustX( -nLastBidiPorWidth ); + pOrig->SetPosX(pOrig->Pos().X() - nLastBidiPorWidth); // Again, there is a special case: logically behind // the portion can actually mean that the cursor is inside @@ -1228,7 +1227,7 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst, TextFrameIndex const nIdx = aInf.GetIdx(); // correct the index before using CalcSpacing. aInf.SetIdx(nLastBidiIdx); - pOrig->Pos().AdjustX(pLast->Width() + + pOrig->SetPosX(pOrig->Pos().X() + pLast->Width() + pLast->CalcSpacing( nSpaceAdd, aInf ) ); aInf.SetIdx(nIdx); } @@ -1242,13 +1241,13 @@ void SwTextCursor::GetCharRect_( SwRect* pOrig, TextFrameIndex const nOfst, { // we came from inside the bidi portion, we want to blink // behind the portion - pOrig->Pos().AdjustX(pPor->Width() + + pOrig->SetPosX(pOrig->Pos().X() + pPor->Width() + pPor->CalcSpacing( nSpaceAdd, aInf ) ); } } } - pOrig->Pos().AdjustX(nX ); + pOrig->SetPosX(pOrig->Pos().X() + nX); if ( pCMS && pCMS->m_bRealHeight ) { @@ -1300,15 +1299,12 @@ void SwTextCursor::GetCharRect( SwRect* pOrig, TextFrameIndex const nOfst, GetCharRect_( pOrig, nFindOfst, pCMS ); - pOrig->Pos().AdjustX(aCharPos.X() ); - pOrig->Pos().AdjustY(aCharPos.Y() ); + *pOrig += aCharPos; if( pCMS && pCMS->m_b2Lines && pCMS->m_p2Lines ) { - pCMS->m_p2Lines->aLine.Pos().AdjustX(aCharPos.X() ); - pCMS->m_p2Lines->aLine.Pos().AdjustY(aCharPos.Y() ); - pCMS->m_p2Lines->aPortion.Pos().AdjustX(aCharPos.X() ); - pCMS->m_p2Lines->aPortion.Pos().AdjustY(aCharPos.Y() ); + pCMS->m_p2Lines->aLine += aCharPos; + pCMS->m_p2Lines->aPortion += aCharPos; } if( nMax ) diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx index 8bcc6bf64959..dd55a9213413 100644 --- a/sw/source/core/text/itrform2.cxx +++ b/sw/source/core/text/itrform2.cxx @@ -2814,7 +2814,7 @@ bool SwTextFormatter::ChkFlyUnderflow( SwTextFormatInfo &rInf ) const // We now check every portion that could have lowered for overlapping // with the fly. const SwLinePortion *pPos = GetCurr()->GetFirstPortion(); - aLine.Pos().setY( Y() + GetCurr()->GetRealHeight() - GetCurr()->Height() ); + aLine.SetPosY(Y() + GetCurr()->GetRealHeight() - GetCurr()->Height()); aLine.Height( GetCurr()->Height() ); while( pPos ) @@ -3066,7 +3066,7 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf ) } // aInter becomes frame-local - aInter.Pos().AdjustX( -nLeftMar ); + aInter.SetPosX(aInter.Pos().X() - nLeftMar); SwFlyPortion *pFly = new SwFlyPortion( aInter ); if( bForced ) { diff --git a/sw/source/core/text/txtdrop.cxx b/sw/source/core/text/txtdrop.cxx index 681785bbbb0a..0dc3d3950841 100644 --- a/sw/source/core/text/txtdrop.cxx +++ b/sw/source/core/text/txtdrop.cxx @@ -52,9 +52,8 @@ static bool lcl_IsDropFlyInter(const SwTextFormatInfo& rInf, SwTwips nWidth, sal if( rTextFly.IsOn() ) { SwRect aRect( rInf.GetTextFrame()->getFrameArea().Pos(), Size( nWidth, nHeight) ); - aRect.Pos() += rInf.GetTextFrame()->getFramePrintArea().Pos(); - aRect.Pos().AdjustX(rInf.X() ); - aRect.Pos().setY( rInf.Y() ); + aRect += rInf.GetTextFrame()->getFramePrintArea().Pos(); + aRect.Pos(aRect.Pos().X() + rInf.X(), rInf.Y()); aRect = rTextFly.GetFrame( aRect ); return aRect.HasArea(); } diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx index 5b50cb82b649..33a8bf620732 100644 --- a/sw/source/core/text/txtfrm.cxx +++ b/sw/source/core/text/txtfrm.cxx @@ -425,29 +425,29 @@ void SwTextFrame::SwapWidthAndHeight() if ( ! mbIsSwapped ) { const tools::Long nPrtOfstX = aPrt.Pos().X(); - aPrt.Pos().setX( aPrt.Pos().Y() ); + aPrt.SetPosX(aPrt.Pos().Y()); if( IsVertLR() ) { - aPrt.Pos().setY( nPrtOfstX ); + aPrt.SetPosY(nPrtOfstX); } else { - aPrt.Pos().setY( getFrameArea().Width() - ( nPrtOfstX + aPrt.Width() ) ); + aPrt.SetPosY(getFrameArea().Width() - (nPrtOfstX + aPrt.Width())); } } else { const tools::Long nPrtOfstY = aPrt.Pos().Y(); - aPrt.Pos().setY( aPrt.Pos().X() ); + aPrt.SetPosY(aPrt.Pos().X()); if( IsVertLR() ) { - aPrt.Pos().setX( nPrtOfstY ); + aPrt.SetPosX(nPrtOfstY); } else { - aPrt.Pos().setX( getFrameArea().Height() - ( nPrtOfstY + aPrt.Height() ) ); + aPrt.SetPosX(getFrameArea().Height() - (nPrtOfstY + aPrt.Height())); } } @@ -3692,7 +3692,7 @@ SwTwips SwTextFrame::CalcFitToContent() if ( IsRightToLeft() ) { SwFrameAreaDefinition::FrameAreaWriteAccess aFrm(*this); - aFrm.Pos().AdjustX(nOldFrameWidth - nPageWidth ); + aFrm.SetPosX(aFrm.Pos().X() + nOldFrameWidth - nPageWidth); } TextFrameLockGuard aLock( this ); @@ -3712,7 +3712,7 @@ SwTwips SwTextFrame::CalcFitToContent() // i#25422 objects anchored as character in RTL if ( IsRightToLeft() ) { - aFrm.Pos() = aOldFramePos; + aFrm.Pos(aOldFramePos); } } diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index c00ed44bbf5b..a814216b2f19 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -1424,10 +1424,10 @@ void SwViewShell::VisPortChgd( const SwRect &rRect) if( VisArea().Overlaps( aPrevArea ) && !mnLockPaint ) { bScrolled = true; - maVisArea.Pos() = aPrevArea.Pos(); + maVisArea.Pos(aPrevArea.Pos()); if ( SmoothScroll( nXDiff, nYDiff, &aRect ) ) return; - maVisArea.Pos() = rRect.Pos(); + maVisArea.Pos(rRect.Pos()); } else if (!comphelper::LibreOfficeKit::isActive()) GetWin()->Invalidate( aRect ); @@ -1437,10 +1437,10 @@ void SwViewShell::VisPortChgd( const SwRect &rRect) if( VisArea().Overlaps( aPrevArea ) ) { bScrolled = true; - maVisArea.Pos() = aPrevArea.Pos(); + maVisArea.Pos(aPrevArea.Pos()); if ( SmoothScroll( nXDiff, nYDiff, nullptr ) ) return; - maVisArea.Pos() = rRect.Pos(); + maVisArea.Pos(rRect.Pos()); } else GetWin()->Invalidate(); @@ -1534,15 +1534,15 @@ bool SwViewShell::SmoothScroll( tools::Long lXDiff, tools::Long lYDiff, const to aRect.Height( aSize.Height() ); if ( pRect ) { - aRect.Pos().setX( std::max(aRect.Left(),pRect->Left()-aPixSz.Width()) ); + aRect.SetPosX(std::max(aRect.Left(), pRect->Left() - aPixSz.Width())); aRect.Right( std::min(aRect.Right()+2*aPixSz.Width(), pRect->Right()+aPixSz.Width())); } else aRect.AddWidth(2*aPixSz.Width() ); - aRect.Pos().setY( lYDiff < 0 ? aOldVis.Bottom() - aPixSz.Height() + aRect.SetPosY(lYDiff < 0 ? aOldVis.Bottom() - aPixSz.Height() : aRect.Top() - aSize.Height() + aPixSz.Height() ); - aRect.Pos().setX( std::max( tools::Long(0), aRect.Left()-aPixSz.Width() ) ); - aRect.Pos() = GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.Pos())); + aRect.SetPosX(std::max(tools::Long(0), aRect.Left() - aPixSz.Width())); + aRect.Pos(GetWin()->PixelToLogic(GetWin()->LogicToPixel(aRect.Pos()))); aRect.SSize( GetWin()->PixelToLogic( GetWin()->LogicToPixel( aRect.SSize())) ); maVisArea = aRect; const Point aPt( -aRect.Left(), -aRect.Top() ); @@ -1619,8 +1619,8 @@ bool SwViewShell::SmoothScroll( tools::Long lXDiff, tools::Long lYDiff, const to } const SwRect aTmpOldVis = VisArea(); - maVisArea.Pos().AdjustY( -lScroll ); - maVisArea.Pos() = GetWin()->PixelToLogic( GetWin()->LogicToPixel( VisArea().Pos())); + maVisArea.SetPosY(maVisArea.Pos().Y() - lScroll); + maVisArea.Pos(GetWin()->PixelToLogic(GetWin()->LogicToPixel(VisArea().Pos()))); lScroll = aTmpOldVis.Top() - VisArea().Top(); if ( pRect ) { @@ -1705,8 +1705,7 @@ bool SwViewShell::SmoothScroll( tools::Long lXDiff, tools::Long lYDiff, const to } #endif - maVisArea.Pos().AdjustX( -lXDiff ); - maVisArea.Pos().AdjustY( -lYDiff ); + maVisArea -= { lXDiff, lYDiff }; if ( pRect ) GetWin()->Scroll( lXDiff, lYDiff, *pRect, ScrollFlags::Children); else @@ -1785,7 +1784,8 @@ void SwViewShell::PaintDesktop(const vcl::RenderContext& rRenderContext, const S const bool bSidebarRight = static_cast<const SwPageFrame*>(pPage)->SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT; - aPageRect.Pos().AdjustX( -(bSidebarRight ? 0 : nSidebarWidth) ); + if (!bSidebarRight) + aPageRect.SetPosX(aPageRect.Pos().X() - nSidebarWidth); aPageRect.AddWidth(nSidebarWidth ); if ( aPageRect.Overlaps( rRect ) ) @@ -2899,7 +2899,7 @@ sal_Int32 SwViewShell::GetPageNumAndSetOffsetForPDF( OutputDevice& rOut, const S // #i40059# Position out of bounds: SwRect aRect( rRect ); - aRect.Pos().setX( std::max( aRect.Left(), GetLayout()->getFrameArea().Left() ) ); + aRect.SetPosX(std::max(aRect.Left(), GetLayout()->getFrameArea().Left())); const SwPageFrame* pPage = GetLayout()->GetPageAtPos( aRect.Center() ); if ( pPage ) diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index ddbfc04153d5..f205c6219c8b 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -365,7 +365,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) //at first determine the changes SwRect aSectRect = rSh.GetAnyCurRect(CurRectType::SectionPrt); const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section); - aSectRect.Pos() += aTmpRect.Pos(); + aSectRect += aTmpRect.Pos(); tools::Long nLeftDiff = aLongLR.GetLeft() - static_cast<tools::Long>(aSectRect.Left() - rPageRect.Left() ); tools::Long nRightDiff = aLongLR.GetRight() - static_cast<tools::Long>( rPageRect.Right() - aSectRect.Right()); //change the LRSpaceItem of the section accordingly @@ -477,7 +477,7 @@ void SwView::ExecTabWin( SfxRequest const & rReq ) //at first determine the changes SwRect aSectRect = rSh.GetAnyCurRect(CurRectType::SectionPrt); const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section); - aSectRect.Pos() += aTmpRect.Pos(); + aSectRect += aTmpRect.Pos(); const tools::Long nLeftDiff = aLongULSpace.GetUpper() - static_cast<tools::Long>(aSectRect.Top() - rPageRect.Top()); const tools::Long nRightDiff = aLongULSpace.GetLower() - static_cast<tools::Long>(nPageHeight - aSectRect.Bottom() + rPageRect.Top()); //change the LRSpaceItem of the section accordingly @@ -1496,7 +1496,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) if( pFormat )// #i80890# if rDesc is not the one belonging to the current page is might crash { SwRect aRect( rSh.GetAnyCurRect( CurRectType::HeaderFooter, pPt)); - aRect.Pos() -= rSh.GetAnyCurRect( CurRectType::Page, pPt ).Pos(); + aRect -= rSh.GetAnyCurRect( CurRectType::Page, pPt ).Pos(); const SvxLRSpaceItem& aLR = pFormat->GetLRSpace(); aLongLR.SetLeft(aLR.ResolveLeft({}) + aRect.Left()); aLongLR.SetRight(nPageWidth - aRect.Right() + aLR.ResolveRight({})); @@ -1509,7 +1509,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) { aRect = rSh.GetAnyCurRect(CurRectType::SectionPrt, pPt); const SwRect aTmpRect = rSh.GetAnyCurRect(CurRectType::Section, pPt); - aRect.Pos() += aTmpRect.Pos(); + aRect += aTmpRect.Pos(); } else if ( bFrameSelection || nFrameType & FrameTypeFlags::FLY_ANY ) @@ -1557,7 +1557,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) else if ( nFrameType & FrameTypeFlags::HEADER || nFrameType & FrameTypeFlags::FOOTER ) { SwRect aRect( rSh.GetAnyCurRect( CurRectType::HeaderFooter, pPt)); - aRect.Pos() -= rSh.GetAnyCurRect( CurRectType::Page, pPt ).Pos(); + aRect -= rSh.GetAnyCurRect( CurRectType::Page, pPt ).Pos(); aLongUL.SetUpper( aRect.Top() ); aLongUL.SetLower( nPageHeight - aRect.Bottom() ); } @@ -2009,14 +2009,14 @@ void SwView::StateTabWin(SfxItemSet& rSet) if(bVerticalWriting) { - aRect.Pos() += Point(aTmpRect.Left(), aTmpRect.Top()); - aRect.Pos().AdjustY( -(rPageRect.Top()) ); + aRect += Point(aTmpRect.Left(), aTmpRect.Top()); + aRect.SetPosY(aRect.Pos().Y() - (rPageRect.Top())); aColItem.SetLeft(aRect.Top()); aColItem.SetRight(nPageHeight - aRect.Bottom()); } else { - aRect.Pos() += aTmpRect.Pos(); + aRect += aTmpRect.Pos(); // make relative to page position: aColItem.SetLeft (o3tl::narrowing<sal_uInt16>( aRect.Left() - rPageRect.Left() )); @@ -2328,8 +2328,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) { SwRect aRect( rSh.GetAnyCurRect( CurRectType::FlyEmbeddedPrt, pPt ) ); - aRect.Pos() += rSh.GetAnyCurRect( CurRectType::FlyEmbedded, - pPt ).Pos(); + aRect += rSh.GetAnyCurRect(CurRectType::FlyEmbedded, pPt).Pos(); aRectangle.SetLeft( aRect.Left() - rPageRect.Left() ); aRectangle.SetRight( rPageRect.Right() - aRect.Right() ); @@ -2385,8 +2384,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) SwRect aRect( rSh.GetAnyCurRect( eRecType, pPt ) ); if(CurRectType::FlyEmbeddedPrt == eRecType) - aRect.Pos() += rSh.GetAnyCurRect( CurRectType::FlyEmbedded, - pPt ).Pos(); + aRect += rSh.GetAnyCurRect(CurRectType::FlyEmbedded, pPt).Pos(); const sal_uInt16 nTotalWidth = o3tl::narrowing<sal_uInt16>(aRect.Width()); // Initialize nStart and nEnd for nNum == 0 diff --git a/sw/source/uibase/wrtsh/move.cxx b/sw/source/uibase/wrtsh/move.cxx index fea79b1e994c..1b23548dea82 100644 --- a/sw/source/uibase/wrtsh/move.cxx +++ b/sw/source/uibase/wrtsh/move.cxx @@ -473,7 +473,7 @@ bool SwWrtShell::PushCursor(SwTwips lOffset, bool bSelect) //Place the cursor at the target position; remember that no target //position is longer on the stack. //The new visible region is to be determined beforehand. - aTmpArea.Pos().AdjustY(lOffset ); + aTmpArea.SetPosY(aTmpArea.Pos().Y() + lOffset); if( aTmpArea.Contains(m_aDest) ) { if( bSelect ) @@ -531,7 +531,7 @@ bool SwWrtShell::PopCursor(bool bUpdate, bool bSelect) // If a predecessor is on the stack, // use the flag for a valid position. SwRect aTmpArea(VisArea()); - aTmpArea.Pos().AdjustY( -(m_pCursorStack->lOffset) ); + aTmpArea.SetPosY(aTmpArea.Pos().Y() - m_pCursorStack->lOffset); if( aTmpArea.Contains( m_pCursorStack->aDocPos ) ) { if( bSelect ) diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index aa006d5605e3..d98b9c19334c 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -498,7 +498,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName if ( xObj.GetViewAspect() == embed::Aspects::MSOLE_ICON ) { SwRect aArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ); - aArea.Pos() += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos(); + aArea += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos(); MapMode aMapMode( MapUnit::MapTwip ); Size aSize = xObj.GetSize( &aMapMode ); aArea.Width( aSize.Width() ); @@ -921,7 +921,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, else { aArea = GetAnyCurRect( CurRectType::FlyEmbeddedPrt, nullptr, xObj.GetObject() ); - aArea.Pos() += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos(); + aArea += GetAnyCurRect( CurRectType::FlyEmbedded, nullptr, xObj.GetObject() ).Pos(); } if ( bUseObjectSize )
