[Libreoffice-commits] core.git: sw/source
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Thu Nov 15 14:46:34 UTC 2018
sw/source/core/doc/list.cxx | 49 +++++++++++++++-----------------------------
1 file changed, 17 insertions(+), 32 deletions(-)
New commits:
commit fc7f3f44a749265011d0a4f2d100c3e744263436
Author: Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Thu Nov 15 15:22:16 2018 +0100
Commit: Michael Stahl <Michael.Stahl at cib.de>
CommitDate: Thu Nov 15 15:33:49 2018 +0100
Revert "revert 25622f29b4003307d2ba780ff1232d8b7cdafa35 in list.cxx"
This reverts commit fa2167fe500e68f8960f40e13fdc908fc3fa1323 ...
and fixes the merge conflicts.
Change-Id: I57fa6b9e7d35e0fc28d941f2968854a52b17b995
diff --git a/sw/source/core/doc/list.cxx b/sw/source/core/doc/list.cxx
index c449c58e97b0..6744dd7aa321 100644
--- a/sw/source/core/doc/list.cxx
+++ b/sw/source/core/doc/list.cxx
@@ -115,13 +115,10 @@ SwListImpl::SwListImpl( const OUString& sListId,
SwListImpl::~SwListImpl() COVERITY_NOEXCEPT_FALSE
{
- tListTrees::iterator aNumberTreeIter;
- for ( aNumberTreeIter = maListTrees.begin();
- aNumberTreeIter != maListTrees.end();
- ++aNumberTreeIter )
+ for ( auto& rNumberTree : maListTrees )
{
- SwNodeNum::HandleNumberTreeRootNodeDelete(*((*aNumberTreeIter).pRoot));
- SwNodeNum::HandleNumberTreeRootNodeDelete(*((*aNumberTreeIter).pRootRLHidden));
+ SwNodeNum::HandleNumberTreeRootNodeDelete(*(rNumberTree.pRoot));
+ SwNodeNum::HandleNumberTreeRootNodeDelete(*(rNumberTree.pRootRLHidden));
}
}
@@ -131,21 +128,18 @@ void SwListImpl::InsertListItem( SwNodeNum& rNodeNum, bool const isHiddenRedline
const SwPosition aPosOfNodeNum( rNodeNum.GetPosition() );
const SwNodes* pNodesOfNodeNum = &(aPosOfNodeNum.nNode.GetNode().GetNodes());
- tListTrees::const_iterator aNumberTreeIter;
- for ( aNumberTreeIter = maListTrees.begin();
- aNumberTreeIter != maListTrees.end();
- ++aNumberTreeIter )
+ for ( const auto& rNumberTree : maListTrees )
{
- const SwPosition* pStart = (*aNumberTreeIter).pSection->Start();
- const SwPosition* pEnd = (*aNumberTreeIter).pSection->End();
+ const SwPosition* pStart = rNumberTree.pSection->Start();
+ const SwPosition* pEnd = rNumberTree.pSection->End();
const SwNodes* pRangeNodes = &(pStart->nNode.GetNode().GetNodes());
if ( pRangeNodes == pNodesOfNodeNum &&
*pStart <= aPosOfNodeNum && aPosOfNodeNum <= *pEnd)
{
auto const& pRoot(isHiddenRedlines
- ? (*aNumberTreeIter).pRootRLHidden
- : (*aNumberTreeIter).pRoot);
+ ? rNumberTree.pRootRLHidden
+ : rNumberTree.pRoot);
pRoot->AddChild(&rNodeNum, nLevel);
break;
}
@@ -159,25 +153,19 @@ void SwListImpl::RemoveListItem( SwNodeNum& rNodeNum )
void SwListImpl::InvalidateListTree()
{
- tListTrees::iterator aNumberTreeIter;
- for ( aNumberTreeIter = maListTrees.begin();
- aNumberTreeIter != maListTrees.end();
- ++aNumberTreeIter )
+ for ( auto& rNumberTree : maListTrees )
{
- (*aNumberTreeIter).pRoot->InvalidateTree();
- (*aNumberTreeIter).pRootRLHidden->InvalidateTree();
+ rNumberTree.pRoot->InvalidateTree();
+ rNumberTree.pRootRLHidden->InvalidateTree();
}
}
void SwListImpl::ValidateListTree()
{
- tListTrees::iterator aNumberTreeIter;
- for ( aNumberTreeIter = maListTrees.begin();
- aNumberTreeIter != maListTrees.end();
- ++aNumberTreeIter )
+ for ( auto& rNumberTree : maListTrees )
{
- (*aNumberTreeIter).pRoot->NotifyInvalidChildren();
- (*aNumberTreeIter).pRootRLHidden->NotifyInvalidChildren();
+ rNumberTree.pRoot->NotifyInvalidChildren();
+ rNumberTree.pRootRLHidden->NotifyInvalidChildren();
}
}
@@ -219,13 +207,10 @@ bool SwListImpl::IsListLevelMarked( const int nListLevel ) const
void SwListImpl::NotifyItemsOnListLevel( const int nLevel )
{
- tListTrees::iterator aNumberTreeIter;
- for ( aNumberTreeIter = maListTrees.begin();
- aNumberTreeIter != maListTrees.end();
- ++aNumberTreeIter )
+ for ( auto& rNumberTree : maListTrees )
{
- (*aNumberTreeIter).pRoot->NotifyNodesOnListLevel( nLevel );
- (*aNumberTreeIter).pRootRLHidden->NotifyNodesOnListLevel( nLevel );
+ rNumberTree.pRoot->NotifyNodesOnListLevel( nLevel );
+ rNumberTree.pRootRLHidden->NotifyNodesOnListLevel( nLevel );
}
}
More information about the Libreoffice-commits
mailing list