sw/source/core/doc/docedt.cxx | 36 +++++++++++++++--------------- sw/source/core/undo/undobj.cxx | 49 ++++++++++++++++++++--------------------- 2 files changed, 42 insertions(+), 43 deletions(-)
New commits: commit 3a4df3014944888bd4ed1b50c556395b43ea4377 Author: Michael Stahl <michael.st...@cib.de> AuthorDate: Fri Dec 6 13:33:24 2019 +0100 Commit: Caolán McNamara <caol...@redhat.com> CommitDate: Fri Jun 12 21:30:49 2020 +0200 sw: reindent that Change-Id: Iea5784d98d2780166c88912f898f3da95d45e2ab Reviewed-on: https://gerrit.libreoffice.org/84623 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.st...@cib.de> (cherry picked from commit 933dc9f99d6f8d608f67514d1236b5b2904f2b0a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/96203 Reviewed-by: Caolán McNamara <caol...@redhat.com> 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; _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits