summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorLeonid Ryzhov <leoryzhov@gmail.com>2022-11-24 22:19:39 +0300
committerHossein <hossein@libreoffice.org>2022-12-19 16:39:27 +0000
commited9eef72e0f616b9c626629c4233b725ca5506ce (patch)
treea47f619a89fd64974245f33e7200c4b6a6255c00 /cui
parentd968061f008b954f55ab9a4dd51efd5d0844b543 (diff)
tdf#145538 Use range based for loops
Change-Id: I6d04185f14c3ec72b40426bd881cac80528cc736 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143244 Tested-by: Jenkins Reviewed-by: Hossein <hossein@libreoffice.org>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/customize/SvxNotebookbarConfigPage.cxx5
-rw-r--r--cui/source/dialogs/about.cxx8
2 files changed, 4 insertions, 9 deletions
diff --git a/cui/source/customize/SvxNotebookbarConfigPage.cxx b/cui/source/customize/SvxNotebookbarConfigPage.cxx
index 35dc04aacbaa..c6dda6701133 100644
--- a/cui/source/customize/SvxNotebookbarConfigPage.cxx
+++ b/cui/source/customize/SvxNotebookbarConfigPage.cxx
@@ -407,9 +407,8 @@ void SvxNotebookbarConfigPage::SelectElement()
if (m_xTopLevelListBox->get_count() == 1)
{
- for (std::size_t nIdx = 0; nIdx < aCategoryList.size(); nIdx++)
- m_xTopLevelListBox->append(aCategoryList[nIdx].sUIItemId,
- aCategoryList[nIdx].sDisplayName);
+ for (const auto& rCategory : aCategoryList)
+ m_xTopLevelListBox->append(rCategory.sUIItemId, rCategory.sDisplayName);
}
tools::ULong nStart = 0;
if (aEntries[nStart].sClassId == "sfxlo-PriorityHBox"
diff --git a/cui/source/dialogs/about.cxx b/cui/source/dialogs/about.cxx
index b3911bc61179..41d17b2a06d5 100644
--- a/cui/source/dialogs/about.cxx
+++ b/cui/source/dialogs/about.cxx
@@ -142,12 +142,8 @@ AboutDialog::AboutDialog(weld::Window *pParent)
AboutDialog::~AboutDialog() {}
bool AboutDialog::IsStringValidGitHash(std::u16string_view hash) {
- for (size_t i = 0; i < hash.size(); i++) {
- if (!std::isxdigit(hash[i])) {
- return false;
- }
- }
- return true;
+ return std::all_of(hash.begin(), hash.end(),
+ [](auto &rSymbol) { return std::isxdigit(rSymbol); });
}
OUString AboutDialog::GetVersionString() {