diff options
author | Dr. David Alan Gilbert <dave@treblig.org> | 2023-05-31 01:58:18 +0100 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-06-02 16:58:57 +0200 |
commit | 7bec1689fcbe9102aa220739b6113118d9a8dd1f (patch) | |
tree | ad0146c3bf6f14530e36b79a0c620cfd1dad4084 /xmloff/qa/unit | |
parent | f8036f2f5238adf227d0ffa646e503f0446bb37b (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 'xmloff/qa/unit')
-rw-r--r-- | xmloff/qa/unit/uxmloff.cxx | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/xmloff/qa/unit/uxmloff.cxx b/xmloff/qa/unit/uxmloff.cxx index 9cad246f976e..86c98989d8cb 100644 --- a/xmloff/qa/unit/uxmloff.cxx +++ b/xmloff/qa/unit/uxmloff.cxx @@ -200,7 +200,7 @@ void Test::testMetaGenerator() { "LibreOfficeDev/7.0.6.0.0$Linux_X86_64 LibreOffice_project/dfc40e2292c6e19e285c10ed8c8044d9454107d0", ";70600", SvXMLImport::LO_7x }, }; - for (size_t i = 0; i < SAL_N_ELEMENTS(tests); ++i) + for (auto const[pGenerator, pBuildId, nResult] : tests) { // the DocumentInfo instance is cached so need fresh SvXMLImport rtl::Reference<SvXMLImport> const pImport(new SvXMLImport( @@ -209,18 +209,17 @@ void Test::testMetaGenerator() pImport->initialize(uno::Sequence<uno::Any>{ uno::Any(xInfoSet) }); - SvXMLMetaDocumentContext::setBuildId( - OUString::createFromAscii(tests[i].generator), xInfoSet); - if (tests[i].buildId[0] != '\0') + SvXMLMetaDocumentContext::setBuildId(OUString::createFromAscii(pGenerator), xInfoSet); + if (pBuildId[0] != '\0') { - CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(tests[i].buildId), - xInfoSet->getPropertyValue("BuildId").get<OUString>()); + CPPUNIT_ASSERT_EQUAL(OUString::createFromAscii(pBuildId), + xInfoSet->getPropertyValue("BuildId").get<OUString>()); } else { CPPUNIT_ASSERT(!xInfoSet->getPropertyValue("BuildId").hasValue()); } - CPPUNIT_ASSERT_EQUAL(tests[i].result, pImport->getGeneratorVersion()); + CPPUNIT_ASSERT_EQUAL(nResult, pImport->getGeneratorVersion()); } } |