summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-10-27 19:50:00 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-10-30 07:52:11 +0100
commit16b2b4f27acb83fc651b8484dead53ebd0e269e1 (patch)
tree04bc6e6b39ba22fdc13942008434d97495c88635 /sw/source/uibase/utlui
parent922c4a61ca21848777703a28abfd442dd0b4a858 (diff)
Simplify containers iterations in sw/source/ui*
Use range-based loop or replace with STL functions. Change-Id: I0d690e873f720a68f04991674ce84ec590231fd0 Reviewed-on: https://gerrit.libreoffice.org/62432 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r--sw/source/uibase/utlui/content.cxx4
-rw-r--r--sw/source/uibase/utlui/gloslst.cxx9
2 files changed, 6 insertions, 7 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 2bb546138d60..014dcfb22493 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -701,10 +701,10 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged)
std::vector<OUString> aRefMarks;
nMemberCount = pWrtShell->GetRefMarks( &aRefMarks );
- for(std::vector<OUString>::const_iterator i = aRefMarks.begin(); i != aRefMarks.end(); ++i)
+ for (const auto& rRefMark : aRefMarks)
{
// References sorted alphabetically
- pMember->insert(o3tl::make_unique<SwContent>(this, *i, 0));
+ pMember->insert(o3tl::make_unique<SwContent>(this, rRefMark, 0));
}
}
break;
diff --git a/sw/source/uibase/utlui/gloslst.cxx b/sw/source/uibase/utlui/gloslst.cxx
index ea41daf985f4..c8f1102813ce 100644
--- a/sw/source/uibase/utlui/gloslst.cxx
+++ b/sw/source/uibase/utlui/gloslst.cxx
@@ -146,8 +146,8 @@ bool SwGlossaryList::GetShortName(const OUString& rLongName,
aDlg.set_title(sTitle);
weld::TreeView& rLB = aDlg.GetTreeView();
- for(std::vector<TripleString>::const_iterator i = aTripleStrings.begin(); i != aTripleStrings.end(); ++i)
- rLB.append_text(i->sGroup.getToken(0, GLOS_DELIM));
+ for (const auto& rTriple : aTripleStrings)
+ rLB.append_text(rTriple.sGroup.getToken(0, GLOS_DELIM));
rLB.select(0);
if (aDlg.run() == RET_OK && rLB.get_selected_index() != -1)
@@ -317,10 +317,9 @@ void SwGlossaryList::Update()
// for the current subpath.
if( nGroupPath == nPath )
{
- bool bFound = false;
OUString sCompareGroup = pGroup->sName.getToken(0, GLOS_DELIM);
- for(std::vector<OUString>::const_iterator j = aFoundGroupNames.begin(); j != aFoundGroupNames.end() && !bFound; ++j)
- bFound = (sCompareGroup == *j);
+ bool bFound = std::any_of(aFoundGroupNames.begin(), aFoundGroupNames.end(),
+ [&sCompareGroup](const OUString& rGroupName) { return sCompareGroup == rGroupName; });
if(!bFound)
{