diff options
Diffstat (limited to 'sw/source/core/objectpositioning')
5 files changed, 473 insertions, 473 deletions
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx index 099c6cfabcd8..4e2958c6ffd3 100644 --- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx @@ -45,7 +45,7 @@ SwAnchoredObjectPosition::SwAnchoredObjectPosition( SdrObject& _rDrawObj ) : mrDrawObj( _rDrawObj ), mbIsObjFly( false ), mpAnchoredObj( nullptr ), - mpAnchorFrm( nullptr ), + mpAnchorFrame( nullptr ), mpContact( nullptr ), // #i62875# mbFollowTextFlow( false ), @@ -68,7 +68,7 @@ SwAnchoredObjectPosition::SwAnchoredObjectPosition( SdrObject& _rDrawObj ) /** determine information about object - members <mbIsObjFly>, <mpFrmOfObj>, <mpAnchorFrm>, <mpContact>, + members <mbIsObjFly>, <mpFrameOfObj>, <mpAnchorFrame>, <mpContact>, <mbFollowTextFlow> and <mbDoNotCaptureAnchoredObj> are set */ void SwAnchoredObjectPosition::_GetInfoAboutObj() @@ -96,8 +96,8 @@ void SwAnchoredObjectPosition::_GetInfoAboutObj() // determine frame, the object is anchored at { // #i26791# - mpAnchorFrm = mpAnchoredObj->AnchorFrm(); - OSL_ENSURE( mpAnchorFrm, + mpAnchorFrame = mpAnchoredObj->AnchorFrame(); + OSL_ENSURE( mpAnchorFrame, "SwAnchoredObjectPosition::_GetInfoAboutObj() - missing anchor frame." ); } @@ -133,7 +133,7 @@ bool SwAnchoredObjectPosition::IsAnchoredToChar() const return false; } -const SwFrm* SwAnchoredObjectPosition::ToCharOrientFrm() const +const SwFrame* SwAnchoredObjectPosition::ToCharOrientFrame() const { return nullptr; } @@ -154,120 +154,120 @@ SwTwips SwAnchoredObjectPosition::ToCharTopOfLine() const #i11860# */ -SwTwips SwAnchoredObjectPosition::_GetTopForObjPos( const SwFrm& _rFrm, +SwTwips SwAnchoredObjectPosition::_GetTopForObjPos( const SwFrame& _rFrame, const SwRectFn& _fnRect, const bool _bVert ) { - SwTwips nTopOfFrmForObjPos = (_rFrm.Frm().*_fnRect->fnGetTop)(); + SwTwips nTopOfFrameForObjPos = (_rFrame.Frame().*_fnRect->fnGetTop)(); - if ( _rFrm.IsTextFrm() ) + if ( _rFrame.IsTextFrame() ) { - const SwTextFrm& rTextFrm = static_cast<const SwTextFrm&>(_rFrm); + const SwTextFrame& rTextFrame = static_cast<const SwTextFrame&>(_rFrame); if ( _bVert ) { - nTopOfFrmForObjPos -= - rTextFrm.GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid(); + nTopOfFrameForObjPos -= + rTextFrame.GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); } else { - nTopOfFrmForObjPos += - rTextFrm.GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid(); + nTopOfFrameForObjPos += + rTextFrame.GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); } } - return nTopOfFrmForObjPos; + return nTopOfFrameForObjPos; } void SwAnchoredObjectPosition::_GetVertAlignmentValues( - const SwFrm& _rVertOrientFrm, - const SwFrm& _rPageAlignLayFrm, + const SwFrame& _rVertOrientFrame, + const SwFrame& _rPageAlignLayFrame, const sal_Int16 _eRelOrient, SwTwips& _orAlignAreaHeight, SwTwips& _orAlignAreaOffset ) const { SwTwips nHeight = 0; SwTwips nOffset = 0; - SWRECTFN( (&_rVertOrientFrm) ) - // #i11860# - top of <_rVertOrientFrm> for object positioning - const SwTwips nVertOrientTop = _GetTopForObjPos( _rVertOrientFrm, fnRect, bVert ); - // #i11860# - upper space amount of <_rVertOrientFrm> considered + SWRECTFN( (&_rVertOrientFrame) ) + // #i11860# - top of <_rVertOrientFrame> for object positioning + const SwTwips nVertOrientTop = _GetTopForObjPos( _rVertOrientFrame, fnRect, bVert ); + // #i11860# - upper space amount of <_rVertOrientFrame> considered // for previous frame - const SwTwips nVertOrientUpperSpaceForPrevFrmAndPageGrid = - _rVertOrientFrm.IsTextFrm() - ? static_cast<const SwTextFrm&>(_rVertOrientFrm). - GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid() + const SwTwips nVertOrientUpperSpaceForPrevFrameAndPageGrid = + _rVertOrientFrame.IsTextFrame() + ? static_cast<const SwTextFrame&>(_rVertOrientFrame). + GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid() : 0; switch ( _eRelOrient ) { case text::RelOrientation::FRAME: { // #i11860# - consider upper space of previous frame - nHeight = (_rVertOrientFrm.Frm().*fnRect->fnGetHeight)() - - nVertOrientUpperSpaceForPrevFrmAndPageGrid; + nHeight = (_rVertOrientFrame.Frame().*fnRect->fnGetHeight)() - + nVertOrientUpperSpaceForPrevFrameAndPageGrid; nOffset = 0; } break; case text::RelOrientation::PRINT_AREA: { - nHeight = (_rVertOrientFrm.Prt().*fnRect->fnGetHeight)(); + nHeight = (_rVertOrientFrame.Prt().*fnRect->fnGetHeight)(); // #i11860# - consider upper space of previous frame - nOffset = (_rVertOrientFrm.*fnRect->fnGetTopMargin)() - - nVertOrientUpperSpaceForPrevFrmAndPageGrid; + nOffset = (_rVertOrientFrame.*fnRect->fnGetTopMargin)() - + nVertOrientUpperSpaceForPrevFrameAndPageGrid; // if aligned to page in horizontal layout, consider header and // footer frame height appropriately. - if( _rVertOrientFrm.IsPageFrm() && !bVert ) + if( _rVertOrientFrame.IsPageFrame() && !bVert ) { - const SwFrm* pPrtFrm = - static_cast<const SwPageFrm&>(_rVertOrientFrm).Lower(); - while( pPrtFrm ) + const SwFrame* pPrtFrame = + static_cast<const SwPageFrame&>(_rVertOrientFrame).Lower(); + while( pPrtFrame ) { - if( pPrtFrm->IsHeaderFrm() ) + if( pPrtFrame->IsHeaderFrame() ) { - nHeight -= pPrtFrm->Frm().Height(); - nOffset += pPrtFrm->Frm().Height(); + nHeight -= pPrtFrame->Frame().Height(); + nOffset += pPrtFrame->Frame().Height(); } - else if( pPrtFrm->IsFooterFrm() ) + else if( pPrtFrame->IsFooterFrame() ) { - nHeight -= pPrtFrm->Frm().Height(); + nHeight -= pPrtFrame->Frame().Height(); } - pPrtFrm = pPrtFrm->GetNext(); + pPrtFrame = pPrtFrame->GetNext(); } } } break; case text::RelOrientation::PAGE_FRAME: { - nHeight = (_rPageAlignLayFrm.Frm().*fnRect->fnGetHeight)(); + nHeight = (_rPageAlignLayFrame.Frame().*fnRect->fnGetHeight)(); nOffset = (*fnRect->fnYDiff)( - (_rPageAlignLayFrm.Frm().*fnRect->fnGetTop)(), + (_rPageAlignLayFrame.Frame().*fnRect->fnGetTop)(), nVertOrientTop ); } break; case text::RelOrientation::PAGE_PRINT_AREA: { - nHeight = (_rPageAlignLayFrm.Prt().*fnRect->fnGetHeight)(); - nOffset = (_rPageAlignLayFrm.*fnRect->fnGetTopMargin)() + + nHeight = (_rPageAlignLayFrame.Prt().*fnRect->fnGetHeight)(); + nOffset = (_rPageAlignLayFrame.*fnRect->fnGetTopMargin)() + (*fnRect->fnYDiff)( - (_rPageAlignLayFrm.Frm().*fnRect->fnGetTop)(), + (_rPageAlignLayFrame.Frame().*fnRect->fnGetTop)(), nVertOrientTop ); // if aligned to page in horizontal layout, consider header and // footer frame height appropriately. - if( _rPageAlignLayFrm.IsPageFrm() && !bVert ) + if( _rPageAlignLayFrame.IsPageFrame() && !bVert ) { - const SwFrm* pPrtFrm = - static_cast<const SwPageFrm&>(_rPageAlignLayFrm).Lower(); - while( pPrtFrm ) + const SwFrame* pPrtFrame = + static_cast<const SwPageFrame&>(_rPageAlignLayFrame).Lower(); + while( pPrtFrame ) { - if( pPrtFrm->IsHeaderFrm() ) + if( pPrtFrame->IsHeaderFrame() ) { - nHeight -= pPrtFrm->Frm().Height(); - nOffset += pPrtFrm->Frm().Height(); + nHeight -= pPrtFrame->Frame().Height(); + nOffset += pPrtFrame->Frame().Height(); } - else if( pPrtFrm->IsFooterFrm() ) + else if( pPrtFrame->IsFooterFrame() ) { - nHeight -= pPrtFrm->Frm().Height(); + nHeight -= pPrtFrame->Frame().Height(); } - pPrtFrm = pPrtFrm->GetNext(); + pPrtFrame = pPrtFrame->GetNext(); } } } @@ -311,23 +311,23 @@ void SwAnchoredObjectPosition::_GetVertAlignmentValues( _orAlignAreaOffset = nOffset; } -// #i26791# - add output parameter <_roVertOffsetToFrmAnchorPos> +// #i26791# - add output parameter <_roVertOffsetToFrameAnchorPos> SwTwips SwAnchoredObjectPosition::_GetVertRelPos( - const SwFrm& _rVertOrientFrm, - const SwFrm& _rPageAlignLayFrm, + const SwFrame& _rVertOrientFrame, + const SwFrame& _rPageAlignLayFrame, const sal_Int16 _eVertOrient, const sal_Int16 _eRelOrient, const SwTwips _nVertPos, const SvxLRSpaceItem& _rLRSpacing, const SvxULSpaceItem& _rULSpacing, - SwTwips& _roVertOffsetToFrmAnchorPos ) const + SwTwips& _roVertOffsetToFrameAnchorPos ) const { SwTwips nRelPosY = 0; - SWRECTFN( (&_rVertOrientFrm) ); + SWRECTFN( (&_rVertOrientFrame) ); SwTwips nAlignAreaHeight; SwTwips nAlignAreaOffset; - _GetVertAlignmentValues( _rVertOrientFrm, _rPageAlignLayFrm, + _GetVertAlignmentValues( _rVertOrientFrame, _rPageAlignLayFrame, _eRelOrient, nAlignAreaHeight, nAlignAreaOffset ); nRelPosY = nAlignAreaOffset; @@ -373,7 +373,7 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos( } // #i26791# - _roVertOffsetToFrmAnchorPos = nAlignAreaOffset; + _roVertOffsetToFrameAnchorPos = nAlignAreaOffset; return nRelPosY; } @@ -390,7 +390,7 @@ SwTwips SwAnchoredObjectPosition::_GetVertRelPos( SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnch, const bool bVert, const bool bVertL2R, - const SwFrm& rPageAlignLayFrm, + const SwFrame& rPageAlignLayFrame, const SwTwips nProposedRelPosY, const bool bFollowTextFlow, const bool bCheckBottom ) const @@ -413,13 +413,13 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc // object's attribute follow text flow is set and its inside a table if ( GetFrameFormat().getIDocumentSettingAccess().get(DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION) && ( !bFollowTextFlow || - !GetAnchoredObj().GetAnchorFrm()->IsInTab() ) ) + !GetAnchoredObj().GetAnchorFrame()->IsInTab() ) ) { - aPgAlignArea = rPageAlignLayFrm.FindPageFrm()->Frm(); + aPgAlignArea = rPageAlignLayFrame.FindPageFrame()->Frame(); } else { - aPgAlignArea = rPageAlignLayFrm.Frm(); + aPgAlignArea = rPageAlignLayFrame.Frame(); } } @@ -482,7 +482,7 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc { // shrink textboxes to extend beyond the page bottom SwFrameFormat* pFrameFormat = ::FindFrameFormat(&GetObject()); - SwFormatFrmSize aSize(pFormat->GetFrmSize()); + SwFormatFrameSize aSize(pFormat->GetFrameSize()); SwTwips nShrinked = aSize.GetHeight() - (nProposedRelPosY - nAdjustedRelPosY); if (nShrinked >= 0) { aSize.SetHeight( nShrinked ); @@ -503,46 +503,46 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustVertRelPos( const SwTwips nTopOfAnc #i62875# - method now private and renamed. */ SwTwips SwAnchoredObjectPosition::_ImplAdjustHoriRelPos( - const SwFrm& _rPageAlignLayFrm, + const SwFrame& _rPageAlignLayFrame, const SwTwips _nProposedRelPosX ) const { SwTwips nAdjustedRelPosX = _nProposedRelPosX; - const SwFrm& rAnchorFrm = GetAnchorFrm(); - const bool bVert = rAnchorFrm.IsVertical(); + const SwFrame& rAnchorFrame = GetAnchorFrame(); + const bool bVert = rAnchorFrame.IsVertical(); const Size aObjSize( GetAnchoredObj().GetObjRect().SSize() ); if( bVert ) { - if ( rAnchorFrm.Frm().Top() + nAdjustedRelPosX + aObjSize.Height() > - _rPageAlignLayFrm.Frm().Bottom() ) + if ( rAnchorFrame.Frame().Top() + nAdjustedRelPosX + aObjSize.Height() > + _rPageAlignLayFrame.Frame().Bottom() ) { - nAdjustedRelPosX = _rPageAlignLayFrm.Frm().Bottom() - - rAnchorFrm.Frm().Top() - + nAdjustedRelPosX = _rPageAlignLayFrame.Frame().Bottom() - + rAnchorFrame.Frame().Top() - aObjSize.Height(); } - if ( rAnchorFrm.Frm().Top() + nAdjustedRelPosX < - _rPageAlignLayFrm.Frm().Top() ) + if ( rAnchorFrame.Frame().Top() + nAdjustedRelPosX < + _rPageAlignLayFrame.Frame().Top() ) { - nAdjustedRelPosX = _rPageAlignLayFrm.Frm().Top() - - rAnchorFrm.Frm().Top(); + nAdjustedRelPosX = _rPageAlignLayFrame.Frame().Top() - + rAnchorFrame.Frame().Top(); } } else { - if ( rAnchorFrm.Frm().Left() + nAdjustedRelPosX + aObjSize.Width() > - _rPageAlignLayFrm.Frm().Right() ) + if ( rAnchorFrame.Frame().Left() + nAdjustedRelPosX + aObjSize.Width() > + _rPageAlignLayFrame.Frame().Right() ) { - nAdjustedRelPosX = _rPageAlignLayFrm.Frm().Right() - - rAnchorFrm.Frm().Left() - + nAdjustedRelPosX = _rPageAlignLayFrame.Frame().Right() - + rAnchorFrame.Frame().Left() - aObjSize.Width(); } - if ( rAnchorFrm.Frm().Left() + nAdjustedRelPosX < - _rPageAlignLayFrm.Frm().Left() ) + if ( rAnchorFrame.Frame().Left() + nAdjustedRelPosX < + _rPageAlignLayFrame.Frame().Left() ) { - nAdjustedRelPosX = _rPageAlignLayFrm.Frm().Left() - - rAnchorFrm.Frm().Left(); + nAdjustedRelPosX = _rPageAlignLayFrame.Frame().Left() - + rAnchorFrame.Frame().Left(); } } @@ -550,8 +550,8 @@ SwTwips SwAnchoredObjectPosition::_ImplAdjustHoriRelPos( } /** determine alignment value for horizontal position of object */ -void SwAnchoredObjectPosition::_GetHoriAlignmentValues( const SwFrm& _rHoriOrientFrm, - const SwFrm& _rPageAlignLayFrm, +void SwAnchoredObjectPosition::_GetHoriAlignmentValues( const SwFrame& _rHoriOrientFrame, + const SwFrame& _rPageAlignLayFrame, const sal_Int16 _eRelOrient, const bool _bObjWrapThrough, SwTwips& _orAlignAreaWidth, @@ -560,36 +560,36 @@ void SwAnchoredObjectPosition::_GetHoriAlignmentValues( const SwFrm& _rHoriOrie { SwTwips nWidth = 0; SwTwips nOffset = 0; - SWRECTFN( (&_rHoriOrientFrm) ) + SWRECTFN( (&_rHoriOrientFrame) ) switch ( _eRelOrient ) { case text::RelOrientation::PRINT_AREA: { - nWidth = (_rHoriOrientFrm.Prt().*fnRect->fnGetWidth)(); - nOffset = (_rHoriOrientFrm.*fnRect->fnGetLeftMargin)(); - if ( _rHoriOrientFrm.IsTextFrm() ) + nWidth = (_rHoriOrientFrame.Prt().*fnRect->fnGetWidth)(); + nOffset = (_rHoriOrientFrame.*fnRect->fnGetLeftMargin)(); + if ( _rHoriOrientFrame.IsTextFrame() ) { // consider movement of text frame left - nOffset += static_cast<const SwTextFrm&>(_rHoriOrientFrm).GetBaseOfstForFly( !_bObjWrapThrough ); + nOffset += static_cast<const SwTextFrame&>(_rHoriOrientFrame).GetBaseOfstForFly( !_bObjWrapThrough ); } - else if ( _rHoriOrientFrm.IsPageFrm() && bVert ) + else if ( _rHoriOrientFrame.IsPageFrame() && bVert ) { // for to-page anchored objects, consider header/footer frame // in vertical layout - const SwFrm* pPrtFrm = - static_cast<const SwPageFrm&>(_rHoriOrientFrm).Lower(); - while( pPrtFrm ) + const SwFrame* pPrtFrame = + static_cast<const SwPageFrame&>(_rHoriOrientFrame).Lower(); + while( pPrtFrame ) { - if( pPrtFrm->IsHeaderFrm() ) + if( pPrtFrame->IsHeaderFrame() ) { - nWidth -= pPrtFrm->Frm().Height(); - nOffset += pPrtFrm->Frm().Height(); + nWidth -= pPrtFrame->Frame().Height(); + nOffset += pPrtFrame->Frame().Height(); } - else if( pPrtFrm->IsFooterFrm() ) + else if( pPrtFrame->IsFooterFrame() ) { - nWidth -= pPrtFrm->Frm().Height(); + nWidth -= pPrtFrame->Frame().Height(); } - pPrtFrm = pPrtFrm->GetNext(); + pPrtFrame = pPrtFrame->GetNext(); } } break; @@ -597,27 +597,27 @@ void SwAnchoredObjectPosition::_GetHoriAlignmentValues( const SwFrm& _rHoriOrie case text::RelOrientation::PAGE_LEFT: { // align at left border of page frame/fly frame/cell frame - nWidth = (_rPageAlignLayFrm.*fnRect->fnGetLeftMargin)(); + nWidth = (_rPageAlignLayFrame.*fnRect->fnGetLeftMargin)(); nOffset = (*fnRect->fnXDiff)( - (_rPageAlignLayFrm.Frm().*fnRect->fnGetLeft)(), - (_rHoriOrientFrm.Frm().*fnRect->fnGetLeft)() ); + (_rPageAlignLayFrame.Frame().*fnRect->fnGetLeft)(), + (_rHoriOrientFrame.Frame().*fnRect->fnGetLeft)() ); _obAlignedRelToPage = true; } break; case text::RelOrientation::PAGE_RIGHT: { // align at right border of page frame/fly frame/cell frame - nWidth = (_rPageAlignLayFrm.*fnRect->fnGetRightMargin)(); + nWidth = (_rPageAlignLayFrame.*fnRect->fnGetRightMargin)(); nOffset = (*fnRect->fnXDiff)( - (_rPageAlignLayFrm.*fnRect->fnGetPrtRight)(), - (_rHoriOrientFrm.Frm().*fnRect->fnGetLeft)() ); + (_rPageAlignLayFrame.*fnRect->fnGetPrtRight)(), + (_rHoriOrientFrame.Frame().*fnRect->fnGetLeft)() ); _obAlignedRelToPage = true; } break; case text::RelOrientation::FRAME_LEFT: { // align at left border of anchor frame - nWidth = (_rHoriOrientFrm.*fnRect->fnGetLeftMargin)(); + nWidth = (_rHoriOrientFrame.*fnRect->fnGetLeftMargin)(); nOffset = 0; } break; @@ -625,8 +625,8 @@ void SwAnchoredObjectPosition::_GetHoriAlignmentValues( const SwFrm& _rHoriOrie { // align at right border of anchor frame // Unify and simplify - nWidth = (_rHoriOrientFrm.*fnRect->fnGetRightMargin)(); - nOffset = (_rHoriOrientFrm.Prt().*fnRect->fnGetRight)(); + nWidth = (_rHoriOrientFrame.*fnRect->fnGetRightMargin)(); + nOffset = (_rHoriOrientFrame.Prt().*fnRect->fnGetRight)(); } break; case text::RelOrientation::CHAR: @@ -638,35 +638,35 @@ void SwAnchoredObjectPosition::_GetHoriAlignmentValues( const SwFrm& _rHoriOrie nWidth = 0; nOffset = (*fnRect->fnXDiff)( (ToCharRect()->*fnRect->fnGetLeft)(), - (ToCharOrientFrm()->Frm().*fnRect->fnGetLeft)() ); + (ToCharOrientFrame()->Frame().*fnRect->fnGetLeft)() ); break; } // no break! } case text::RelOrientation::PAGE_PRINT_AREA: { - nWidth = (_rPageAlignLayFrm.Prt().*fnRect->fnGetWidth)(); + nWidth = (_rPageAlignLayFrame.Prt().*fnRect->fnGetWidth)(); nOffset = (*fnRect->fnXDiff)( - (_rPageAlignLayFrm.*fnRect->fnGetPrtLeft)(), - (_rHoriOrientFrm.Frm().*fnRect->fnGetLeft)() ); - if ( _rHoriOrientFrm.IsPageFrm() && bVert ) + (_rPageAlignLayFrame.*fnRect->fnGetPrtLeft)(), + (_rHoriOrientFrame.Frame().*fnRect->fnGetLeft)() ); + if ( _rHoriOrientFrame.IsPageFrame() && bVert ) { // for to-page anchored objects, consider header/footer frame // in vertical layout - const SwFrm* pPrtFrm = - static_cast<const SwPageFrm&>(_rHoriOrientFrm).Lower(); - while( pPrtFrm ) + const SwFrame* pPrtFrame = + static_cast<const SwPageFrame&>(_rHoriOrientFrame).Lower(); + while( pPrtFrame ) { - if( pPrtFrm->IsHeaderFrm() ) + if( pPrtFrame->IsHeaderFrame() ) { - nWidth -= pPrtFrm->Frm().Height(); - nOffset += pPrtFrm->Frm().Height(); + nWidth -= pPrtFrame->Frame().Height(); + nOffset += pPrtFrame->Frame().Height(); } - else if( pPrtFrm->IsFooterFrm() ) + else if( pPrtFrame->IsFooterFrame() ) { - nWidth -= pPrtFrm->Frm().Height(); + nWidth -= pPrtFrame->Frame().Height(); } - pPrtFrm = pPrtFrm->GetNext(); + pPrtFrame = pPrtFrame->GetNext(); } } _obAlignedRelToPage = true; @@ -674,23 +674,23 @@ void SwAnchoredObjectPosition::_GetHoriAlignmentValues( const SwFrm& _rHoriOrie } case text::RelOrientation::PAGE_FRAME: { - nWidth = (_rPageAlignLayFrm.Frm().*fnRect->fnGetWidth)(); + nWidth = (_rPageAlignLayFrame.Frame().*fnRect->fnGetWidth)(); nOffset = (*fnRect->fnXDiff)( - (_rPageAlignLayFrm.Frm().*fnRect->fnGetLeft)(), - (_rHoriOrientFrm.Frm().*fnRect->fnGetLeft)() ); + (_rPageAlignLayFrame.Frame().*fnRect->fnGetLeft)(), + (_rHoriOrientFrame.Frame().*fnRect->fnGetLeft)() ); _obAlignedRelToPage = true; break; } default: { - nWidth = (_rHoriOrientFrm.Frm().*fnRect->fnGetWidth)(); + nWidth = (_rHoriOrientFrame.Frame().*fnRect->fnGetWidth)(); // When positioning TextBoxes, always ignore flys anchored at the // text frame, as we do want to have the textbox overlap with its // draw shape. bool bIgnoreFlysAnchoredAtFrame = !_bObjWrapThrough || SwTextBoxHelper::isTextBox(&GetObject()); - nOffset = _rHoriOrientFrm.IsTextFrm() ? - static_cast<const SwTextFrm&>(_rHoriOrientFrm).GetBaseOfstForFly( bIgnoreFlysAnchoredAtFrame ) : + nOffset = _rHoriOrientFrame.IsTextFrame() ? + static_cast<const SwTextFrame&>(_rHoriOrientFrame).GetBaseOfstForFly( bIgnoreFlysAnchoredAtFrame ) : 0; break; } @@ -757,21 +757,21 @@ void SwAnchoredObjectPosition::_ToggleHoriOrientAndAlign( /** calculate relative horizontal position */ SwTwips SwAnchoredObjectPosition::_CalcRelPosX( - const SwFrm& _rHoriOrientFrm, + const SwFrame& _rHoriOrientFrame, const SwEnvironmentOfAnchoredObject& _rEnvOfObj, const SwFormatHoriOrient& _rHoriOrient, const SvxLRSpaceItem& _rLRSpacing, const SvxULSpaceItem& _rULSpacing, const bool _bObjWrapThrough, const SwTwips _nRelPosY, - SwTwips& _roHoriOffsetToFrmAnchorPos + SwTwips& _roHoriOffsetToFrameAnchorPos ) const { // determine 'page' alignment layout frame - const SwFrm& rPageAlignLayFrm = - _rEnvOfObj.GetHoriEnvironmentLayoutFrm( _rHoriOrientFrm ); + const SwFrame& rPageAlignLayFrame = + _rEnvOfObj.GetHoriEnvironmentLayoutFrame( _rHoriOrientFrame ); - const bool bEvenPage = !rPageAlignLayFrm.OnRightPage(); + const bool bEvenPage = !rPageAlignLayFrame.OnRightPage(); const bool bToggle = _rHoriOrient.IsPosToggle() && bEvenPage; // determine orientation and relative alignment @@ -786,18 +786,18 @@ SwTwips SwAnchoredObjectPosition::_CalcRelPosX( SwTwips nWidth = 0; SwTwips nOffset = 0; bool bAlignedRelToPage = false; - _GetHoriAlignmentValues( _rHoriOrientFrm, rPageAlignLayFrm, + _GetHoriAlignmentValues( _rHoriOrientFrame, rPageAlignLayFrame, eRelOrient, _bObjWrapThrough, nWidth, nOffset, bAlignedRelToPage ); - const SwFrm& rAnchorFrm = GetAnchorFrm(); - SWRECTFN( (&_rHoriOrientFrm) ) + const SwFrame& rAnchorFrame = GetAnchorFrame(); + SWRECTFN( (&_rHoriOrientFrame) ) SwTwips nObjWidth = (GetAnchoredObj().GetObjRect().*fnRect->fnGetWidth)(); SwTwips nRelPosX = nOffset; if ( _rHoriOrient.GetHoriOrient() == text::HoriOrientation::NONE ) { // 'manual' horizonal position - const bool bR2L = rAnchorFrm.IsRightToLeft(); + const bool bR2L = rAnchorFrame.IsRightToLeft(); if( IsAnchoredToChar() && text::RelOrientation::CHAR == eRelOrient ) { if( bR2L ) @@ -827,29 +827,29 @@ SwTwips SwAnchoredObjectPosition::_CalcRelPosX( // adjust relative position by distance between anchor frame and // the frame, the object is oriented at. - if ( &rAnchorFrm != &_rHoriOrientFrm ) + if ( &rAnchorFrame != &_rHoriOrientFrame ) { - SwTwips nLeftOrient = (_rHoriOrientFrm.Frm().*fnRect->fnGetLeft)(); - SwTwips nLeftAnchor = (rAnchorFrm.Frm().*fnRect->fnGetLeft)(); + SwTwips nLeftOrient = (_rHoriOrientFrame.Frame().*fnRect->fnGetLeft)(); + SwTwips nLeftAnchor = (rAnchorFrame.Frame().*fnRect->fnGetLeft)(); nRelPosX += (*fnRect->fnXDiff)( nLeftOrient, nLeftAnchor ); } // adjust calculated relative horizontal position, in order to // keep object inside 'page' alignment layout frame - const SwFrm& rEnvironmentLayFrm = - _rEnvOfObj.GetHoriEnvironmentLayoutFrm( _rHoriOrientFrm ); - nRelPosX = _AdjustHoriRelPos( rEnvironmentLayFrm, nRelPosX ); + const SwFrame& rEnvironmentLayFrame = + _rEnvOfObj.GetHoriEnvironmentLayoutFrame( _rHoriOrientFrame ); + nRelPosX = _AdjustHoriRelPos( rEnvironmentLayFrame, nRelPosX ); // if object is a Writer fly frame and it's anchored to a content and // it is horizontal positioned left or right, but not relative to character, // it has to be drawn aside another object, which have the same horizontal // position and lay below it. - if ( dynamic_cast<const SwFlyFrm*>( &GetAnchoredObj() ) != nullptr && + if ( dynamic_cast<const SwFlyFrame*>( &GetAnchoredObj() ) != nullptr && ( GetContact().ObjAnchoredAtPara() || GetContact().ObjAnchoredAtChar() ) && ( eHoriOrient == text::HoriOrientation::LEFT || eHoriOrient == text::HoriOrientation::RIGHT ) && eRelOrient != text::RelOrientation::CHAR ) { - nRelPosX = _AdjustHoriRelPosForDrawAside( _rHoriOrientFrm, + nRelPosX = _AdjustHoriRelPosForDrawAside( _rHoriOrientFrame, nRelPosX, _nRelPosY, eHoriOrient, eRelOrient, _rLRSpacing, _rULSpacing, @@ -857,7 +857,7 @@ SwTwips SwAnchoredObjectPosition::_CalcRelPosX( } // #i26791# - _roHoriOffsetToFrmAnchorPos = nOffset; + _roHoriOffsetToFrameAnchorPos = nOffset; return nRelPosX; } @@ -868,7 +868,7 @@ SwTwips SwAnchoredObjectPosition::_CalcRelPosX( aside other objects with same positioning */ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside( - const SwFrm& _rHoriOrientFrm, + const SwFrame& _rHoriOrientFrame, const SwTwips _nProposedRelPosX, const SwTwips _nRelPosY, const sal_Int16 _eHoriOrient, @@ -879,24 +879,24 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside( ) const { // #i26791# - if ( dynamic_cast<const SwTextFrm*>( &GetAnchorFrm() ) == nullptr || - dynamic_cast<const SwFlyAtCntFrm*>( &GetAnchoredObj() ) == nullptr ) + if ( dynamic_cast<const SwTextFrame*>( &GetAnchorFrame() ) == nullptr || + dynamic_cast<const SwFlyAtContentFrame*>( &GetAnchoredObj() ) == nullptr ) { OSL_FAIL( "<SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside(..) - usage for wrong anchor type" ); return _nProposedRelPosX; } - const SwTextFrm& rAnchorTextFrm = static_cast<const SwTextFrm&>(GetAnchorFrm()); + const SwTextFrame& rAnchorTextFrame = static_cast<const SwTextFrame&>(GetAnchorFrame()); // #i26791# - const SwFlyAtCntFrm& rFlyAtCntFrm = - static_cast<const SwFlyAtCntFrm&>(GetAnchoredObj()); + const SwFlyAtContentFrame& rFlyAtContentFrame = + static_cast<const SwFlyAtContentFrame&>(GetAnchoredObj()); const SwRect aObjBoundRect( GetAnchoredObj().GetObjRect() ); - SWRECTFN( (&_rHoriOrientFrm) ) + SWRECTFN( (&_rHoriOrientFrame) ) SwTwips nAdjustedRelPosX = _nProposedRelPosX; // determine proposed object bound rectangle - Point aTmpPos = (rAnchorTextFrm.Frm().*fnRect->fnGetPos)(); + Point aTmpPos = (rAnchorTextFrame.Frame().*fnRect->fnGetPos)(); if( bVert ) { aTmpPos.X() -= _nRelPosY + aObjBoundRect.Width(); @@ -910,11 +910,11 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside( SwRect aTmpObjRect( aTmpPos, aObjBoundRect.SSize() ); const sal_uInt32 nObjOrdNum = GetObject().GetOrdNum(); - const SwPageFrm* pObjPage = rFlyAtCntFrm.FindPageFrm(); - const SwFrm* pObjContext = ::FindKontext( &rAnchorTextFrm, FRM_COLUMN ); - sal_uLong nObjIndex = rAnchorTextFrm.GetTextNode()->GetIndex(); + const SwPageFrame* pObjPage = rFlyAtContentFrame.FindPageFrame(); + const SwFrame* pObjContext = ::FindKontext( &rAnchorTextFrame, FRM_COLUMN ); + sal_uLong nObjIndex = rAnchorTextFrame.GetTextNode()->GetIndex(); SwOrderIter aIter( pObjPage, true ); - const SwFlyFrm* pFly = static_cast<const SwVirtFlyDrawObj*>(aIter.Bottom())->GetFlyFrm(); + const SwFlyFrame* pFly = static_cast<const SwVirtFlyDrawObj*>(aIter.Bottom())->GetFlyFrame(); while ( pFly && nObjOrdNum > pFly->GetVirtDrawObj()->GetOrdNumDirect() ) { if ( _DrawAsideFly( pFly, aTmpObjRect, pObjContext, nObjIndex, @@ -923,19 +923,19 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside( if( bVert ) { const SvxULSpaceItem& rOtherUL = pFly->GetFormat()->GetULSpace(); - const SwTwips nOtherTop = pFly->Frm().Top() - rOtherUL.GetUpper(); - const SwTwips nOtherBot = pFly->Frm().Bottom() + rOtherUL.GetLower(); + const SwTwips nOtherTop = pFly->Frame().Top() - rOtherUL.GetUpper(); + const SwTwips nOtherBot = pFly->Frame().Bottom() + rOtherUL.GetLower(); if ( nOtherTop <= aTmpObjRect.Bottom() + _rULSpacing.GetLower() && nOtherBot >= aTmpObjRect.Top() - _rULSpacing.GetUpper() ) { if ( _eHoriOrient == text::HoriOrientation::LEFT ) { SwTwips nTmp = nOtherBot + 1 + _rULSpacing.GetUpper() - - rAnchorTextFrm.Frm().Top(); + rAnchorTextFrame.Frame().Top(); if ( nTmp > nAdjustedRelPosX && - rAnchorTextFrm.Frm().Top() + nTmp + + rAnchorTextFrame.Frame().Top() + nTmp + aObjBoundRect.Height() + _rULSpacing.GetLower() - <= pObjPage->Frm().Height() + pObjPage->Frm().Top() ) + <= pObjPage->Frame().Height() + pObjPage->Frame().Top() ) { nAdjustedRelPosX = nTmp; } @@ -944,34 +944,34 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside( { SwTwips nTmp = nOtherTop - 1 - _rULSpacing.GetLower() - aObjBoundRect.Height() - - rAnchorTextFrm.Frm().Top(); + rAnchorTextFrame.Frame().Top(); if ( nTmp < nAdjustedRelPosX && - rAnchorTextFrm.Frm().Top() + nTmp - _rULSpacing.GetUpper() - >= pObjPage->Frm().Top() ) + rAnchorTextFrame.Frame().Top() + nTmp - _rULSpacing.GetUpper() + >= pObjPage->Frame().Top() ) { nAdjustedRelPosX = nTmp; } } - aTmpObjRect.Pos().Y() = rAnchorTextFrm.Frm().Top() + + aTmpObjRect.Pos().Y() = rAnchorTextFrame.Frame().Top() + nAdjustedRelPosX; } } else { const SvxLRSpaceItem& rOtherLR = pFly->GetFormat()->GetLRSpace(); - const SwTwips nOtherLeft = pFly->Frm().Left() - rOtherLR.GetLeft(); - const SwTwips nOtherRight = pFly->Frm().Right() + rOtherLR.GetRight(); + const SwTwips nOtherLeft = pFly->Frame().Left() - rOtherLR.GetLeft(); + const SwTwips nOtherRight = pFly->Frame().Right() + rOtherLR.GetRight(); if( nOtherLeft <= aTmpObjRect.Right() + _rLRSpacing.GetRight() && nOtherRight >= aTmpObjRect.Left() - _rLRSpacing.GetLeft() ) { if ( _eHoriOrient == text::HoriOrientation::LEFT ) { SwTwips nTmp = nOtherRight + 1 + _rLRSpacing.GetLeft() - - rAnchorTextFrm.Frm().Left(); + rAnchorTextFrame.Frame().Left(); if ( nTmp > nAdjustedRelPosX && - rAnchorTextFrm.Frm().Left() + nTmp + + rAnchorTextFrame.Frame().Left() + nTmp + aObjBoundRect.Width() + _rLRSpacing.GetRight() - <= pObjPage->Frm().Width() + pObjPage->Frm().Left() ) + <= pObjPage->Frame().Width() + pObjPage->Frame().Left() ) { nAdjustedRelPosX = nTmp; } @@ -980,21 +980,21 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside( { SwTwips nTmp = nOtherLeft - 1 - _rLRSpacing.GetRight() - aObjBoundRect.Width() - - rAnchorTextFrm.Frm().Left(); + rAnchorTextFrame.Frame().Left(); if ( nTmp < nAdjustedRelPosX && - rAnchorTextFrm.Frm().Left() + nTmp - _rLRSpacing.GetLeft() - >= pObjPage->Frm().Left() ) + rAnchorTextFrame.Frame().Left() + nTmp - _rLRSpacing.GetLeft() + >= pObjPage->Frame().Left() ) { nAdjustedRelPosX = nTmp; } } - aTmpObjRect.Pos().X() = rAnchorTextFrm.Frm().Left() + + aTmpObjRect.Pos().X() = rAnchorTextFrame.Frame().Left() + nAdjustedRelPosX; } } // end of <if (bVert)> } // end of <if _DrawAsideFly(..)> - pFly = static_cast<const SwVirtFlyDrawObj*>(aIter.Next())->GetFlyFrm(); + pFly = static_cast<const SwVirtFlyDrawObj*>(aIter.Next())->GetFlyFrame(); } // end of <loop on fly frames return nAdjustedRelPosX; @@ -1004,9 +1004,9 @@ SwTwips SwAnchoredObjectPosition::_AdjustHoriRelPosForDrawAside( method used by <_AdjustHoriRelPosForDrawAside(..)> */ -bool SwAnchoredObjectPosition::_DrawAsideFly( const SwFlyFrm* _pFly, +bool SwAnchoredObjectPosition::_DrawAsideFly( const SwFlyFrame* _pFly, const SwRect& _rObjRect, - const SwFrm* _pObjContext, + const SwFrame* _pObjContext, const sal_uLong _nObjIndex, const bool _bEvenPage, const sal_Int16 _eHoriOrient, @@ -1015,15 +1015,15 @@ bool SwAnchoredObjectPosition::_DrawAsideFly( const SwFlyFrm* _pFly, { bool bRetVal = false; - SWRECTFN( (&GetAnchorFrm()) ) + SWRECTFN( (&GetAnchorFrame()) ) - if ( _pFly->IsFlyAtCntFrm() && - (_pFly->Frm().*fnRect->fnBottomDist)( (_rObjRect.*fnRect->fnGetTop)() ) < 0 && - (_rObjRect.*fnRect->fnBottomDist)( (_pFly->Frm().*fnRect->fnGetTop)() ) < 0 && - ::FindKontext( _pFly->GetAnchorFrm(), FRM_COLUMN ) == _pObjContext ) + if ( _pFly->IsFlyAtContentFrame() && + (_pFly->Frame().*fnRect->fnBottomDist)( (_rObjRect.*fnRect->fnGetTop)() ) < 0 && + (_rObjRect.*fnRect->fnBottomDist)( (_pFly->Frame().*fnRect->fnGetTop)() ) < 0 && + ::FindKontext( _pFly->GetAnchorFrame(), FRM_COLUMN ) == _pObjContext ) { sal_uLong nOtherIndex = - static_cast<const SwTextFrm*>(_pFly->GetAnchorFrm())->GetTextNode()->GetIndex(); + static_cast<const SwTextFrame*>(_pFly->GetAnchorFrame())->GetTextNode()->GetIndex(); if( _nObjIndex >= nOtherIndex ) { const SwFormatHoriOrient& rHori = _pFly->GetFormat()->GetHoriOrient(); diff --git a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx index 6685a8a1d54e..3082bb50e8e5 100644 --- a/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/ascharanchoredobjectposition.cxx @@ -60,13 +60,13 @@ SwAsCharAnchoredObjectPosition::SwAsCharAnchoredObjectPosition( SwAsCharAnchoredObjectPosition::~SwAsCharAnchoredObjectPosition() {} -/** method to cast <SwAnchoredObjectPosition::GetAnchorFrm()> to needed type */ -const SwTextFrm& SwAsCharAnchoredObjectPosition::GetAnchorTextFrm() const +/** method to cast <SwAnchoredObjectPosition::GetAnchorFrame()> to needed type */ +const SwTextFrame& SwAsCharAnchoredObjectPosition::GetAnchorTextFrame() const { - OSL_ENSURE( dynamic_cast<const SwTextFrm*>( &GetAnchorFrm() ) != nullptr, - "SwAsCharAnchoredObjectPosition::GetAnchorTextFrm() - wrong anchor frame type" ); + OSL_ENSURE( dynamic_cast<const SwTextFrame*>( &GetAnchorFrame() ) != nullptr, + "SwAsCharAnchoredObjectPosition::GetAnchorTextFrame() - wrong anchor frame type" ); - return static_cast<const SwTextFrm&>(GetAnchorFrm()); + return static_cast<const SwTextFrame&>(GetAnchorFrame()); } /** calculate position for object @@ -78,11 +78,11 @@ const SwTextFrm& SwAsCharAnchoredObjectPosition::GetAnchorTextFrm() const */ void SwAsCharAnchoredObjectPosition::CalcPosition() { - const SwTextFrm& rAnchorFrm = GetAnchorTextFrm(); + const SwTextFrame& rAnchorFrame = GetAnchorTextFrame(); // swap anchor frame, if swapped. Note: destructor takes care of the 'undo' - SwFrmSwapper aFrmSwapper( &rAnchorFrm, false ); + SwFrameSwapper aFrameSwapper( &rAnchorFrame, false ); - SWRECTFN( ( &rAnchorFrm ) ) + SWRECTFN( ( &rAnchorFrame ) ) Point aAnchorPos( mrProposedAnchorPos ); @@ -96,12 +96,12 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() const SvxULSpaceItem& rULSpace = rFrameFormat.GetULSpace(); SwTwips nLRSpaceLeft, nLRSpaceRight, nULSpaceUpper, nULSpaceLower; { - if ( rAnchorFrm.IsVertical() ) + if ( rAnchorFrame.IsVertical() ) { // Seems to be easier to do it all the horizontal way // So, from now on think horizontal. - rAnchorFrm.SwitchVerticalToHorizontal( aObjBoundRect ); - rAnchorFrm.SwitchVerticalToHorizontal( aAnchorPos ); + rAnchorFrame.SwitchVerticalToHorizontal( aObjBoundRect ); + rAnchorFrame.SwitchVerticalToHorizontal( aAnchorPos ); // convert the spacing values nLRSpaceLeft = rULSpace.GetUpper(); @@ -111,7 +111,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() } else { - if ( rAnchorFrm.IsRightToLeft() ) + if ( rAnchorFrame.IsRightToLeft() ) { nLRSpaceLeft = rLRSpace.GetRight(); nLRSpaceRight = rLRSpace.GetLeft(); @@ -141,9 +141,9 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() if( !IsObjFly() ) { SwRect aSnapRect = GetObject().GetSnapRect(); - if ( rAnchorFrm.IsVertical() ) + if ( rAnchorFrame.IsVertical() ) { - rAnchorFrm.SwitchVerticalToHorizontal( aSnapRect ); + rAnchorFrame.SwitchVerticalToHorizontal( aSnapRect ); } if( mnFlags & AS_CHAR_ULSPACE ) @@ -222,13 +222,13 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() // Note: Use copy of <aAnchorPos>, because it's needed for // setting relative position. Point aAbsAnchorPos( aAnchorPos ); - if ( rAnchorFrm.IsRightToLeft() ) + if ( rAnchorFrame.IsRightToLeft() ) { - rAnchorFrm.SwitchLTRtoRTL( aAbsAnchorPos ); + rAnchorFrame.SwitchLTRtoRTL( aAbsAnchorPos ); aAbsAnchorPos.X() -= nObjWidth; } - if ( rAnchorFrm.IsVertical() ) - rAnchorFrm.SwitchHorizontalToVertical( aAbsAnchorPos ); + if ( rAnchorFrame.IsVertical() ) + rAnchorFrame.SwitchHorizontalToVertical( aAbsAnchorPos ); // set proposed anchor position at the drawing object. // OD 2004-04-06 #i26791# - distinction between 'master' drawing @@ -238,16 +238,16 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() // move drawing object to set its correct relative position. { SwRect aSnapRect = GetObject().GetSnapRect(); - if ( rAnchorFrm.IsVertical() ) - rAnchorFrm.SwitchVerticalToHorizontal( aSnapRect ); + if ( rAnchorFrame.IsVertical() ) + rAnchorFrame.SwitchVerticalToHorizontal( aSnapRect ); Point aDiff; - if ( rAnchorFrm.IsRightToLeft() ) + if ( rAnchorFrame.IsRightToLeft() ) aDiff = aRelPos + aAbsAnchorPos - aSnapRect.TopLeft(); else aDiff = aRelPos + aAnchorPos - aSnapRect.TopLeft(); - if ( rAnchorFrm.IsVertical() ) + if ( rAnchorFrame.IsVertical() ) aDiff = Point( -aDiff.Y(), aDiff.X() ); // OD 2004-04-06 #i26791# - distinction between 'master' drawing @@ -257,13 +257,13 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() } // switch horizontal, LTR anchor position to absolute values. - if ( rAnchorFrm.IsRightToLeft() ) + if ( rAnchorFrame.IsRightToLeft() ) { - rAnchorFrm.SwitchLTRtoRTL( aAnchorPos ); + rAnchorFrame.SwitchLTRtoRTL( aAnchorPos ); aAnchorPos.X() -= nObjWidth; } - if ( rAnchorFrm.IsVertical() ) - rAnchorFrm.SwitchHorizontalToVertical( aAnchorPos ); + if ( rAnchorFrame.IsVertical() ) + rAnchorFrame.SwitchHorizontalToVertical( aAnchorPos ); // #i44347# - keep last object rectangle at anchored object OSL_ENSURE( dynamic_cast<const SwAnchoredDrawObject*>( &GetAnchoredObj() ) != nullptr, @@ -278,14 +278,14 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() // relative position and its relative position attribute. // Note: The relative position contains the spacing values. Point aRelAttr; - if ( rAnchorFrm.IsRightToLeft() ) + if ( rAnchorFrame.IsRightToLeft() ) { - rAnchorFrm.SwitchLTRtoRTL( aAnchorPos ); + rAnchorFrame.SwitchLTRtoRTL( aAnchorPos ); aAnchorPos.X() -= nObjWidth; } - if ( rAnchorFrm.IsVertical() ) + if ( rAnchorFrame.IsVertical() ) { - rAnchorFrm.SwitchHorizontalToVertical( aAnchorPos ); + rAnchorFrame.SwitchHorizontalToVertical( aAnchorPos ); aRelAttr = Point( -nRelPos, 0 ); aRelPos = Point( -aRelPos.Y(), aRelPos.X() ); } @@ -293,18 +293,18 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() aRelAttr = Point( 0, nRelPos ); // OD 2004-03-23 #i26791# - OSL_ENSURE( dynamic_cast<const SwFlyInCntFrm*>( &GetAnchoredObj()) != nullptr, + OSL_ENSURE( dynamic_cast<const SwFlyInContentFrame*>( &GetAnchoredObj()) != nullptr, "<SwAsCharAnchoredObjectPosition::CalcPosition()> - wrong anchored object." ); - const SwFlyInCntFrm& rFlyInCntFrm = - static_cast<const SwFlyInCntFrm&>(GetAnchoredObj()); + const SwFlyInContentFrame& rFlyInContentFrame = + static_cast<const SwFlyInContentFrame&>(GetAnchoredObj()); if ( !(mnFlags & AS_CHAR_QUICK) && - ( aAnchorPos != rFlyInCntFrm.GetRefPoint() || - aRelAttr != rFlyInCntFrm.GetCurrRelPos() ) ) + ( aAnchorPos != rFlyInContentFrame.GetRefPoint() || + aRelAttr != rFlyInContentFrame.GetCurrRelPos() ) ) { // set new anchor position and relative position - SwFlyInCntFrm* pFlyInCntFrm = &(const_cast<SwFlyInCntFrm&>(rFlyInCntFrm)); - pFlyInCntFrm->SetRefPoint( aAnchorPos, aRelAttr, aRelPos ); - if( nObjWidth != (pFlyInCntFrm->Frm().*fnRect->fnGetWidth)() ) + SwFlyInContentFrame* pFlyInContentFrame = &(const_cast<SwFlyInContentFrame&>(rFlyInContentFrame)); + pFlyInContentFrame->SetRefPoint( aAnchorPos, aRelAttr, aRelPos ); + if( nObjWidth != (pFlyInContentFrame->Frame().*fnRect->fnGetWidth)() ) { // recalculate object bound rectangle, if object width has changed. aObjBoundRect = GetAnchoredObj().GetObjRect(); @@ -314,7 +314,7 @@ void SwAsCharAnchoredObjectPosition::CalcPosition() aObjBoundRect.Height( aObjBoundRect.Height() + rULSpace.GetLower() ); } } - OSL_ENSURE( (rFlyInCntFrm.Frm().*fnRect->fnGetHeight)(), + OSL_ENSURE( (rFlyInContentFrame.Frame().*fnRect->fnGetHeight)(), "SwAnchoredObjectPosition::CalcPosition(..) - fly frame has an invalid height" ); } diff --git a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx index 46c4818f0319..8e00bf3c592e 100644 --- a/sw/source/core/objectpositioning/environmentofanchoredobject.cxx +++ b/sw/source/core/objectpositioning/environmentofanchoredobject.cxx @@ -33,67 +33,67 @@ SwEnvironmentOfAnchoredObject::~SwEnvironmentOfAnchoredObject() {} /** determine environment layout frame for possible horizontal object positions */ -const SwLayoutFrm& SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrm( - const SwFrm& _rHoriOrientFrm ) const +const SwLayoutFrame& SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrame( + const SwFrame& _rHoriOrientFrame ) const { - const SwFrm* pHoriEnvironmentLayFrm = &_rHoriOrientFrm; + const SwFrame* pHoriEnvironmentLayFrame = &_rHoriOrientFrame; if ( !mbFollowTextFlow ) { // No exception any more for page alignment. // the page frame determines the horizontal layout environment. - pHoriEnvironmentLayFrm = _rHoriOrientFrm.FindPageFrm(); + pHoriEnvironmentLayFrame = _rHoriOrientFrame.FindPageFrame(); } else { - while ( !pHoriEnvironmentLayFrm->IsCellFrm() && - !pHoriEnvironmentLayFrm->IsFlyFrm() && - !pHoriEnvironmentLayFrm->IsPageFrm() ) + while ( !pHoriEnvironmentLayFrame->IsCellFrame() && + !pHoriEnvironmentLayFrame->IsFlyFrame() && + !pHoriEnvironmentLayFrame->IsPageFrame() ) { - pHoriEnvironmentLayFrm = pHoriEnvironmentLayFrm->GetUpper(); - OSL_ENSURE( pHoriEnvironmentLayFrm, - "SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrm(..) - no page|fly|cell frame found" ); + pHoriEnvironmentLayFrame = pHoriEnvironmentLayFrame->GetUpper(); + OSL_ENSURE( pHoriEnvironmentLayFrame, + "SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrame(..) - no page|fly|cell frame found" ); } } - OSL_ENSURE( dynamic_cast< const SwLayoutFrm *>( pHoriEnvironmentLayFrm ) != nullptr, - "SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrm(..) - found frame isn't a layout frame" ); + OSL_ENSURE( dynamic_cast< const SwLayoutFrame *>( pHoriEnvironmentLayFrame ) != nullptr, + "SwEnvironmentOfAnchoredObject::GetHoriEnvironmentLayoutFrame(..) - found frame isn't a layout frame" ); - return static_cast<const SwLayoutFrm&>(*pHoriEnvironmentLayFrm); + return static_cast<const SwLayoutFrame&>(*pHoriEnvironmentLayFrame); } /** determine environment layout frame for possible vertical object positions */ -const SwLayoutFrm& SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrm( - const SwFrm& _rVertOrientFrm ) const +const SwLayoutFrame& SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrame( + const SwFrame& _rVertOrientFrame ) const { - const SwFrm* pVertEnvironmentLayFrm = &_rVertOrientFrm; + const SwFrame* pVertEnvironmentLayFrame = &_rVertOrientFrame; if ( !mbFollowTextFlow ) { // No exception any more for page alignment. // the page frame determines the vertical layout environment. - pVertEnvironmentLayFrm = _rVertOrientFrm.FindPageFrm(); + pVertEnvironmentLayFrame = _rVertOrientFrame.FindPageFrame(); } else { - while ( !pVertEnvironmentLayFrm->IsCellFrm() && - !pVertEnvironmentLayFrm->IsFlyFrm() && - !pVertEnvironmentLayFrm->IsHeaderFrm() && - !pVertEnvironmentLayFrm->IsFooterFrm() && - !pVertEnvironmentLayFrm->IsFootnoteFrm() && - !pVertEnvironmentLayFrm->IsPageBodyFrm() && - !pVertEnvironmentLayFrm->IsPageFrm() ) + while ( !pVertEnvironmentLayFrame->IsCellFrame() && + !pVertEnvironmentLayFrame->IsFlyFrame() && + !pVertEnvironmentLayFrame->IsHeaderFrame() && + !pVertEnvironmentLayFrame->IsFooterFrame() && + !pVertEnvironmentLayFrame->IsFootnoteFrame() && + !pVertEnvironmentLayFrame->IsPageBodyFrame() && + !pVertEnvironmentLayFrame->IsPageFrame() ) { - pVertEnvironmentLayFrm = pVertEnvironmentLayFrm->GetUpper(); - OSL_ENSURE( pVertEnvironmentLayFrm, - "SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrm(..) - proposed frame not found" ); + pVertEnvironmentLayFrame = pVertEnvironmentLayFrame->GetUpper(); + OSL_ENSURE( pVertEnvironmentLayFrame, + "SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrame(..) - proposed frame not found" ); } } - OSL_ENSURE( dynamic_cast< const SwLayoutFrm *>( pVertEnvironmentLayFrm ) != nullptr, - "SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrm(..) - found frame isn't a layout frame" ); + OSL_ENSURE( dynamic_cast< const SwLayoutFrame *>( pVertEnvironmentLayFrame ) != nullptr, + "SwEnvironmentOfAnchoredObject::GetVertEnvironmentLayoutFrame(..) - found frame isn't a layout frame" ); - return static_cast<const SwLayoutFrm&>(*pVertEnvironmentLayFrm); + return static_cast<const SwLayoutFrame&>(*pVertEnvironmentLayFrame); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx index a99c16c022f1..f51d0612dad6 100644 --- a/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tocntntanchoredobjectposition.cxx @@ -47,11 +47,11 @@ using namespace ::com::sun::star; SwToContentAnchoredObjectPosition::SwToContentAnchoredObjectPosition( SdrObject& _rDrawObj ) : SwAnchoredObjectPosition ( _rDrawObj ), - mpVertPosOrientFrm( nullptr ), + mpVertPosOrientFrame( nullptr ), // #i26791# - maOffsetToFrmAnchorPos( Point() ), + maOffsetToFrameAnchorPos( Point() ), mbAnchorToChar ( false ), - mpToCharOrientFrm( nullptr ), + mpToCharOrientFrame( nullptr ), mpToCharRect( nullptr ), // #i22341# mnToCharTopOfLine( 0 ) @@ -65,9 +65,9 @@ bool SwToContentAnchoredObjectPosition::IsAnchoredToChar() const return mbAnchorToChar; } -const SwFrm* SwToContentAnchoredObjectPosition::ToCharOrientFrm() const +const SwFrame* SwToContentAnchoredObjectPosition::ToCharOrientFrame() const { - return mpToCharOrientFrm; + return mpToCharOrientFrame; } const SwRect* SwToContentAnchoredObjectPosition::ToCharRect() const @@ -81,21 +81,21 @@ SwTwips SwToContentAnchoredObjectPosition::ToCharTopOfLine() const return mnToCharTopOfLine; } -SwTextFrm& SwToContentAnchoredObjectPosition::GetAnchorTextFrm() const +SwTextFrame& SwToContentAnchoredObjectPosition::GetAnchorTextFrame() const { - OSL_ENSURE( dynamic_cast<const SwTextFrm*>( &GetAnchorFrm()) != nullptr , - "SwToContentAnchoredObjectPosition::GetAnchorTextFrm() - wrong anchor frame type" ); + OSL_ENSURE( dynamic_cast<const SwTextFrame*>( &GetAnchorFrame()) != nullptr , + "SwToContentAnchoredObjectPosition::GetAnchorTextFrame() - wrong anchor frame type" ); - return static_cast<SwTextFrm&>(GetAnchorFrm()); + return static_cast<SwTextFrame&>(GetAnchorFrame()); } // #i23512# static bool lcl_DoesVertPosFits( const SwTwips _nRelPosY, const SwTwips _nAvail, - const SwLayoutFrm* _pUpperOfOrientFrm, + const SwLayoutFrame* _pUpperOfOrientFrame, const bool _bBrowse, const bool _bGrowInTable, - SwLayoutFrm*& _orpLayoutFrmToGrow ) + SwLayoutFrame*& _orpLayoutFrameToGrow ) { bool bVertPosFits = false; @@ -105,30 +105,30 @@ static bool lcl_DoesVertPosFits( const SwTwips _nRelPosY, } else if ( _bBrowse ) { - if ( _pUpperOfOrientFrm->IsInSct() ) + if ( _pUpperOfOrientFrame->IsInSct() ) { - SwSectionFrm* pSctFrm = - const_cast<SwSectionFrm*>(_pUpperOfOrientFrm->FindSctFrm()); - bVertPosFits = pSctFrm->GetUpper()->Grow( _nRelPosY - _nAvail, true ) > 0; + SwSectionFrame* pSctFrame = + const_cast<SwSectionFrame*>(_pUpperOfOrientFrame->FindSctFrame()); + bVertPosFits = pSctFrame->GetUpper()->Grow( _nRelPosY - _nAvail, true ) > 0; // Note: do not provide a layout frame for a grow. } else { - bVertPosFits = const_cast<SwLayoutFrm*>(_pUpperOfOrientFrm)-> + bVertPosFits = const_cast<SwLayoutFrame*>(_pUpperOfOrientFrame)-> Grow( _nRelPosY - _nAvail, true ) > 0; if ( bVertPosFits ) - _orpLayoutFrmToGrow = const_cast<SwLayoutFrm*>(_pUpperOfOrientFrm); + _orpLayoutFrameToGrow = const_cast<SwLayoutFrame*>(_pUpperOfOrientFrame); } } - else if ( _pUpperOfOrientFrm->IsInTab() && _bGrowInTable ) + else if ( _pUpperOfOrientFrame->IsInTab() && _bGrowInTable ) { // #i45085# - check, if upper frame would grow the // excepted amount of twips. - const SwTwips nTwipsGrown = const_cast<SwLayoutFrm*>(_pUpperOfOrientFrm)-> + const SwTwips nTwipsGrown = const_cast<SwLayoutFrame*>(_pUpperOfOrientFrame)-> Grow( _nRelPosY - _nAvail, true ); bVertPosFits = ( nTwipsGrown == ( _nRelPosY - _nAvail ) ); if ( bVertPosFits ) - _orpLayoutFrmToGrow = const_cast<SwLayoutFrm*>(_pUpperOfOrientFrm); + _orpLayoutFrameToGrow = const_cast<SwLayoutFrame*>(_pUpperOfOrientFrame); } return bVertPosFits; @@ -141,16 +141,16 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // declare and set <pFooter> to footer frame, if object is anchored // at a frame belonging to the footer. - const SwFrm* pFooter = GetAnchorFrm().FindFooterOrHeader(); - if ( pFooter && !pFooter->IsFooterFrm() ) + const SwFrame* pFooter = GetAnchorFrame().FindFooterOrHeader(); + if ( pFooter && !pFooter->IsFooterFrame() ) pFooter = nullptr; // declare and set <bBrowse> to true, if document is in browser mode and // object is anchored at the body, but not at frame belonging to a table. - bool bBrowse = GetAnchorFrm().IsInDocBody() && !GetAnchorFrm().IsInTab(); + bool bBrowse = GetAnchorFrame().IsInDocBody() && !GetAnchorFrame().IsInTab(); if( bBrowse ) { - const SwViewShell *pSh = GetAnchorFrm().getRootFrm()->GetCurrShell(); + const SwViewShell *pSh = GetAnchorFrame().getRootFrame()->GetCurrShell(); if( !pSh || !pSh->GetViewOptions()->getBrowseMode() ) bBrowse = false; } @@ -169,12 +169,12 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // #i18732# - grow only, if object has to follow the text flow const bool bGrow = DoesObjFollowsTextFlow() && - ( !GetAnchorFrm().IsInTab() || - !rFrameFormat.GetFrmSize().GetHeightPercent() ); + ( !GetAnchorFrame().IsInTab() || + !rFrameFormat.GetFrameSize().GetHeightPercent() ); // get text frame the object is anchored at - const SwTextFrm& rAnchorTextFrm = GetAnchorTextFrm(); - SWRECTFN( (&rAnchorTextFrm) ) + const SwTextFrame& rAnchorTextFrame = GetAnchorTextFrame(); + SWRECTFN( (&rAnchorTextFrame) ) const SwRect aObjBoundRect( GetAnchoredObj().GetObjRect() ); @@ -185,11 +185,11 @@ void SwToContentAnchoredObjectPosition::CalcPosition() SwTwips nRelDiff = 0; - bool bMoveable = rAnchorTextFrm.IsMoveable(); + bool bMoveable = rAnchorTextFrame.IsMoveable(); // determine frame the object position has to be oriented at. - const SwTextFrm* pOrientFrm = &rAnchorTextFrm; - const SwTextFrm* pAnchorFrmForVertPos = &rAnchorTextFrm; + const SwTextFrame* pOrientFrame = &rAnchorTextFrame; + const SwTextFrame* pAnchorFrameForVertPos = &rAnchorTextFrame; { // if object is at-character anchored, determine character-rectangle // and frame, position has to be oriented at. @@ -211,10 +211,10 @@ void SwToContentAnchoredObjectPosition::CalcPosition() !GetAnchoredObj().GetLastCharRect().Width() ) || !GetAnchoredObj().GetLastTopOfLine() ) { - // Get default for <mpVertPosOrientFrm>, if it's not set. - if ( !mpVertPosOrientFrm ) + // Get default for <mpVertPosOrientFrame>, if it's not set. + if ( !mpVertPosOrientFrame ) { - mpVertPosOrientFrm = rAnchorTextFrm.GetUpper(); + mpVertPosOrientFrame = rAnchorTextFrame.GetUpper(); } return; } @@ -222,12 +222,12 @@ void SwToContentAnchoredObjectPosition::CalcPosition() mpToCharRect = &(GetAnchoredObj().GetLastCharRect()); // #i22341# - get top of line, in which the anchor character is. mnToCharTopOfLine = GetAnchoredObj().GetLastTopOfLine(); - pOrientFrm = &(const_cast<SwTextFrm&>(rAnchorTextFrm).GetFrmAtOfst( + pOrientFrame = &(const_cast<SwTextFrame&>(rAnchorTextFrame).GetFrameAtOfst( rAnch.GetContentAnchor()->nContent.GetIndex() ) ); - mpToCharOrientFrm = pOrientFrm; + mpToCharOrientFrame = pOrientFrame; } } - SWREFRESHFN( pOrientFrm ) + SWREFRESHFN( pOrientFrame ) // determine vertical position { @@ -237,8 +237,8 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // #i18732# - determine layout frame for vertical // positions aligned to 'page areas'. - const SwLayoutFrm& rPageAlignLayFrm = - aEnvOfObj.GetVertEnvironmentLayoutFrm( *pOrientFrm ); + const SwLayoutFrame& rPageAlignLayFrame = + aEnvOfObj.GetVertEnvironmentLayoutFrame( *pOrientFrame ); if ( aVert.GetVertOrient() != text::VertOrientation::NONE ) { @@ -246,7 +246,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // AND vertical alignment at 'page areas'. SwTwips nAlignAreaHeight; SwTwips nAlignAreaOffset; - _GetVertAlignmentValues( *pOrientFrm, rPageAlignLayFrm, + _GetVertAlignmentValues( *pOrientFrame, rPageAlignLayFrame, aVert.GetRelationOrient(), nAlignAreaHeight, nAlignAreaOffset ); @@ -376,26 +376,26 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // the frame, the object is oriented at. // #i28701# - correction: adjust relative position, // only if the floating screen object has to follow the text flow. - if ( DoesObjFollowsTextFlow() && pOrientFrm != &rAnchorTextFrm ) + if ( DoesObjFollowsTextFlow() && pOrientFrame != &rAnchorTextFrame ) { // #i11860# - use new method <_GetTopForObjPos> // to get top of frame for object positioning. - const SwTwips nTopOfOrient = _GetTopForObjPos( *pOrientFrm, fnRect, bVert ); + const SwTwips nTopOfOrient = _GetTopForObjPos( *pOrientFrame, fnRect, bVert ); nRelPosY += (*fnRect->fnYDiff)( nTopOfOrient, - _GetTopForObjPos( rAnchorTextFrm, fnRect, bVert ) ); + _GetTopForObjPos( rAnchorTextFrame, fnRect, bVert ) ); } // #i42124# - capture object inside vertical // layout environment. { const SwTwips nTopOfAnch = - _GetTopForObjPos( *pOrientFrm, fnRect, bVert ); - const SwLayoutFrm& rVertEnvironLayFrm = - aEnvOfObj.GetVertEnvironmentLayoutFrm( - *(pOrientFrm->GetUpper()) ); + _GetTopForObjPos( *pOrientFrame, fnRect, bVert ); + const SwLayoutFrame& rVertEnvironLayFrame = + aEnvOfObj.GetVertEnvironmentLayoutFrame( + *(pOrientFrame->GetUpper()) ); const bool bCheckBottom = !DoesObjFollowsTextFlow(); nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R, - rVertEnvironLayFrm, nRelPosY, + rVertEnvironLayFrame, nRelPosY, DoesObjFollowsTextFlow(), bCheckBottom ); } @@ -421,52 +421,52 @@ void SwToContentAnchoredObjectPosition::CalcPosition() if ( bVert ) { aRelPos.X() = nRelPosY; - maOffsetToFrmAnchorPos.X() = nAlignAreaOffset; + maOffsetToFrameAnchorPos.X() = nAlignAreaOffset; } else { aRelPos.Y() = nRelPosY; - maOffsetToFrmAnchorPos.Y() = nAlignAreaOffset; + maOffsetToFrameAnchorPos.Y() = nAlignAreaOffset; } } // Determine upper of frame vertical position is oriented at. // #i28701# - determine 'virtual' anchor frame. // This frame is used in the following instead of the 'real' anchor - // frame <rAnchorTextFrm> for the 'vertical' position in all cases. - const SwLayoutFrm* pUpperOfOrientFrm = nullptr; + // frame <rAnchorTextFrame> for the 'vertical' position in all cases. + const SwLayoutFrame* pUpperOfOrientFrame = nullptr; { // #i28701# - As long as the anchor frame is on the - // same page as <pOrientFrm> and the vertical position isn't aligned + // same page as <pOrientFrame> and the vertical position isn't aligned // automatic at the anchor character or the top of the line of the // anchor character, the anchor frame determines the vertical position. - if ( &rAnchorTextFrm == pOrientFrm || - ( rAnchorTextFrm.FindPageFrm() == pOrientFrm->FindPageFrm() && + if ( &rAnchorTextFrame == pOrientFrame || + ( rAnchorTextFrame.FindPageFrame() == pOrientFrame->FindPageFrame() && aVert.GetVertOrient() == text::VertOrientation::NONE && aVert.GetRelationOrient() != text::RelOrientation::CHAR && aVert.GetRelationOrient() != text::RelOrientation::TEXT_LINE ) ) { - pUpperOfOrientFrm = rAnchorTextFrm.GetUpper(); - pAnchorFrmForVertPos = &rAnchorTextFrm; + pUpperOfOrientFrame = rAnchorTextFrame.GetUpper(); + pAnchorFrameForVertPos = &rAnchorTextFrame; } else { - pUpperOfOrientFrm = pOrientFrm->GetUpper(); - pAnchorFrmForVertPos = pOrientFrm; + pUpperOfOrientFrame = pOrientFrame->GetUpper(); + pAnchorFrameForVertPos = pOrientFrame; } } // ignore one-column sections. // #i23512# - correction: also ignore one-columned // sections with footnotes/endnotes - if ( pUpperOfOrientFrm->IsInSct() ) + if ( pUpperOfOrientFrame->IsInSct() ) { - const SwSectionFrm* pSctFrm = pUpperOfOrientFrm->FindSctFrm(); - const bool bIgnoreSection = pUpperOfOrientFrm->IsSctFrm() || - ( pSctFrm->Lower()->IsColumnFrm() && - !pSctFrm->Lower()->GetNext() ); + const SwSectionFrame* pSctFrame = pUpperOfOrientFrame->FindSctFrame(); + const bool bIgnoreSection = pUpperOfOrientFrame->IsSctFrame() || + ( pSctFrame->Lower()->IsColumnFrame() && + !pSctFrame->Lower()->GetNext() ); if ( bIgnoreSection ) - pUpperOfOrientFrm = pSctFrm->GetUpper(); + pUpperOfOrientFrame = pSctFrame->GetUpper(); } if ( aVert.GetVertOrient() == text::VertOrientation::NONE ) @@ -474,10 +474,10 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // local variable <nRelPosY> for calculation of relative vertical // distance to anchor. SwTwips nRelPosY = 0; - // #i26791# - local variable <nVertOffsetToFrmAnchorPos> + // #i26791# - local variable <nVertOffsetToFrameAnchorPos> // for determination of the 'vertical' offset to the frame anchor // position - SwTwips nVertOffsetToFrmAnchorPos( 0L ); + SwTwips nVertOffsetToFrameAnchorPos( 0L ); // #i22341# - add special case for vertical alignment // at top of line. if ( mbAnchorToChar && @@ -486,68 +486,68 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { // #i11860# - use new method <_GetTopForObjPos> // to get top of frame for object positioning. - SwTwips nTopOfOrient = _GetTopForObjPos( *pOrientFrm, fnRect, bVert ); + SwTwips nTopOfOrient = _GetTopForObjPos( *pOrientFrame, fnRect, bVert ); if ( aVert.GetRelationOrient() == text::RelOrientation::CHAR ) { - nVertOffsetToFrmAnchorPos = (*fnRect->fnYDiff)( + nVertOffsetToFrameAnchorPos = (*fnRect->fnYDiff)( (ToCharRect()->*fnRect->fnGetBottom)(), nTopOfOrient ); } else { - nVertOffsetToFrmAnchorPos = (*fnRect->fnYDiff)( ToCharTopOfLine(), + nVertOffsetToFrameAnchorPos = (*fnRect->fnYDiff)( ToCharTopOfLine(), nTopOfOrient ); } - nRelPosY = nVertOffsetToFrmAnchorPos - aVert.GetPos(); + nRelPosY = nVertOffsetToFrameAnchorPos - aVert.GetPos(); } else { - // #i28701# - correction: use <pAnchorFrmForVertPos> - // instead of <pOrientFrm> and do not adjust relative position + // #i28701# - correction: use <pAnchorFrameForVertPos> + // instead of <pOrientFrame> and do not adjust relative position // to get correct vertical position. - nVertOffsetToFrmAnchorPos = 0L; + nVertOffsetToFrameAnchorPos = 0L; // #i11860# - use new method <_GetTopForObjPos> // to get top of frame for object positioning. const SwTwips nTopOfOrient = - _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert ); + _GetTopForObjPos( *pAnchorFrameForVertPos, fnRect, bVert ); // Increase <nRelPosY> by margin height, // if position is vertical aligned to "paragraph text area" if ( aVert.GetRelationOrient() == text::RelOrientation::PRINT_AREA ) { // #i11860# - consider upper space amount of previous frame - SwTwips nTopMargin = (pAnchorFrmForVertPos->*fnRect->fnGetTopMargin)(); - if ( pAnchorFrmForVertPos->IsTextFrm() ) + SwTwips nTopMargin = (pAnchorFrameForVertPos->*fnRect->fnGetTopMargin)(); + if ( pAnchorFrameForVertPos->IsTextFrame() ) { - nTopMargin -= static_cast<const SwTextFrm*>(pAnchorFrmForVertPos)-> - GetUpperSpaceAmountConsideredForPrevFrmAndPageGrid(); + nTopMargin -= static_cast<const SwTextFrame*>(pAnchorFrameForVertPos)-> + GetUpperSpaceAmountConsideredForPrevFrameAndPageGrid(); } - nVertOffsetToFrmAnchorPos += nTopMargin; + nVertOffsetToFrameAnchorPos += nTopMargin; } // #i18732# - adjust <nRelPosY> by difference // between 'page area' and 'anchor' frame, if position is // vertical aligned to 'page areas' else if ( aVert.GetRelationOrient() == text::RelOrientation::PAGE_FRAME ) { - nVertOffsetToFrmAnchorPos += (*fnRect->fnYDiff)( - (rPageAlignLayFrm.Frm().*fnRect->fnGetTop)(), + nVertOffsetToFrameAnchorPos += (*fnRect->fnYDiff)( + (rPageAlignLayFrame.Frame().*fnRect->fnGetTop)(), nTopOfOrient ); } else if ( aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA ) { - SwRect aPgPrtRect( rPageAlignLayFrm.Frm() ); - if ( rPageAlignLayFrm.IsPageFrm() ) + SwRect aPgPrtRect( rPageAlignLayFrame.Frame() ); + if ( rPageAlignLayFrame.IsPageFrame() ) { aPgPrtRect = - static_cast<const SwPageFrm&>(rPageAlignLayFrm).PrtWithoutHeaderAndFooter(); + static_cast<const SwPageFrame&>(rPageAlignLayFrame).PrtWithoutHeaderAndFooter(); } - nVertOffsetToFrmAnchorPos += (*fnRect->fnYDiff)( + nVertOffsetToFrameAnchorPos += (*fnRect->fnYDiff)( (aPgPrtRect.*fnRect->fnGetTop)(), nTopOfOrient ); } - nRelPosY = nVertOffsetToFrmAnchorPos + aVert.GetPos(); + nRelPosY = nVertOffsetToFrameAnchorPos + aVert.GetPos(); } - // <pUpperOfOrientFrm>: layout frame, at which the position has to + // <pUpperOfOrientFrame>: layout frame, at which the position has to // is oriented at // <nRelPosY>: rest of the relative distance in the current // layout frame @@ -557,24 +557,24 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // #i26791# - determine offset to 'vertical' // frame anchor position, depending on layout-direction if ( bVert ) - maOffsetToFrmAnchorPos.X() = nVertOffsetToFrmAnchorPos; + maOffsetToFrameAnchorPos.X() = nVertOffsetToFrameAnchorPos; else - maOffsetToFrmAnchorPos.Y() = nVertOffsetToFrmAnchorPos; + maOffsetToFrameAnchorPos.Y() = nVertOffsetToFrameAnchorPos; // #i11860# - use new method <_GetTopForObjPos> // to get top of frame for object positioning. - const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert ); + const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrameForVertPos, fnRect, bVert ); if( nRelPosY <= 0 ) { // Allow negative position, but keep it // inside environment layout frame. - const SwLayoutFrm& rVertEnvironLayFrm = - aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm ); + const SwLayoutFrame& rVertEnvironLayFrame = + aEnvOfObj.GetVertEnvironmentLayoutFrame( *pUpperOfOrientFrame ); // #i31805# - do not check, if bottom of // anchored object would fit into environment layout frame, if // anchored object has to follow the text flow. const bool bCheckBottom = !DoesObjFollowsTextFlow(); nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R, - rVertEnvironLayFrm, nRelPosY, + rVertEnvironLayFrame, nRelPosY, DoesObjFollowsTextFlow(), bCheckBottom ); if ( bVert ) @@ -584,37 +584,37 @@ void SwToContentAnchoredObjectPosition::CalcPosition() } else { - SWREFRESHFN( pAnchorFrmForVertPos ) + SWREFRESHFN( pAnchorFrameForVertPos ) SwTwips nAvail = - (*fnRect->fnYDiff)( (pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)(), + (*fnRect->fnYDiff)( (pUpperOfOrientFrame->*fnRect->fnGetPrtBottom)(), nTopOfAnch ); - const bool bInFootnote = pAnchorFrmForVertPos->IsInFootnote(); + const bool bInFootnote = pAnchorFrameForVertPos->IsInFootnote(); while ( nRelPosY ) { // #i23512# - correction: // consider section frame for grow in online layout. // use new local method <lcl_DoesVertPosFits(..)> - SwLayoutFrm* pLayoutFrmToGrow = nullptr; + SwLayoutFrame* pLayoutFrameToGrow = nullptr; const bool bDoesVertPosFits = lcl_DoesVertPosFits( - nRelPosY, nAvail, pUpperOfOrientFrm, bBrowse, - bGrow, pLayoutFrmToGrow ); + nRelPosY, nAvail, pUpperOfOrientFrame, bBrowse, + bGrow, pLayoutFrameToGrow ); if ( bDoesVertPosFits ) { SwTwips nTmpRelPosY = - (*fnRect->fnYDiff)( (pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)(), + (*fnRect->fnYDiff)( (pUpperOfOrientFrame->*fnRect->fnGetPrtBottom)(), nTopOfAnch ) - nAvail + nRelPosY; // #i28701# - adjust calculated // relative vertical position to object's environment. - const SwFrm& rVertEnvironLayFrm = - aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm ); + const SwFrame& rVertEnvironLayFrame = + aEnvOfObj.GetVertEnvironmentLayoutFrame( *pUpperOfOrientFrame ); // Do not check, if bottom of // anchored object would fit into environment layout // frame, if anchored object has to follow the text flow. const bool bCheckBottom = !DoesObjFollowsTextFlow(); nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R, - rVertEnvironLayFrm, + rVertEnvironLayFrame, nTmpRelPosY, DoesObjFollowsTextFlow(), bCheckBottom ); @@ -624,11 +624,11 @@ void SwToContentAnchoredObjectPosition::CalcPosition() aRelPos.Y() = nTmpRelPosY; // #i23512# - use local variable - // <pLayoutFrmToGrow> provided by new method + // <pLayoutFrameToGrow> provided by new method // <lcl_DoesVertPosFits(..)>. - if ( pLayoutFrmToGrow ) + if ( pLayoutFrameToGrow ) { - pLayoutFrmToGrow->Grow( nRelPosY - nAvail ); + pLayoutFrameToGrow->Grow( nRelPosY - nAvail ); } nRelPosY = 0; } @@ -640,7 +640,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() if ( DoesObjFollowsTextFlow() && !( aVert.GetRelationOrient() == text::RelOrientation::PAGE_FRAME || aVert.GetRelationOrient() == text::RelOrientation::PAGE_PRINT_AREA ) && - !GetAnchorFrm().IsInTab() ) + !GetAnchorFrame().IsInTab() ) { if ( bMoveable ) { @@ -648,20 +648,20 @@ void SwToContentAnchoredObjectPosition::CalcPosition() nRelPosY -= nAvail; MakePageType eMakePage = bInFootnote ? MAKEPAGE_NONE : MAKEPAGE_APPEND; - const bool bInSct = pUpperOfOrientFrm->IsInSct(); + const bool bInSct = pUpperOfOrientFrame->IsInSct(); if( bInSct ) eMakePage = MAKEPAGE_NOSECTION; - const SwLayoutFrm* pTmp = - pUpperOfOrientFrm->GetLeaf( eMakePage, true, &rAnchorTextFrm ); + const SwLayoutFrame* pTmp = + pUpperOfOrientFrame->GetLeaf( eMakePage, true, &rAnchorTextFrame ); if ( pTmp && ( !bInSct || - pUpperOfOrientFrm->FindSctFrm()->IsAnFollow( pTmp->FindSctFrm() ) ) ) + pUpperOfOrientFrame->FindSctFrame()->IsAnFollow( pTmp->FindSctFrame() ) ) ) { - pUpperOfOrientFrm = pTmp; - bMoveable = rAnchorTextFrm.IsMoveable( pUpperOfOrientFrm ); - SWREFRESHFN( pUpperOfOrientFrm ) - nAvail = (pUpperOfOrientFrm->Prt().*fnRect->fnGetHeight)(); + pUpperOfOrientFrame = pTmp; + bMoveable = rAnchorTextFrame.IsMoveable( pUpperOfOrientFrame ); + SWREFRESHFN( pUpperOfOrientFrame ) + nAvail = (pUpperOfOrientFrame->Prt().*fnRect->fnGetHeight)(); } else { @@ -672,10 +672,10 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // new pages can be created. if( bInSct ) { - const SwFrm* pSct = pUpperOfOrientFrm->FindSctFrm(); - pUpperOfOrientFrm = pSct->GetUpper(); + const SwFrame* pSct = pUpperOfOrientFrame->FindSctFrame(); + pUpperOfOrientFrame = pSct->GetUpper(); nAvail = (*fnRect->fnYDiff)( - (pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)(), + (pUpperOfOrientFrame->*fnRect->fnGetPrtBottom)(), (pSct->*fnRect->fnGetPrtBottom)() ); } else @@ -697,10 +697,10 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { // #i18732# - do not follow text flow respectively // align at 'page areas', but stay inside given environment - const SwFrm& rVertEnvironLayFrm = - aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm ); + const SwFrame& rVertEnvironLayFrame = + aEnvOfObj.GetVertEnvironmentLayoutFrame( *pUpperOfOrientFrame ); nRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R, - rVertEnvironLayFrm, + rVertEnvironLayFrame, nRelPosY, DoesObjFollowsTextFlow() ); if( bVert ) @@ -717,7 +717,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // We need to calculate the part's absolute position, in order for // it to be put onto the right page and to be pulled into the // LayLeaf's PrtArea - const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert ); + const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrameForVertPos, fnRect, bVert ); if( bVert ) { // --> OD 2009-08-31 #monglianlayout# @@ -743,49 +743,49 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // ignore one-column sections. // #i23512# - correction: also ignore one-columned // sections with footnotes/endnotes - if ( pUpperOfOrientFrm->IsInSct() ) + if ( pUpperOfOrientFrame->IsInSct() ) { - const SwSectionFrm* pSctFrm = pUpperOfOrientFrm->FindSctFrm(); - const bool bIgnoreSection = pUpperOfOrientFrm->IsSctFrm() || - ( pSctFrm->Lower()->IsColumnFrm() && - !pSctFrm->Lower()->GetNext() ); + const SwSectionFrame* pSctFrame = pUpperOfOrientFrame->FindSctFrame(); + const bool bIgnoreSection = pUpperOfOrientFrame->IsSctFrame() || + ( pSctFrame->Lower()->IsColumnFrame() && + !pSctFrame->Lower()->GetNext() ); if ( bIgnoreSection ) - pUpperOfOrientFrm = pSctFrm->GetUpper(); + pUpperOfOrientFrame = pSctFrame->GetUpper(); } SwTwips nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)( - (pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)() ); + (pUpperOfOrientFrame->*fnRect->fnGetPrtBottom)() ); if( nDist < 0 ) { // #i23512# - correction: // consider section frame for grow in online layout and // consider page alignment for grow in table. - SwLayoutFrm* pLayoutFrmToGrow = nullptr; - if ( bBrowse && rAnchorTextFrm.IsMoveable() ) + SwLayoutFrame* pLayoutFrameToGrow = nullptr; + if ( bBrowse && rAnchorTextFrame.IsMoveable() ) { - if ( pUpperOfOrientFrm->IsInSct() ) + if ( pUpperOfOrientFrame->IsInSct() ) { - pLayoutFrmToGrow = const_cast<SwLayoutFrm*>( - pUpperOfOrientFrm->FindSctFrm()->GetUpper()); + pLayoutFrameToGrow = const_cast<SwLayoutFrame*>( + pUpperOfOrientFrame->FindSctFrame()->GetUpper()); nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)( - (pLayoutFrmToGrow->*fnRect->fnGetPrtBottom)() ); + (pLayoutFrameToGrow->*fnRect->fnGetPrtBottom)() ); if ( nDist >= 0 ) { - pLayoutFrmToGrow = nullptr; + pLayoutFrameToGrow = nullptr; } } else { - pLayoutFrmToGrow = - const_cast<SwLayoutFrm*>(pUpperOfOrientFrm); + pLayoutFrameToGrow = + const_cast<SwLayoutFrame*>(pUpperOfOrientFrame); } } - else if ( rAnchorTextFrm.IsInTab() && bGrow ) + else if ( rAnchorTextFrame.IsInTab() && bGrow ) { - pLayoutFrmToGrow = const_cast<SwLayoutFrm*>(pUpperOfOrientFrm); + pLayoutFrameToGrow = const_cast<SwLayoutFrame*>(pUpperOfOrientFrame); } - if ( pLayoutFrmToGrow ) + if ( pLayoutFrameToGrow ) { - pLayoutFrmToGrow->Grow( -nDist ); + pLayoutFrameToGrow->Grow( -nDist ); } } @@ -795,21 +795,21 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)( - (pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)() ); + (pUpperOfOrientFrame->*fnRect->fnGetPrtBottom)() ); // #i26945# - floating screen objects, which are // anchored inside a table, doesn't follow the text flow. But, they // have to stay inside its layout environment. - if ( nDist < 0 && pOrientFrm->IsInTab() ) + if ( nDist < 0 && pOrientFrame->IsInTab() ) { // If the anchor frame is the first content of the table cell // and has no follow, the table frame is notified, // that the object doesn't fit into the table cell. // Adjustment of position isn't needed in this case. - if ( pOrientFrm == &rAnchorTextFrm && - !pOrientFrm->GetFollow() && - !pOrientFrm->GetIndPrev() ) + if ( pOrientFrame == &rAnchorTextFrame && + !pOrientFrame->GetFollow() && + !pOrientFrame->GetIndPrev() ) { - const_cast<SwTabFrm*>(pOrientFrm->FindTabFrm()) + const_cast<SwTabFrame*>(pOrientFrame->FindTabFrame()) ->SetDoesObjsFit( false ); } else @@ -819,10 +819,10 @@ void SwToContentAnchoredObjectPosition::CalcPosition() nTmpRelPosY = aRelPos.X() - nDist; else nTmpRelPosY = aRelPos.Y() + nDist; - const SwLayoutFrm& rVertEnvironLayFrm = - aEnvOfObj.GetVertEnvironmentLayoutFrm( *pUpperOfOrientFrm ); + const SwLayoutFrame& rVertEnvironLayFrame = + aEnvOfObj.GetVertEnvironmentLayoutFrame( *pUpperOfOrientFrame ); nTmpRelPosY = _AdjustVertRelPos( nTopOfAnch, bVert, bVertL2R, - rVertEnvironLayFrm, + rVertEnvironLayFrame, nTmpRelPosY, DoesObjFollowsTextFlow(), false ); @@ -850,11 +850,11 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // and the object still doesn't fit, the table frame is notified, // that the object doesn't fit into the table cell. nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)( - (pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)() ); + (pUpperOfOrientFrame->*fnRect->fnGetPrtBottom)() ); if ( nDist < 0 && - pOrientFrm == &rAnchorTextFrm && !pOrientFrm->GetIndPrev() ) + pOrientFrame == &rAnchorTextFrame && !pOrientFrame->GetIndPrev() ) { - const_cast<SwTabFrm*>(pOrientFrm->FindTabFrm()) + const_cast<SwTabFrame*>(pOrientFrame->FindTabFrame()) ->SetDoesObjsFit( false ); } } @@ -862,13 +862,13 @@ void SwToContentAnchoredObjectPosition::CalcPosition() else { // follow text flow - const bool bInFootnote = rAnchorTextFrm.IsInFootnote(); + const bool bInFootnote = rAnchorTextFrame.IsInFootnote(); while( bMoveable && nDist < 0 ) { - bool bInSct = pUpperOfOrientFrm->IsInSct(); + bool bInSct = pUpperOfOrientFrame->IsInSct(); if ( bInSct ) { - const SwLayoutFrm* pTmp = pUpperOfOrientFrm->FindSctFrm()->GetUpper(); + const SwLayoutFrame* pTmp = pUpperOfOrientFrame->FindSctFrame()->GetUpper(); nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)( (pTmp->*fnRect->fnGetPrtBottom)() ); // #i23129# - Try to flow into next @@ -883,19 +883,19 @@ void SwToContentAnchoredObjectPosition::CalcPosition() } if ( !bInSct && (GetAnchoredObj().GetObjRect().*fnRect->fnGetTop)() == - (pUpperOfOrientFrm->*fnRect->fnGetPrtTop)() ) + (pUpperOfOrientFrame->*fnRect->fnGetPrtTop)() ) // It doesn't fit, moving it would not help either anymore break; - const SwLayoutFrm* pNextLay = pUpperOfOrientFrm->GetLeaf( + const SwLayoutFrame* pNextLay = pUpperOfOrientFrame->GetLeaf( ( bInSct ? MAKEPAGE_NOSECTION : ( bInFootnote ? MAKEPAGE_NONE : MAKEPAGE_APPEND ) ), - true, &rAnchorTextFrm ); + true, &rAnchorTextFrame ); // correction: // If anchor is in footnote and proposed next layout environment // isn't a footnote frame, object can't follow the text flow - if ( bInFootnote && pNextLay && !pNextLay->IsFootnoteFrm() ) + if ( bInFootnote && pNextLay && !pNextLay->IsFootnoteFrame() ) { pNextLay = nullptr; } @@ -903,7 +903,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { SWRECTFNX( pNextLay ) if ( !bInSct || - ( pUpperOfOrientFrm->FindSctFrm()->IsAnFollow( pNextLay->FindSctFrm() ) && + ( pUpperOfOrientFrame->FindSctFrame()->IsAnFollow( pNextLay->FindSctFrame() ) && (pNextLay->Prt().*fnRectX->fnGetHeight)() ) ) { SwTwips nTmpRelPosY = @@ -913,9 +913,9 @@ void SwToContentAnchoredObjectPosition::CalcPosition() aRelPos.X() = nTmpRelPosY; else aRelPos.Y() = nTmpRelPosY; - pUpperOfOrientFrm = pNextLay; - SWREFRESHFN( pUpperOfOrientFrm ) - bMoveable = rAnchorTextFrm.IsMoveable( pUpperOfOrientFrm ); + pUpperOfOrientFrame = pNextLay; + SWREFRESHFN( pUpperOfOrientFrame ) + bMoveable = rAnchorTextFrame.IsMoveable( pUpperOfOrientFrame ); if( bVertX ) { // --> OD 2009-08-31 #mongolianlayout# @@ -935,16 +935,16 @@ void SwToContentAnchoredObjectPosition::CalcPosition() GetAnchoredObj().SetObjTop( nTopOfAnch + aRelPos.Y() ); nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)( - (pUpperOfOrientFrm->*fnRect->fnGetPrtBottom)() ); + (pUpperOfOrientFrame->*fnRect->fnGetPrtBottom)() ); } // #i23129# - leave section area else if ( bInSct ) { - const SwLayoutFrm* pTmp = pUpperOfOrientFrm->FindSctFrm()->GetUpper(); + const SwLayoutFrame* pTmp = pUpperOfOrientFrame->FindSctFrame()->GetUpper(); nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)( (pTmp->*fnRect->fnGetPrtBottom)() ); if( nDist < 0 ) - pUpperOfOrientFrm = pTmp; + pUpperOfOrientFrame = pTmp; else break; } @@ -953,11 +953,11 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { // If we don't have enough room within the Area, we take a look at // the Page - const SwLayoutFrm* pTmp = pUpperOfOrientFrm->FindSctFrm()->GetUpper(); + const SwLayoutFrame* pTmp = pUpperOfOrientFrame->FindSctFrame()->GetUpper(); nDist = (GetAnchoredObj().GetObjRect().*fnRect->fnBottomDist)( (pTmp->*fnRect->fnGetPrtBottom)() ); if( nDist < 0 ) - pUpperOfOrientFrm = pTmp; + pUpperOfOrientFrame = pTmp; else break; } @@ -968,7 +968,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() } // keep layout frame vertical position is oriented at. - mpVertPosOrientFrm = pUpperOfOrientFrm; + mpVertPosOrientFrame = pUpperOfOrientFrame; } @@ -979,7 +979,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // set calculated vertical position in order to determine correct // frame, the horizontal position is oriented at. - const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert ); + const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrameForVertPos, fnRect, bVert ); if( bVert ) { // --> OD 2009-08-31 #mongolianlayout# @@ -998,35 +998,35 @@ void SwToContentAnchoredObjectPosition::CalcPosition() // determine frame, horizontal position is oriented at. // #i28701# - If floating screen object doesn't follow - // the text flow, its horizontal position is oriented at <pOrientFrm>. - const SwFrm* pHoriOrientFrm = DoesObjFollowsTextFlow() - ? &_GetHoriVirtualAnchor( *mpVertPosOrientFrm ) - : pOrientFrm; + // the text flow, its horizontal position is oriented at <pOrientFrame>. + const SwFrame* pHoriOrientFrame = DoesObjFollowsTextFlow() + ? &_GetHoriVirtualAnchor( *mpVertPosOrientFrame ) + : pOrientFrame; // #i26791# - get 'horizontal' offset to frame anchor position. - SwTwips nHoriOffsetToFrmAnchorPos( 0L ); - SwTwips nRelPosX = _CalcRelPosX( *pHoriOrientFrm, aEnvOfObj, + SwTwips nHoriOffsetToFrameAnchorPos( 0L ); + SwTwips nRelPosX = _CalcRelPosX( *pHoriOrientFrame, aEnvOfObj, aHori, rLR, rUL, bWrapThrough, ( bVert ? aRelPos.X() : aRelPos.Y() ), - nHoriOffsetToFrmAnchorPos ); + nHoriOffsetToFrameAnchorPos ); // #i26791# - determine offset to 'horizontal' frame // anchor position, depending on layout-direction if ( bVert ) { aRelPos.Y() = nRelPosX; - maOffsetToFrmAnchorPos.Y() = nHoriOffsetToFrmAnchorPos; + maOffsetToFrameAnchorPos.Y() = nHoriOffsetToFrameAnchorPos; } else { aRelPos.X() = nRelPosX; - maOffsetToFrmAnchorPos.X() = nHoriOffsetToFrmAnchorPos; + maOffsetToFrameAnchorPos.X() = nHoriOffsetToFrameAnchorPos; } // save calculated horizontal position - needed for filters // (including the xml-filter) { - SwTwips nAttrRelPosX = nRelPosX - nHoriOffsetToFrmAnchorPos; + SwTwips nAttrRelPosX = nRelPosX - nHoriOffsetToFrameAnchorPos; if ( aHori.GetHoriOrient() != text::HoriOrientation::NONE && aHori.GetPos() != nAttrRelPosX ) { @@ -1039,7 +1039,7 @@ void SwToContentAnchoredObjectPosition::CalcPosition() } // set absolute position at object - const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrmForVertPos, fnRect, bVert ); + const SwTwips nTopOfAnch = _GetTopForObjPos( *pAnchorFrameForVertPos, fnRect, bVert ); if( bVert ) { // --> OD 2009-08-31 #mongolianlayout# @@ -1052,12 +1052,12 @@ void SwToContentAnchoredObjectPosition::CalcPosition() { GetAnchoredObj().SetObjLeft( nTopOfAnch + aRelPos.X() ); } - GetAnchoredObj().SetObjTop( rAnchorTextFrm.Frm().Top() + + GetAnchoredObj().SetObjTop( rAnchorTextFrame.Frame().Top() + aRelPos.Y() ); } else { - GetAnchoredObj().SetObjLeft( rAnchorTextFrm.Frm().Left() + + GetAnchoredObj().SetObjLeft( rAnchorTextFrame.Frame().Left() + aRelPos.X() ); GetAnchoredObj().SetObjTop( nTopOfAnch + aRelPos.Y() ); } @@ -1069,27 +1069,27 @@ void SwToContentAnchoredObjectPosition::CalcPosition() /** * Determine frame for horizontal position */ -const SwFrm& SwToContentAnchoredObjectPosition::_GetHoriVirtualAnchor( - const SwLayoutFrm& _rProposedFrm ) const +const SwFrame& SwToContentAnchoredObjectPosition::_GetHoriVirtualAnchor( + const SwLayoutFrame& _rProposedFrame ) const { - const SwFrm* pHoriVirtAnchFrm = &_rProposedFrm; + const SwFrame* pHoriVirtAnchFrame = &_rProposedFrame; // Search for first lower content frame, which is the anchor or a follow // of the anchor (Note: <Anchor.IsAnFollow( Anchor )> is true) - // If none found, <_rProposedFrm> is returned. - const SwFrm* pFrm = _rProposedFrm.Lower(); - while ( pFrm ) + // If none found, <_rProposedFrame> is returned. + const SwFrame* pFrame = _rProposedFrame.Lower(); + while ( pFrame ) { - if ( pFrm->IsContentFrm() && - GetAnchorTextFrm().IsAnFollow( static_cast<const SwContentFrm*>(pFrm) ) ) + if ( pFrame->IsContentFrame() && + GetAnchorTextFrame().IsAnFollow( static_cast<const SwContentFrame*>(pFrame) ) ) { - pHoriVirtAnchFrm = pFrm; + pHoriVirtAnchFrame = pFrame; break; } - pFrm = pFrm->GetNext(); + pFrame = pFrame->GetNext(); } - return *pHoriVirtAnchFrm; + return *pHoriVirtAnchFrame; } diff --git a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx index 923346a299a4..45d8f09762d6 100644 --- a/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx +++ b/sw/source/core/objectpositioning/tolayoutanchoredobjectposition.cxx @@ -41,7 +41,7 @@ SwToLayoutAnchoredObjectPosition::SwToLayoutAnchoredObjectPosition( SdrObject& _ : SwAnchoredObjectPosition( _rDrawObj ), maRelPos( Point() ), // #i26791# - maOffsetToFrmAnchorPos( Point() ) + maOffsetToFrameAnchorPos( Point() ) {} SwToLayoutAnchoredObjectPosition::~SwToLayoutAnchoredObjectPosition() @@ -52,7 +52,7 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() { const SwRect aObjBoundRect( GetAnchoredObj().GetObjRect() ); - SWRECTFN( (&GetAnchorFrm()) ); + SWRECTFN( (&GetAnchorFrame()) ); const SwFrameFormat& rFrameFormat = GetFrameFormat(); const SvxLRSpaceItem &rLR = rFrameFormat.GetLRSpace(); @@ -75,21 +75,21 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() ( eVertOrient == text::VertOrientation::CENTER || eVertOrient == text::VertOrientation::BOTTOM ) && SURROUND_THROUGHT != rFrameFormat.GetSurround().GetSurround() && - !GetAnchorFrm().HasFixSize() ) ) + !GetAnchorFrame().HasFixSize() ) ) { eVertOrient = text::VertOrientation::TOP; } // #i26791# - get vertical offset to frame anchor position. - SwTwips nVertOffsetToFrmAnchorPos( 0L ); + SwTwips nVertOffsetToFrameAnchorPos( 0L ); SwTwips nRelPosY = - _GetVertRelPos( GetAnchorFrm(), GetAnchorFrm(), eVertOrient, + _GetVertRelPos( GetAnchorFrame(), GetAnchorFrame(), eVertOrient, aVert.GetRelationOrient(), aVert.GetPos(), - rLR, rUL, nVertOffsetToFrmAnchorPos ); + rLR, rUL, nVertOffsetToFrameAnchorPos ); // keep the calculated relative vertical position - needed for filters // (including the xml-filter) { - SwTwips nAttrRelPosY = nRelPosY - nVertOffsetToFrmAnchorPos; + SwTwips nAttrRelPosY = nRelPosY - nVertOffsetToFrameAnchorPos; if ( aVert.GetVertOrient() != text::VertOrientation::NONE && aVert.GetPos() != nAttrRelPosY ) { @@ -111,26 +111,26 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() aRelPos.X() = nRelPosY; else aRelPos.X() = -nRelPosY - aObjBoundRect.Width(); - maOffsetToFrmAnchorPos.X() = nVertOffsetToFrmAnchorPos; + maOffsetToFrameAnchorPos.X() = nVertOffsetToFrameAnchorPos; } else { aRelPos.Y() = nRelPosY; - maOffsetToFrmAnchorPos.Y() = nVertOffsetToFrmAnchorPos; + maOffsetToFrameAnchorPos.Y() = nVertOffsetToFrameAnchorPos; } // if in online-layout the bottom of to-page anchored object is beyond // the page bottom, the page frame has to grow by growing its body frame. - const SwViewShell *pSh = GetAnchorFrm().getRootFrm()->GetCurrShell(); - if ( !bFlyAtFly && GetAnchorFrm().IsPageFrm() && + const SwViewShell *pSh = GetAnchorFrame().getRootFrame()->GetCurrShell(); + if ( !bFlyAtFly && GetAnchorFrame().IsPageFrame() && pSh && pSh->GetViewOptions()->getBrowseMode() ) { - const long nAnchorBottom = GetAnchorFrm().Frm().Bottom(); - const long nBottom = GetAnchorFrm().Frm().Top() + + const long nAnchorBottom = GetAnchorFrame().Frame().Bottom(); + const long nBottom = GetAnchorFrame().Frame().Top() + aRelPos.Y() + aObjBoundRect.Height(); if ( nAnchorBottom < nBottom ) { - static_cast<SwPageFrm&>(GetAnchorFrm()). + static_cast<SwPageFrame&>(GetAnchorFrame()). FindBodyCont()->Grow( nBottom - nAnchorBottom ); } } @@ -141,7 +141,7 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() { // consider toggle of horizontal position for even pages. const bool bToggle = aHori.IsPosToggle() && - !GetAnchorFrm().FindPageFrm()->OnRightPage(); + !GetAnchorFrame().FindPageFrame()->OnRightPage(); sal_Int16 eHoriOrient = aHori.GetHoriOrient(); sal_Int16 eRelOrient = aHori.GetRelationOrient(); // toggle orientation @@ -154,7 +154,7 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() SwTwips nWidth, nOffset; { bool bDummy; // in this context irrelevant output parameter - _GetHoriAlignmentValues( GetAnchorFrm(), GetAnchorFrm(), + _GetHoriAlignmentValues( GetAnchorFrame(), GetAnchorFrame(), eRelOrient, false, nWidth, nOffset, bDummy ); } @@ -166,7 +166,7 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() if ( text::HoriOrientation::NONE == eHoriOrient ) { if( bToggle || - ( !aHori.IsPosToggle() && GetAnchorFrm().IsRightToLeft() ) ) + ( !aHori.IsPosToggle() && GetAnchorFrame().IsRightToLeft() ) ) { nRelPosX = nWidth - nObjWidth - aHori.GetPos(); } @@ -199,12 +199,12 @@ void SwToLayoutAnchoredObjectPosition::CalcPosition() { aRelPos.Y() = nRelPosX; - maOffsetToFrmAnchorPos.Y() = nOffset; + maOffsetToFrameAnchorPos.Y() = nOffset; } else { aRelPos.X() = nRelPosX; - maOffsetToFrmAnchorPos.X() = nOffset; + maOffsetToFrameAnchorPos.X() = nOffset; } // keep the calculated relative horizontal position - needed for filters |