diff options
author | Leonid Ryzhov <leoryzhov@gmail.com> | 2022-11-24 22:19:39 +0300 |
---|---|---|
committer | Hossein <hossein@libreoffice.org> | 2022-12-19 16:39:27 +0000 |
commit | ed9eef72e0f616b9c626629c4233b725ca5506ce (patch) | |
tree | a47f619a89fd64974245f33e7200c4b6a6255c00 /desktop | |
parent | d968061f008b954f55ab9a4dd51efd5d0844b543 (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 'desktop')
-rw-r--r-- | desktop/qa/desktop_lib/test_desktop_lib.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/desktop/qa/desktop_lib/test_desktop_lib.cxx b/desktop/qa/desktop_lib/test_desktop_lib.cxx index e7762753775f..5d897c40f1da 100644 --- a/desktop/qa/desktop_lib/test_desktop_lib.cxx +++ b/desktop/qa/desktop_lib/test_desktop_lib.cxx @@ -1133,11 +1133,11 @@ void DesktopLOKTest::testSheetSelections() char* pCopiedContent = pDocument->pClass->getTextSelection(pDocument, nullptr, &pUsedMimeType); std::vector<long> aExpected = {5, 6, 7, 8, 9}; std::istringstream iss(pCopiedContent); - for (size_t i = 0; i < aExpected.size(); i++) + for (const long nIndex : aExpected) { std::string token; iss >> token; - CPPUNIT_ASSERT_EQUAL(aExpected[i], strtol(token.c_str(), nullptr, 10)); + CPPUNIT_ASSERT_EQUAL(nIndex, strtol(token.c_str(), nullptr, 10)); } free(pUsedMimeType); @@ -1166,11 +1166,11 @@ void DesktopLOKTest::testSheetSelections() char* pCopiedContent = pDocument->pClass->getTextSelection(pDocument, nullptr, &pUsedMimeType); std::vector<long> aExpected = { 8 }; std::istringstream iss(pCopiedContent); - for (size_t i = 0; i < aExpected.size(); i++) + for (const long nIndex : aExpected) { std::string token; iss >> token; - CPPUNIT_ASSERT_EQUAL(aExpected[i], strtol(token.c_str(), nullptr, 10)); + CPPUNIT_ASSERT_EQUAL(nIndex, strtol(token.c_str(), nullptr, 10)); } free(pUsedMimeType); @@ -1237,10 +1237,10 @@ void DesktopLOKTest::testSheetDragDrop() std::vector<long> aExpected = {1, 2, 3, 4, 5}; std::istringstream aContent(pContent); std::string token; - for (size_t i = 0; i < aExpected.size(); i++) + for (const long nIndex : aExpected) { aContent >> token; - CPPUNIT_ASSERT_EQUAL(aExpected[i], strtol(token.c_str(), nullptr, 10)); + CPPUNIT_ASSERT_EQUAL(nIndex, strtol(token.c_str(), nullptr, 10)); } free(pMimeType); @@ -1293,10 +1293,10 @@ void DesktopLOKTest::testSheetDragDrop() std::vector<long> aExpected = {1, 2, 3, 4, 5}; std::istringstream aContent(pContent); std::string token; - for (size_t i = 0; i < aExpected.size(); i++) + for (const long nIndex : aExpected) { aContent >> token; - CPPUNIT_ASSERT_EQUAL(aExpected[i], strtol(token.c_str(), nullptr, 10)); + CPPUNIT_ASSERT_EQUAL(nIndex, strtol(token.c_str(), nullptr, 10)); } free(pMimeType); |