summaryrefslogtreecommitdiff
path: root/shell
diff options
context:
space:
mode:
authorArkadiy Illarionov <qarkai@gmail.com>2018-12-01 15:19:04 +0300
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-12-01 18:26:01 +0100
commit56d97cdd0af15c90c744d2ac66e879818c073ec6 (patch)
tree98278957d27659cfa9fe5e9b1a4e2e550637fd73 /shell
parentfff501a3393b459c512ec155e2d2cd935e7885a2 (diff)
Simplify containers iterations in sfx2, shell
Use range-based loop or replace with STL functions Change-Id: I42361d6a73d201db8eb6dca09d79768e2d62051d Reviewed-on: https://gerrit.libreoffice.org/64389 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'shell')
-rw-r--r--shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx16
-rw-r--r--shell/source/win32/shlxthandler/util/iso8601_converter.cxx17
2 files changed, 12 insertions, 21 deletions
diff --git a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
index 4b5342441cfe..663762e188fb 100644
--- a/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
+++ b/shell/source/win32/shlxthandler/propsheets/listviewbuilder.cxx
@@ -73,19 +73,13 @@ void list_view_builder::build(statistic_group_list_t& gl)
{
setup_list_view();
- statistic_group_list_t::iterator group_iter = gl.begin();
- statistic_group_list_t::iterator group_iter_end = gl.end();
-
- for (/**/; group_iter != group_iter_end; ++group_iter)
+ for (const auto& group : gl)
{
- statistic_item_list_t::iterator item_iter = group_iter->second.begin();
- statistic_item_list_t::iterator item_iter_end = group_iter->second.end();
-
- if (item_iter != item_iter_end)
- insert_group(group_iter->first);
+ if (!group.second.empty())
+ insert_group(group.first);
- for (/**/; item_iter != item_iter_end; ++item_iter)
- insert_item(item_iter->title_, item_iter->value_, item_iter->editable_);
+ for (const auto& item : group.second)
+ insert_item(item.title_, item.value_, item.editable_);
}
}
diff --git a/shell/source/win32/shlxthandler/util/iso8601_converter.cxx b/shell/source/win32/shlxthandler/util/iso8601_converter.cxx
index 331a76926a5f..bf5a23d4da90 100644
--- a/shell/source/win32/shlxthandler/util/iso8601_converter.cxx
+++ b/shell/source/win32/shlxthandler/util/iso8601_converter.cxx
@@ -114,26 +114,23 @@ std::wstring iso8601_duration_to_local_duration(const std::wstring& iso8601durat
std::wstring minutes;
std::wstring seconds;
- std::wstring::const_iterator iter = iso8601duration.begin();
- std::wstring::const_iterator iter_end = iso8601duration.end();
-
std::wstring num;
- for (/**/; iter != iter_end; ++iter)
+ for (const auto& w_ch : iso8601duration)
{
- if (rtl::isAsciiDigit(*iter)) // wchar_t is unsigned under MSVC
+ if (rtl::isAsciiDigit(w_ch)) // wchar_t is unsigned under MSVC
{
- num += *iter;
+ num += w_ch;
}
else
{
- if (*iter == L'D' || *iter == L'd')
+ if (w_ch == L'D' || w_ch == L'd')
days = num;
- else if (*iter == L'H' || *iter == L'h')
+ else if (w_ch == L'H' || w_ch == L'h')
hours = num;
- else if (*iter == L'M' || *iter == L'm')
+ else if (w_ch == L'M' || w_ch == L'm')
minutes = num;
- else if (*iter == L'S' || *iter == L's')
+ else if (w_ch == L'S' || w_ch == L's')
seconds = num;
num.clear();