diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2019-12-06 13:33:24 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2020-06-12 21:30:49 +0200 |
commit | 3a4df3014944888bd4ed1b50c556395b43ea4377 (patch) | |
tree | 2b22eea3b25246c931cdcf5a7cf18ca9e9127dbb /sw/source/core | |
parent | f63a28dc13e234e7509fdb8986e45db14a2d32ec (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>
(cherry picked from commit 933dc9f99d6f8d608f67514d1236b5b2904f2b0a)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96203
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/core')
-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 a695cca98713..1b93a7a56a78 100644 --- a/sw/source/core/doc/docedt.cxx +++ b/sw/source/core/doc/docedt.cxx @@ -229,26 +229,26 @@ void DelFlyInRange( const SwNodeIndex& rMkNdIdx, ? DelContentType::AllMask|DelContentType::WriterfilterHack : DelContentType::AllMask|DelContentType::WriterfilterHack|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 ae19a4d4c95a..de81e9e338d5 100644 --- a/sw/source/core/undo/undobj.cxx +++ b/sw/source/core/undo/undobj.cxx @@ -964,32 +964,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; |