summaryrefslogtreecommitdiff
path: root/sw/source/ui/dialog/uiregionsw.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-11-28 15:13:42 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-11-29 07:17:37 +0100
commit21de55596c0fdc2be736c6d0369bd9d3783020be (patch)
tree07d0f0cd54690e54405fe574c572cb2be74a3336 /sw/source/ui/dialog/uiregionsw.cxx
parentda9fb5d6d9ebf9363981c370ce937d8848989fcb (diff)
remove unnecessary "if (!empty()" checks before loops
found with git grep -n -A4 'if.*!.*empty' | grep -B3 -P '(\bfor)|(\bwhile)|(\bdo)' Change-Id: I582235b7cf977a0f9fb4099eb306fdb4a07b5334 Reviewed-on: https://gerrit.libreoffice.org/64169 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/ui/dialog/uiregionsw.cxx')
-rw-r--r--sw/source/ui/dialog/uiregionsw.cxx39
1 files changed, 18 insertions, 21 deletions
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index fdd0f4f6a733..e41cd8237137 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -474,29 +474,26 @@ void SwEditRegionDlg::RecurseList(const SwSectionFormat* pFormat, SvTreeListEntr
SwSections aTmpArr;
SvTreeListEntry* pNEntry;
pFormat->GetChildSections(aTmpArr, SectionSort::Pos);
- if( !aTmpArr.empty() )
+ for( const auto pSect : aTmpArr )
{
- for( const auto pSect : aTmpArr )
+ SectionType eTmpType;
+ pFormat = pSect->GetFormat();
+ if( pFormat->IsInNodesArr() &&
+ (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
+ && TOX_HEADER_SECTION != eTmpType )
{
- SectionType eTmpType;
- pFormat = pSect->GetFormat();
- if( pFormat->IsInNodesArr() &&
- (eTmpType = pFormat->GetSection()->GetType()) != TOX_CONTENT_SECTION
- && TOX_HEADER_SECTION != eTmpType )
- {
- SectRepr* pSectRepr=new SectRepr(
- FindArrPos( pSect->GetFormat() ), *pSect );
- Image aImage = BuildBitmap( pSect->IsProtect(),
- pSect->IsHidden());
- pNEntry = m_pTree->InsertEntry(
- pSect->GetSectionName(), aImage, aImage, pEntry);
- pNEntry->SetUserData(pSectRepr);
- RecurseList( pSect->GetFormat(), pNEntry );
- if( pNEntry->HasChildren())
- m_pTree->Expand(pNEntry);
- if (pCurrSect==pSect)
- pSelEntry = pNEntry;
- }
+ SectRepr* pSectRepr=new SectRepr(
+ FindArrPos( pSect->GetFormat() ), *pSect );
+ Image aImage = BuildBitmap( pSect->IsProtect(),
+ pSect->IsHidden());
+ pNEntry = m_pTree->InsertEntry(
+ pSect->GetSectionName(), aImage, aImage, pEntry);
+ pNEntry->SetUserData(pSectRepr);
+ RecurseList( pSect->GetFormat(), pNEntry );
+ if( pNEntry->HasChildren())
+ m_pTree->Expand(pNEntry);
+ if (pCurrSect==pSect)
+ pSelEntry = pNEntry;
}
}
}