diff options
author | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-10-25 13:46:44 +0200 |
---|---|---|
committer | Armin Le Grand <Armin.Le.Grand@cib.de> | 2017-10-30 09:32:22 +0100 |
commit | d64ea2264b5a13bfca8499e08f352af6740e71ff (patch) | |
tree | 10ac991e84ff6bb104f0f576a330c168ca0f8bad /sw/source/core/frmedt/fews.cxx | |
parent | cppcheck: unusedVariable (diff) | |
download | core-d64ea2264b5a13bfca8499e08f352af6740e71ff.tar.gz core-d64ea2264b5a13bfca8499e08f352af6740e71ff.zip |
RotateFlyFrame: Isolate SwFrame members maFrame and maPrt
feature/RotateFlyFrame
To gain more control over changes of the Writer layout,
isolated mentioned members and replaced all calls with
inline methods for read access. Moved to own class to
also identify 'private' accesses reliably. Added access
dedicated classes for write access, the only allowed
way to do changes. Adapted all usages and made test builds
on logerrit and locally
Change-Id: Ib0b7f852f5176744e860e2aad12dd13c9a906d68
RotateFlyFrame: Migrated from SwFrame::FrameWA to setFrame
Change-Id: I01f7b828fe2134411cc76639e880da46b415d767
RotateFlyFrame: Migrated from SwFrame::PrintWA to setPrint
Change-Id: Ieea3b467f296a190de5b5f47721bef148bebf60b
RotateFlyFrame: Adapted to get/setSwFrame and get/setSwPrint
Change-Id: I6cce40ec49dd5bd32d94fe06b9d2dabd368448be
RotateFlyFrame: Adapted to get methods and WriteAccess helpers
Change-Id: Ife3c1b2391ad7beae8c7f31f796b1454709ddd26
RotateFlyFrame: Moved change executers to cxx
Moved SwFrameRect::FrameWriteAccess::~FrameWriteAccess()
and SwFrameRect::PrintWriteAccess::~PrintWriteAccess() to
implementation side and added compare op's for SwRcet to
write only if needed
Change-Id: I85d0e61009116f4b17d1ce0337e3f0d2cc031159
RotateFlyFrame: Moved change executers to cxx
Moved SwFrameRect::FrameWriteAccess::~FrameWriteAccess()
and SwFrameRect::PrintWriteAccess::~PrintWriteAccess() to
implementation side and added compare op's for SwRcet to
write only if needed
Change-Id: I85d0e61009116f4b17d1ce0337e3f0d2cc031159
Diffstat (limited to 'sw/source/core/frmedt/fews.cxx')
-rw-r--r-- | sw/source/core/frmedt/fews.cxx | 130 |
1 files changed, 65 insertions, 65 deletions
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx index 9208fea97229..0dff86a6012b 100644 --- a/sw/source/core/frmedt/fews.cxx +++ b/sw/source/core/frmedt/fews.cxx @@ -106,7 +106,7 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, } if( !pFrame ) - return GetLayout()->Frame(); + return GetLayout()->getSwFrame(); bool bFrame = true; switch ( eType ) @@ -158,7 +158,7 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, case CurRectType::HeaderFooter: if( nullptr == (pFrame = pFrame->FindFooterOrHeader()) ) - return GetLayout()->Frame(); + return GetLayout()->getSwFrame(); break; case CurRectType::PagesArea: @@ -166,13 +166,13 @@ const SwRect& SwFEShell::GetAnyCurRect( CurRectType eType, const Point* pPt, default: break; } - return bFrame ? pFrame->Frame() : pFrame->Prt(); + return bFrame ? pFrame->getSwFrame() : pFrame->getSwPrint(); } sal_uInt16 SwFEShell::GetPageNumber( const Point &rPoint ) const { const SwFrame *pPage = GetLayout()->Lower(); - while ( pPage && !pPage->Frame().IsInside( rPoint ) ) + while ( pPage && !pPage->getSwFrame().IsInside( rPoint ) ) pPage = pPage->GetNext(); if ( pPage ) return static_cast<const SwPageFrame*>(pPage)->GetPhyPageNum(); @@ -193,8 +193,8 @@ bool SwFEShell::GetPageNumber( long nYPos, bool bAtCursorPos, sal_uInt16& rPhyNu else if ( nYPos > -1 ) // determine page via the position { pPage = GetLayout()->Lower(); - while( pPage && (pPage->Frame().Bottom() < nYPos || - nYPos < pPage->Frame().Top() ) ) + while( pPage && (pPage->getSwFrame().Bottom() < nYPos || + nYPos < pPage->getSwFrame().Top() ) ) pPage = pPage->GetNext(); } else // first visible page @@ -642,8 +642,8 @@ sal_uInt16 SwFEShell::GetCurColNum_( const SwFrame *pFrame, if( ( SwFrameType::Page | SwFrameType::Fly | SwFrameType::Section ) & pFrame->GetType() ) { pPara->pFrameFormat = static_cast<const SwLayoutFrame*>(pFrame)->GetFormat(); - pPara->pPrtRect = &pFrame->Prt(); - pPara->pFrameRect = &pFrame->Frame(); + pPara->pPrtRect = &pFrame->getSwPrint(); + pPara->pFrameRect = &pFrame->getSwFrame(); break; } pFrame = pFrame->GetUpper(); @@ -761,13 +761,13 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, } if ( !pFrame ) pFrame = pTmp; - _orRect = pFrame->Frame(); + _orRect = pFrame->getSwFrame(); SwRectFnSet aRectFnSet(pFrame); bRTL = pFrame->IsRightToLeft(); if ( bRTL ) - aPos = pFrame->Frame().TopRight(); + aPos = pFrame->getSwFrame().TopRight(); else - aPos = aRectFnSet.GetPos(pFrame->Frame()); + aPos = aRectFnSet.GetPos(pFrame->getSwFrame()); if( aRectFnSet.IsVert() || aRectFnSet.IsVertL2R() ) { @@ -777,10 +777,10 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::PAGE_RIGHT: - case text::RelOrientation::FRAME_RIGHT: aPos.Y() += pFrame->Prt().Height(); + case text::RelOrientation::FRAME_RIGHT: aPos.Y() += pFrame->getSwPrint().Height(); SAL_FALLTHROUGH; case text::RelOrientation::PRINT_AREA: - case text::RelOrientation::PAGE_PRINT_AREA: aPos.Y() += pFrame->Prt().Top(); break; + case text::RelOrientation::PAGE_PRINT_AREA: aPos.Y() += pFrame->getSwPrint().Top(); break; default: break; } } @@ -789,11 +789,11 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::PRINT_AREA: - case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->Prt().Width(); + case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->getSwPrint().Width(); SAL_FALLTHROUGH; case text::RelOrientation::PAGE_RIGHT: - case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrame->Prt().Left(); break; - default: aPos.X() += pFrame->Frame().Width(); + case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrame->getSwPrint().Left(); break; + default: aPos.X() += pFrame->getSwFrame().Width(); } } else if ( bRTL ) @@ -801,11 +801,11 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::PRINT_AREA: - case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->Prt().Width(); + case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->getSwPrint().Width(); SAL_FALLTHROUGH; case text::RelOrientation::PAGE_LEFT: - case text::RelOrientation::FRAME_LEFT: aPos.X() += pFrame->Prt().Left() - - pFrame->Frame().Width(); break; + case text::RelOrientation::FRAME_LEFT: aPos.X() += pFrame->getSwPrint().Left() - + pFrame->getSwFrame().Width(); break; default: break; } } @@ -814,10 +814,10 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::PAGE_RIGHT: - case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrame->Prt().Width(); + case text::RelOrientation::FRAME_RIGHT: aPos.X() += pFrame->getSwPrint().Width(); SAL_FALLTHROUGH; case text::RelOrientation::PRINT_AREA: - case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->Prt().Left(); break; + case text::RelOrientation::PAGE_PRINT_AREA: aPos.X() += pFrame->getSwPrint().Left(); break; default:break; } } @@ -860,14 +860,14 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, } else { - aPos.Y() += pFrame->Prt().Top(); + aPos.Y() += pFrame->getSwPrint().Top(); } } break; } } if ( _opPercent ) - *_opPercent = pFrame->Prt().SSize(); + *_opPercent = pFrame->getSwPrint().SSize(); } else { @@ -878,22 +878,22 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, { // If the size is relative from page, then full size should be counted from the page frame. if (pFormatFrameSize && pFormatFrameSize->GetWidthPercentRelation() == text::RelOrientation::PAGE_FRAME) - _opPercent->setWidth(pPage->Frame().Width()); + _opPercent->setWidth(pPage->getSwFrame().Width()); else - _opPercent->setWidth(pUpper->Prt().Width()); + _opPercent->setWidth(pUpper->getSwPrint().Width()); if (pFormatFrameSize && pFormatFrameSize->GetHeightPercentRelation() == text::RelOrientation::PAGE_FRAME) // If the size is relative from page, then full size should be counted from the page frame. - _opPercent->setHeight(pPage->Frame().Height()); + _opPercent->setHeight(pPage->getSwFrame().Height()); else - _opPercent->setHeight(pUpper->Prt().Height()); + _opPercent->setHeight(pUpper->getSwPrint().Height()); } bRTL = pFrame->IsRightToLeft(); if ( bRTL ) - aPos = pFrame->Frame().TopRight(); + aPos = pFrame->getSwFrame().TopRight(); else - aPos = aRectFnSet.GetPos(pFrame->Frame()); + aPos = aRectFnSet.GetPos(pFrame->getSwFrame()); // #i17567# - allow negative positions // for fly frames anchor to paragraph/to character. if ((_nAnchorId == RndStdIds::FLY_AT_PARA) || (_nAnchorId == RndStdIds::FLY_AT_CHAR)) @@ -910,12 +910,12 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, aEnvOfObj.GetHoriEnvironmentLayoutFrame( *pFrame ); const SwLayoutFrame& rVertEnvironLayFrame = aEnvOfObj.GetVertEnvironmentLayoutFrame( *pFrame ); - const SwRect& aHoriEnvironRect( rHoriEnvironLayFrame.Frame() ); + const SwRect& aHoriEnvironRect( rHoriEnvironLayFrame.getSwFrame() ); SwRect aVertEnvironRect; if ( _bFollowTextFlow ) { - aVertEnvironRect = rVertEnvironLayFrame.Prt(); - aVertEnvironRect.Pos() += rVertEnvironLayFrame.Frame().Pos(); + aVertEnvironRect = rVertEnvironLayFrame.getSwPrint(); + aVertEnvironRect.Pos() += rVertEnvironLayFrame.getSwFrame().Pos(); // #i18732# - adjust vertical 'virtual' anchor position // (<aPos.Y()> respectively <aPos.X()>), if object is vertical aligned // to page areas. @@ -939,7 +939,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, { OSL_ENSURE( rVertEnvironLayFrame.IsPageFrame(), "<SwFEShell::CalcBoundRect(..)> - not following text flow, but vertical environment *not* page!" ); - aVertEnvironRect = rVertEnvironLayFrame.Frame(); + aVertEnvironRect = rVertEnvironLayFrame.getSwFrame(); // #i18732# - adjustment vertical 'virtual' anchor position // (<aPos.Y()> respectively <aPos.X()>), if object is vertical aligned // to page areas. @@ -971,7 +971,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, const SwFrame* pTmpFrame = rVertEnvironLayFrame.Lower(); if ( pTmpFrame->IsHeaderFrame() ) { - aPos.setY(aPos.getY() + pTmpFrame->Frame().Height()); + aPos.setY(aPos.getY() + pTmpFrame->getSwFrame().Height()); } } } @@ -1078,11 +1078,11 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, if( _opRef && pFly && pFly->IsFlyInContentFrame() ) *_opRef = static_cast<const SwFlyInContentFrame*>( pFly )->GetRefPoint(); - _orRect = pUpper->Frame(); + _orRect = pUpper->getSwFrame(); if( !pUpper->IsBodyFrame() ) { - _orRect += pUpper->Prt().Pos(); - _orRect.SSize( pUpper->Prt().SSize() ); + _orRect += pUpper->getSwPrint().Pos(); + _orRect.SSize( pUpper->getSwPrint().SSize() ); if ( pUpper->IsCellFrame() )//MA_FLY_HEIGHT { const SwFrame* pTab = pUpper->FindTabFrame(); @@ -1112,30 +1112,30 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, { case text::RelOrientation::FRAME_RIGHT: { - aPos.setY(aPos.getY() + pFrame->Prt().Height()); - aPos += aRectFnSet.GetPos(pFrame->Prt()); + aPos.setY(aPos.getY() + pFrame->getSwPrint().Height()); + aPos += aRectFnSet.GetPos(pFrame->getSwPrint()); break; } case text::RelOrientation::PRINT_AREA: { - aPos += aRectFnSet.GetPos(pFrame->Prt()); + aPos += aRectFnSet.GetPos(pFrame->getSwPrint()); aPos.setY(aPos.getY() + nBaseOfstForFly); break; } case text::RelOrientation::PAGE_RIGHT: { - aPos.setY(pPage->Frame().Top() + pPage->Prt().Bottom()); + aPos.setY(pPage->getSwFrame().Top() + pPage->getSwPrint().Bottom()); break; } case text::RelOrientation::PAGE_PRINT_AREA: { - aPos.setY(pPage->Frame().Top() + pPage->Prt().Top()); + aPos.setY(pPage->getSwFrame().Top() + pPage->getSwPrint().Top()); break; } case text::RelOrientation::PAGE_LEFT: case text::RelOrientation::PAGE_FRAME: { - aPos.setY(pPage->Frame().Top()); + aPos.setY(pPage->getSwFrame().Top()); break; } case text::RelOrientation::FRAME: @@ -1150,14 +1150,14 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, { switch ( _eHoriRelOrient ) { - case text::RelOrientation::FRAME_RIGHT: aPos.setX(aPos.getX() + pFrame->Prt().Left()); break; + case text::RelOrientation::FRAME_RIGHT: aPos.setX(aPos.getX() + pFrame->getSwPrint().Left()); break; case text::RelOrientation::FRAME: - case text::RelOrientation::FRAME_LEFT: aPos.setX(aPos.getX() + pFrame->Frame().Width()); break; - case text::RelOrientation::PRINT_AREA: aPos.setX(aPos.getX() + pFrame->Prt().Right()); break; + case text::RelOrientation::FRAME_LEFT: aPos.setX(aPos.getX() + pFrame->getSwFrame().Width()); break; + case text::RelOrientation::PRINT_AREA: aPos.setX(aPos.getX() + pFrame->getSwPrint().Right()); break; case text::RelOrientation::PAGE_LEFT: - case text::RelOrientation::PAGE_FRAME: aPos.setX(pPage->Frame().Right()); break; - case text::RelOrientation::PAGE_PRINT_AREA: aPos.setX(pPage->Frame().Left() - + pPage->Prt().Left()); break; + case text::RelOrientation::PAGE_FRAME: aPos.setX(pPage->getSwFrame().Right()); break; + case text::RelOrientation::PAGE_PRINT_AREA: aPos.setX(pPage->getSwFrame().Left() + + pPage->getSwPrint().Left()); break; default: break; } } @@ -1166,28 +1166,28 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::FRAME_LEFT: - aPos.setX(pFrame->Frame().Left() + - pFrame->Prt().Left()); + aPos.setX(pFrame->getSwFrame().Left() + + pFrame->getSwPrint().Left()); break; case text::RelOrientation::PRINT_AREA: - aPos.setX(pFrame->Frame().Left() + pFrame->Prt().Left() + - pFrame->Prt().Width()); + aPos.setX(pFrame->getSwFrame().Left() + pFrame->getSwPrint().Left() + + pFrame->getSwPrint().Width()); aPos.setX(aPos.getX() + nBaseOfstForFly); break; case text::RelOrientation::PAGE_LEFT: - aPos.setX(pPage->Frame().Left() + pPage->Prt().Left()); + aPos.setX(pPage->getSwFrame().Left() + pPage->getSwPrint().Left()); break; case text::RelOrientation::PAGE_PRINT_AREA: - aPos.setX(pPage->Frame().Left() + pPage->Prt().Left() + - pPage->Prt().Width()); + aPos.setX(pPage->getSwFrame().Left() + pPage->getSwPrint().Left() + + pPage->getSwPrint().Width()); break; case text::RelOrientation::PAGE_RIGHT: case text::RelOrientation::PAGE_FRAME: - aPos.setX(pPage->Frame().Right()); + aPos.setX(pPage->getSwFrame().Right()); break; case text::RelOrientation::FRAME: @@ -1201,22 +1201,22 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect, switch ( _eHoriRelOrient ) { case text::RelOrientation::FRAME_RIGHT: - aPos.X() += pFrame->Prt().Width(); - aPos += pFrame->Prt().Pos(); + aPos.X() += pFrame->getSwPrint().Width(); + aPos += pFrame->getSwPrint().Pos(); break; case text::RelOrientation::PRINT_AREA: - aPos += pFrame->Prt().Pos(); + aPos += pFrame->getSwPrint().Pos(); aPos.setX(aPos.getX() + nBaseOfstForFly); break; case text::RelOrientation::PAGE_RIGHT: - aPos.setX(pPage->Frame().Left() + pPage->Prt().Right()); + aPos.setX(pPage->getSwFrame().Left() + pPage->getSwPrint().Right()); break; case text::RelOrientation::PAGE_PRINT_AREA: - aPos.setX(pPage->Frame().Left() + pPage->Prt().Left()); + aPos.setX(pPage->getSwFrame().Left() + pPage->getSwPrint().Left()); break; case text::RelOrientation::PAGE_LEFT: case text::RelOrientation::PAGE_FRAME: - aPos.setX(pPage->Frame().Left()); + aPos.setX(pPage->getSwFrame().Left()); break; case text::RelOrientation::FRAME: aPos.setX(aPos.getX() + nBaseOfstForFly); @@ -1254,11 +1254,11 @@ Size SwFEShell::GetGraphicDefaultSize() const // size is (0,0). If this is the case the printing area of the upper // of the anchor frame is taken. const SwFrame* pAnchorFrame = pFly->GetAnchorFrame(); - aRet = pAnchorFrame->Prt().SSize(); + aRet = pAnchorFrame->getSwPrint().SSize(); if ( aRet.Width() == 0 && aRet.Height() == 0 && pAnchorFrame->GetUpper() ) { - aRet = pAnchorFrame->GetUpper()->Prt().SSize(); + aRet = pAnchorFrame->GetUpper()->getSwPrint().SSize(); } SwRect aBound; |