Kaydet (Commit) 0e6675e2 authored tarafından Michael Stahl's avatar Michael Stahl

sw_redlinehide: convert SwTextFrame::SplitFrame to MergedAttrIter

Change-Id: I98475e1136eedfcd7d4b19d1c8b7e83f350b5c4b
üst b2484800
...@@ -720,30 +720,28 @@ void SwTextFrame::SplitFrame(TextFrameIndex const nTextPos) ...@@ -720,30 +720,28 @@ void SwTextFrame::SplitFrame(TextFrameIndex const nTextPos)
// to re-register them // to re-register them
if ( HasFootnote() ) if ( HasFootnote() )
{ {
const SwpHints *pHints = GetTextNode()->GetpSwpHints(); SwFootnoteBossFrame *pFootnoteBoss = nullptr;
if( pHints ) SwFootnoteBossFrame *pEndBoss = nullptr;
SwTextNode const* pNode(nullptr);
sw::MergedAttrIter iter(*this);
for (SwTextAttr const* pHt = iter.NextAttr(&pNode); pHt; pHt = iter.NextAttr(&pNode))
{ {
SwFootnoteBossFrame *pFootnoteBoss = nullptr; if (RES_TXTATR_FTN == pHt->Which()
SwFootnoteBossFrame *pEndBoss = nullptr; && nTextPos <= MapModelToView(pNode, pHt->GetStart()))
for ( size_t i = 0; i < pHints->Count(); ++i )
{ {
const SwTextAttr *pHt = pHints->Get(i); if (pHt->GetFootnote().IsEndNote())
if( RES_TXTATR_FTN==pHt->Which() && pHt->GetStart()>=nTextPos )
{ {
if( pHt->GetFootnote().IsEndNote() ) if (!pEndBoss)
{ pEndBoss = FindFootnoteBossFrame();
if( !pEndBoss ) SwFootnoteBossFrame::ChangeFootnoteRef( this, static_cast<const SwTextFootnote*>(pHt), pNew );
pEndBoss = FindFootnoteBossFrame(); }
SwFootnoteBossFrame::ChangeFootnoteRef( this, static_cast<const SwTextFootnote*>(pHt), pNew ); else
} {
else if (!pFootnoteBoss)
{ pFootnoteBoss = FindFootnoteBossFrame( true );
if( !pFootnoteBoss ) SwFootnoteBossFrame::ChangeFootnoteRef( this, static_cast<const SwTextFootnote*>(pHt), pNew );
pFootnoteBoss = FindFootnoteBossFrame( true );
SwFootnoteBossFrame::ChangeFootnoteRef( this, static_cast<const SwTextFootnote*>(pHt), pNew );
}
pNew->SetFootnote( true );
} }
pNew->SetFootnote( true );
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment