diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-12-06 13:33:24 +0100 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2019-12-06 15:42:44 +0100 |
commit | 933dc9f99d6f8d608f67514d1236b5b2904f2b0a (patch) | |
tree | f8c9fcd047162a6221a1b7cf9b77cff784e628b2 /sw | |
parent | 4c2254cbebca53c34fa48a1dd90cebe434f24274 (diff) |
sw: reindent that
Change-Id: Iea5784d98d2780166c88912f898f3da95d45e2ab
Reviewed-on: https://gerrit.libreoffice.org/84623
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docedt.cxx | 36 | ||||
-rw-r--r-- | sw/source/core/undo/undobj.cxx | 49 |
2 files changed, 42 insertions, 43 deletions
diff --git a/sw/source/core/doc/docedt.cxx b/sw/source/core/doc/docedt.cxx index 7edd87e12850..d881ca1d3d40 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -228,26 +228,26 @@ void DelFlyInRange( const SwNodeIndex& rMkNdIdx, ? DelContentType::AllMask : DelContentType::AllMask|DelContentType::CheckNoCntnt)))) { - // If the Fly is deleted, all Flys in its content have to be deleted too. - const SwFormatContent &rContent = pFormat->GetContent(); - // But only fly formats own their content, not draw formats. - if (rContent.GetContentIdx() && pFormat->Which() == RES_FLYFRMFMT) - { - DelFlyInRange( *rContent.GetContentIdx(), - SwNodeIndex( *rContent.GetContentIdx()-> - GetNode().EndOfSectionNode() )); - // Position could have been moved! - if( i > rTable.size() ) - i = rTable.size(); - else if( pFormat != rTable[i] ) - i = std::distance(rTable.begin(), rTable.find( pFormat )); - } + // If the Fly is deleted, all Flys in its content have to be deleted too. + const SwFormatContent &rContent = pFormat->GetContent(); + // But only fly formats own their content, not draw formats. + if (rContent.GetContentIdx() && pFormat->Which() == RES_FLYFRMFMT) + { + DelFlyInRange( *rContent.GetContentIdx(), + SwNodeIndex( *rContent.GetContentIdx()-> + GetNode().EndOfSectionNode() )); + // Position could have been moved! + if (i > rTable.size()) + i = rTable.size(); + else if (pFormat != rTable[i]) + i = std::distance(rTable.begin(), rTable.find( pFormat )); + } - pDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFormat ); + pDoc->getIDocumentLayoutAccess().DelLayoutFormat( pFormat ); - // DelLayoutFormat can also trigger the deletion of objects. - if( i > rTable.size() ) - i = rTable.size(); + // DelLayoutFormat can also trigger the deletion of objects. + if (i > rTable.size()) + i = rTable.size(); } } } diff --git a/sw/source/core/undo/undobj.cxx b/sw/source/core/undo/undobj.cxx index 21db9be5c8e3..22794f5316d5 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -967,32 +967,31 @@ void SwUndoSaveContent::DelContentIndex( const SwPosition& rMark, if (pAPos && pStt->nNode <= pAPos->nNode && pAPos->nNode <= pEnd->nNode) { - if( !m_pHistory ) - m_pHistory.reset( new SwHistory ); + if (!m_pHistory) + m_pHistory.reset( new SwHistory ); - if (IsSelectFrameAnchoredAtPara(*pAPos, *pStt, *pEnd, nDelContentType)) - { - m_pHistory->AddDeleteFly(*pFormat, nChainInsPos); - // reset n so that no Format is skipped - n = n >= rSpzArr.size() - ? rSpzArr.size() : n+1; - } - // Moving the anchor? - else if (!((DelContentType::CheckNoCntnt|DelContentType::ExcludeFlyAtStartEnd) - & nDelContentType) && - // at least for calls from SwUndoDelete, - // this should work - other Undos don't - // remember the order of the cursor - (rPoint.nNode.GetIndex() == pAPos->nNode.GetIndex()) - // Do not try to move the anchor to a table! - && rMark.nNode.GetNode().IsTextNode()) - { - m_pHistory->AddChangeFlyAnchor(*pFormat); - SwFormatAnchor aAnch( *pAnchor ); - SwPosition aPos( rMark.nNode ); - aAnch.SetAnchor( &aPos ); - pFormat->SetFormatAttr( aAnch ); - } + if (IsSelectFrameAnchoredAtPara(*pAPos, *pStt, *pEnd, nDelContentType)) + { + m_pHistory->AddDeleteFly(*pFormat, nChainInsPos); + // reset n so that no Format is skipped + n = n >= rSpzArr.size() ? rSpzArr.size() : n+1; + } + // Moving the anchor? + else if (!((DelContentType::CheckNoCntnt|DelContentType::ExcludeFlyAtStartEnd) + & nDelContentType) && + // at least for calls from SwUndoDelete, + // this should work - other Undos don't + // remember the order of the cursor + (rPoint.nNode.GetIndex() == pAPos->nNode.GetIndex()) + // Do not try to move the anchor to a table! + && rMark.nNode.GetNode().IsTextNode()) + { + m_pHistory->AddChangeFlyAnchor(*pFormat); + SwFormatAnchor aAnch( *pAnchor ); + SwPosition aPos( rMark.nNode ); + aAnch.SetAnchor( &aPos ); + pFormat->SetFormatAttr( aAnch ); + } } } break; |