diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2018-05-09 18:38:03 +0200 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2018-06-14 16:18:49 +0200 |
commit | 597892137fb7062215c37847890911685b502e9f (patch) | |
tree | fa1ff3e292b2892ef1b96f9ccf68c277e581386c /sw | |
parent | 4523bf18981cafd73c3bbdf859c17ffa8fa39835 (diff) |
sw_redlinehide: trivial conversions in layout/
Change-Id: I5ce4590af52b3bfc08f89915999e86f4973fa9e3
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/layout/anchoreddrawobject.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/layout/anchoredobject.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/layout/calcmove.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/layout/fly.cxx | 12 | ||||
-rw-r--r-- | sw/source/core/layout/objectformattertxtfrm.cxx | 4 | ||||
-rw-r--r-- | sw/source/core/layout/tabfrm.cxx | 2 |
6 files changed, 16 insertions, 14 deletions
diff --git a/sw/source/core/layout/anchoreddrawobject.cxx b/sw/source/core/layout/anchoreddrawobject.cxx index aaf96027e7aa..0a4292638342 100644 --- a/sw/source/core/layout/anchoreddrawobject.cxx +++ b/sw/source/core/layout/anchoreddrawobject.cxx @@ -572,7 +572,7 @@ void SwAnchoredDrawObject::InvalidateObjPos() (GetFrameFormat().GetAnchor().GetAnchorId() == RndStdIds::FLY_AS_CHAR) ) { SwTextFrame* pAnchorTextFrame( static_cast<SwTextFrame*>(AnchorFrame()) ); - if (pAnchorTextFrame->CalcFlyPos(&GetFrameFormat()) != COMPLETE_STRING) + if (pAnchorTextFrame->CalcFlyPos(&GetFrameFormat()) != TextFrameIndex(COMPLETE_STRING)) { AnchorFrame()->Prepare( PREP_FLY_ATTR_CHG, &GetFrameFormat() ); } diff --git a/sw/source/core/layout/anchoredobject.cxx b/sw/source/core/layout/anchoredobject.cxx index 0145389eab9e..5958f29085bc 100644 --- a/sw/source/core/layout/anchoredobject.cxx +++ b/sw/source/core/layout/anchoredobject.cxx @@ -545,7 +545,7 @@ bool SwAnchoredObject::HasClearedEnvironment() const const SwTextFrame* pTmpTextFrame = static_cast<const SwTextFrame*>(pTmpFrame); if ( pTmpTextFrame->IsUndersized() || ( pTmpTextFrame->GetFollow() && - pTmpTextFrame->GetFollow()->GetOfst() == 0 ) ) + pTmpTextFrame->GetFollow()->GetOfst() == TextFrameIndex(0))) { bHasClearedEnvironment = true; } @@ -716,8 +716,9 @@ SwTextFrame* SwAnchoredObject::FindAnchorCharFrame() if ((rAnch.GetAnchorId() == RndStdIds::FLY_AT_CHAR) || (rAnch.GetAnchorId() == RndStdIds::FLY_AS_CHAR)) { - pAnchorCharFrame = &(static_cast<SwTextFrame*>(AnchorFrame())-> - GetFrameAtOfst( rAnch.GetContentAnchor()->nContent.GetIndex() )); + SwTextFrame *const pFrame(static_cast<SwTextFrame*>(AnchorFrame())); + TextFrameIndex const nOffset(pFrame->MapModelToViewPos(*rAnch.GetContentAnchor())); + pAnchorCharFrame = &pFrame->GetFrameAtOfst(nOffset); } } diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx index 41f4e2a72f82..5a3e5b73b837 100644 --- a/sw/source/core/layout/calcmove.cxx +++ b/sw/source/core/layout/calcmove.cxx @@ -1403,7 +1403,8 @@ void SwContentFrame::MakeAll(vcl::RenderContext* /*pRenderContext*/) const SwTwips nHDiff = nOldH - aRectFnSet.GetHeight(getFrameArea()); const bool bNoPrepAdjustFrame = nHDiff > 0 && IsInTab() && GetFollow() && - ( 1 == static_cast<SwTextFrame*>(GetFollow())->GetLineCount( COMPLETE_STRING ) || aRectFnSet.GetWidth(static_cast<SwTextFrame*>(GetFollow())->getFrameArea()) < 0 ) && + (1 == static_cast<SwTextFrame*>(GetFollow())->GetLineCount(TextFrameIndex(COMPLETE_STRING)) + || aRectFnSet.GetWidth(static_cast<SwTextFrame*>(GetFollow())->getFrameArea()) < 0) && GetFollow()->CalcAddLowerSpaceAsLastInTableCell() == nHDiff; if ( !bNoPrepAdjustFrame ) { diff --git a/sw/source/core/layout/fly.cxx b/sw/source/core/layout/fly.cxx index 1c5ebadcdca1..8fdbcf9c0efc 100644 --- a/sw/source/core/layout/fly.cxx +++ b/sw/source/core/layout/fly.cxx @@ -1088,10 +1088,10 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos ) if( LONG_MAX != nNewY ) { aVert.SetVertOrient( text::VertOrientation::NONE ); - sal_Int32 nOfs = - pFormat->GetAnchor().GetContentAnchor()->nContent.GetIndex(); - OSL_ENSURE( GetAnchorFrame()->IsTextFrame(), "TextFrame expected" ); + assert(GetAnchorFrame()->IsTextFrame()); pAutoFrame = static_cast<const SwTextFrame*>(GetAnchorFrame()); + TextFrameIndex const nOfs(pAutoFrame->MapModelToViewPos( + *pFormat->GetAnchor().GetContentAnchor())); while( pAutoFrame->GetFollow() && pAutoFrame->GetFollow()->GetOfst() <= nOfs ) { @@ -1144,10 +1144,10 @@ void SwFlyFrame::ChgRelPos( const Point &rNewPos ) { if( !pAutoFrame ) { - sal_Int32 nOfs = pFormat->GetAnchor().GetContentAnchor() - ->nContent.GetIndex(); - OSL_ENSURE( GetAnchorFrame()->IsTextFrame(), "TextFrame expected"); + assert(GetAnchorFrame()->IsTextFrame()); pAutoFrame = static_cast<const SwTextFrame*>(GetAnchorFrame()); + TextFrameIndex const nOfs(pAutoFrame->MapModelToViewPos( + *pFormat->GetAnchor().GetContentAnchor())); while( pAutoFrame->GetFollow() && pAutoFrame->GetFollow()->GetOfst() <= nOfs ) pAutoFrame = pAutoFrame->GetFollow(); diff --git a/sw/source/core/layout/objectformattertxtfrm.cxx b/sw/source/core/layout/objectformattertxtfrm.cxx index 954b77913b67..1af4476d4946 100644 --- a/sw/source/core/layout/objectformattertxtfrm.cxx +++ b/sw/source/core/layout/objectformattertxtfrm.cxx @@ -272,7 +272,7 @@ bool SwObjectFormatterTextFrame::DoFormatObj( SwAnchoredObject& _rAnchoredObj, // objects under the condition, that its follow contains all its text. else if ( !mrAnchorTextFrame.IsFollow() && mrAnchorTextFrame.GetFollow() && - mrAnchorTextFrame.GetFollow()->GetOfst() == 0 ) + mrAnchorTextFrame.GetFollow()->GetOfst() == TextFrameIndex(0)) { SwLayouter::RemoveMovedFwdFrame( *(mrAnchorTextFrame.FindPageFrame()->GetFormat()->GetDoc()), @@ -440,7 +440,7 @@ bool SwObjectFormatterTextFrame::DoFormatObjs() // objects under the condition, that its follow contains all its text. else if ( !mrAnchorTextFrame.IsFollow() && mrAnchorTextFrame.GetFollow() && - mrAnchorTextFrame.GetFollow()->GetOfst() == 0 ) + mrAnchorTextFrame.GetFollow()->GetOfst() == TextFrameIndex(0)) { SwLayouter::RemoveMovedFwdFrame( *(mrAnchorTextFrame.FindPageFrame()->GetFormat()->GetDoc()), diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx index 96612798d990..90cc289b2b21 100644 --- a/sw/source/core/layout/tabfrm.cxx +++ b/sw/source/core/layout/tabfrm.cxx @@ -5461,7 +5461,7 @@ static SwTwips lcl_CalcHeightOfFirstContentLine( const SwRowFrame& rSourceLine ) // would have no follow and thus would add this space. if ( pTmp->IsTextFrame() && const_cast<SwTextFrame*>(static_cast<const SwTextFrame*>(pTmp)) - ->GetLineCount( COMPLETE_STRING ) == 1 ) + ->GetLineCount(TextFrameIndex(COMPLETE_STRING)) == 1) { nTmpHeight += SwFlowFrame::CastFlowFrame(pTmp) ->CalcAddLowerSpaceAsLastInTableCell(); |