From 60846212c7f5271a86fd43555d633f77d59f5a10 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 21 May 2020 09:11:25 +0200 Subject: use for-range on Sequence in sfx2..sw Change-Id: I09806869f2fdbae61f4c5d5c9db6859202bb63b5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94609 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 8 ++------ sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 7 +++---- 2 files changed, 5 insertions(+), 10 deletions(-) (limited to 'sw/qa/extras/ooxmlimport') diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index e08fadcc6b70..343c08a94d89 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -1303,10 +1303,8 @@ DECLARE_OOXMLIMPORT_TEST(testTdf101626, "tdf101626.docx") uno::Sequence aProps; xLevels->getByIndex(0) >>= aProps; // 1st level - for (int i = 0; i < aProps.getLength(); ++i) + for (beans::PropertyValue const & rProp : std::as_const(aProps)) { - const beans::PropertyValue& rProp = aProps[i]; - if (rProp.Name == "BulletChar") { // the bulletChar has to be 0x2d! @@ -1325,10 +1323,8 @@ DECLARE_OOXMLIMPORT_TEST( testTdf106606, "tdf106606.docx" ) uno::Sequence aProps; xLevels->getByIndex( 0 ) >>= aProps; // 1st level - for ( int i = 0; i < aProps.getLength(); ++i ) + for ( beans::PropertyValue const & rProp : std::as_const(aProps)) { - const beans::PropertyValue& rProp = aProps[i]; - // If the image was prematurely removed from cache when processed for previous numbering list, then the sequence hasn't the property. if ( rProp.Name == "GraphicBitmap" ) return true; diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx index be99a8b9c47a..78e79add953a 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport2.cxx @@ -539,12 +539,11 @@ DECLARE_OOXMLIMPORT_TEST(testTdf103345, "numbering-circle.docx") uno::Sequence aProps; xLevels->getByIndex(0) >>= aProps; // 1st level - for (int i = 0; i < aProps.getLength(); ++i) + for (beans::PropertyValue const& prop : std::as_const(aProps)) { - if (aProps[i].Name == "NumberingType") + if (prop.Name == "NumberingType") { - CPPUNIT_ASSERT_EQUAL(style::NumberingType::CIRCLE_NUMBER, - aProps[i].Value.get()); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::CIRCLE_NUMBER, prop.Value.get()); return; } } -- cgit v1.2.3