summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorDr. David Alan Gilbert <dave@treblig.org>2023-05-31 01:58:18 +0100
committerMike Kaganski <mike.kaganski@collabora.com>2023-06-02 16:58:57 +0200
commit7bec1689fcbe9102aa220739b6113118d9a8dd1f (patch)
treead0146c3bf6f14530e36b79a0c620cfd1dad4084 /sw
parentf8036f2f5238adf227d0ffa646e503f0446bb37b (diff)
tdf#145538,tdf#147021: qa: range based loops
A bunch of range based loop changes in various qa sections that also take out about 1% of SAL_N_ELEMENTS Change-Id: I8ef000e9aa400cd8363b48f6175f6ab258cefbd9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/152422 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/core/macros-test.cxx6
-rw-r--r--sw/qa/extras/odfexport/odfexport2.cxx4
2 files changed, 5 insertions, 5 deletions
diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx
index a8c76bef1883..33511c471733 100644
--- a/sw/qa/core/macros-test.cxx
+++ b/sw/qa/core/macros-test.cxx
@@ -135,12 +135,12 @@ void SwMacrosTest::testVba()
}
};
- for ( size_t i=0; i<SAL_N_ELEMENTS( testInfo ); ++i )
+ for (auto const & [ sFileBaseName, sMacroUrl ] : testInfo)
{
- OUString sFileName("docm/" + testInfo[i].sFileBaseName);
+ OUString sFileName("docm/" + sFileBaseName);
loadFromURL(sFileName);
- uno::Any aRet = executeMacro(testInfo[i].sMacroUrl);
+ uno::Any aRet = executeMacro(sMacroUrl);
OUString aStringRes;
CPPUNIT_ASSERT_MESSAGE(sFileName.toUtf8().getStr(), aRet >>= aStringRes);
CPPUNIT_ASSERT_EQUAL(OUString("OK"), aStringRes);
diff --git a/sw/qa/extras/odfexport/odfexport2.cxx b/sw/qa/extras/odfexport/odfexport2.cxx
index ec88381e39fe..103892a7723a 100644
--- a/sw/qa/extras/odfexport/odfexport2.cxx
+++ b/sw/qa/extras/odfexport/odfexport2.cxx
@@ -121,7 +121,7 @@ DECLARE_ODFEXPORT_TEST(testReferenceLanguage, "referencelanguage.odt")
uno::Any aHu(OUString("Hu"));
uno::Any ahu(OUString("hu"));
- for (size_t i = 0; i < SAL_N_ELEMENTS(aFieldTexts); i++)
+ for (auto const& sFieldText : aFieldTexts)
{
uno::Any aField = xFields->nextElement();
uno::Reference<lang::XServiceInfo> xServiceInfo(aField, uno::UNO_QUERY);
@@ -131,7 +131,7 @@ DECLARE_ODFEXPORT_TEST(testReferenceLanguage, "referencelanguage.odt")
uno::Any aLang = xPropertySet->getPropertyValue("ReferenceFieldLanguage");
CPPUNIT_ASSERT_EQUAL(true, aLang == aHu || aLang == ahu);
uno::Reference<text::XTextContent> xField(aField, uno::UNO_QUERY);
- CPPUNIT_ASSERT_EQUAL(aFieldTexts[i], xField->getAnchor()->getString());
+ CPPUNIT_ASSERT_EQUAL(sFieldText, xField->getAnchor()->getString());
}
}
}