summaryrefslogtreecommitdiff
path: root/sfx2/source
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 /sfx2/source
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 'sfx2/source')
-rw-r--r--sfx2/source/doc/saveastemplatedlg.cxx7
-rw-r--r--sfx2/source/doc/templatedlg.cxx14
2 files changed, 6 insertions, 15 deletions
diff --git a/sfx2/source/doc/saveastemplatedlg.cxx b/sfx2/source/doc/saveastemplatedlg.cxx
index 5a6a12277f8d..b801462e877a 100644
--- a/sfx2/source/doc/saveastemplatedlg.cxx
+++ b/sfx2/source/doc/saveastemplatedlg.cxx
@@ -113,11 +113,8 @@ void SfxSaveAsTemplateDialog::initialize()
void SfxSaveAsTemplateDialog::SetCategoryLBEntries(const std::vector<OUString>& rFolderNames)
{
- if (!rFolderNames.empty())
- {
- for (size_t i = 0, n = rFolderNames.size(); i < n; ++i)
- m_xLBCategory->insert_text(i+1, rFolderNames[i]);
- }
+ for (size_t i = 0, n = rFolderNames.size(); i < n; ++i)
+ m_xLBCategory->insert_text(i+1, rFolderNames[i]);
m_xLBCategory->select(0);
}
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index c78cf5b002ac..717eabb934c2 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -344,11 +344,8 @@ void SfxTemplateManagerDlg::fillFolderComboBox()
{
std::vector<OUString> aFolderNames = mpLocalView->getFolderNames();
- if (!aFolderNames.empty())
- {
- for (size_t i = 0, n = aFolderNames.size(); i < n; ++i)
- mpCBFolder->InsertEntry(aFolderNames[i], i+1);
- }
+ for (size_t i = 0, n = aFolderNames.size(); i < n; ++i)
+ mpCBFolder->InsertEntry(aFolderNames[i], i+1);
mpCBFolder->SelectEntryPos(0);
mpActionMenu->HideItem(MNI_ACTION_RENAME_FOLDER);
}
@@ -1377,11 +1374,8 @@ IMPL_LINK_NOARG(SfxTemplateCategoryDialog, SelectCategoryHdl, weld::TreeView&, v
void SfxTemplateCategoryDialog::SetCategoryLBEntries(std::vector<OUString> aFolderNames)
{
- if (!aFolderNames.empty())
- {
- for (size_t i = 0, n = aFolderNames.size(); i < n; ++i)
- mxLBCategory->append_text(aFolderNames[i]);
- }
+ for (size_t i = 0, n = aFolderNames.size(); i < n; ++i)
+ mxLBCategory->append_text(aFolderNames[i]);
mxLBCategory->select(0);
}