diff options
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/htmlimport/htmlimport.cxx | 8 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport11.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport2.cxx | 18 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport3.cxx | 56 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport4.cxx | 16 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport6.cxx | 8 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport8.cxx | 4 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 8 | ||||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport2.cxx | 7 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport.cxx | 26 | ||||
-rw-r--r-- | sw/qa/extras/rtfexport/rtfexport2.cxx | 4 |
12 files changed, 67 insertions, 96 deletions
diff --git a/sw/qa/extras/htmlimport/htmlimport.cxx b/sw/qa/extras/htmlimport/htmlimport.cxx index 35af0a03ad3e..fe323ca2592c 100644 --- a/sw/qa/extras/htmlimport/htmlimport.cxx +++ b/sw/qa/extras/htmlimport/htmlimport.cxx @@ -152,10 +152,8 @@ DECLARE_HTMLIMPORT_TEST(testListStyleType, "list-style.html") xLevels->getByIndex(0) >>= aProps; // 1st level bool bBulletFound=false; - 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") { // should be 'o'. @@ -173,10 +171,8 @@ DECLARE_HTMLIMPORT_TEST(testListStyleType, "list-style.html") uno::UNO_QUERY); 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 == "NumberingType") { printf("style is %d\n", rProp.Value.get<sal_Int16>()); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx index ed5216c15a10..ac4bf4cd2053 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx @@ -896,10 +896,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf89890, "tdf89890.docx") xLevels->getByIndex(0) >>= aProps; // 1st level bool bFound = false; - 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 == "GraphicSize") { // Height of the graphic was too large: 4382 after import, then 2485 after roundtrip. diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx index df21b60935a5..087373aaf7e4 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport11.cxx @@ -227,10 +227,8 @@ DECLARE_OOXMLEXPORT_TEST(testTdf82065_Ind_start_strict, "tdf82065_Ind_start_stri uno::Sequence<beans::PropertyValue> aProps; xLevels->getByIndex(0) >>= aProps; // 1st level bool bFoundIndentAt = false; - 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 == "IndentAt") { CPPUNIT_ASSERT_DOUBLES_EQUAL_MESSAGE("IndentAt", double(6001), rProp.Value.get<double>(), 10 ); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx index 50b43fed1a44..fa75e2d6af85 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport2.cxx @@ -574,10 +574,8 @@ DECLARE_OOXMLEXPORT_TEST(testI120928, "i120928.docx") uno::Reference<awt::XBitmap> xBitmap; sal_Int16 nNumberingType = -1; - 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 == "NumberingType") nNumberingType = rProp.Value.get<sal_Int16>(); else if (rProp.Name == "GraphicBitmap") @@ -643,10 +641,10 @@ DECLARE_OOXMLEXPORT_TEST(testWatermark, "watermark.docx") // 1st problem: last character was missing CPPUNIT_ASSERT_EQUAL(OUString("SAMPLE"), xShape->getString()); - uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xShape, "CustomShapeGeometry"); + const uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xShape, "CustomShapeGeometry"); bool bFound = false; - for (int i = 0; i < aProps.getLength(); ++i) - if (aProps[i].Name == "TextPath") + for (beans::PropertyValue const & prop : aProps) + if (prop.Name == "TextPath") bFound = true; // 2nd problem: v:textpath wasn't imported CPPUNIT_ASSERT_EQUAL(true, bFound); @@ -910,9 +908,8 @@ DECLARE_OOXMLEXPORT_TEST(testFdo66781, "fdo66781.docx") uno::Sequence<beans::PropertyValue> 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") { CPPUNIT_ASSERT_EQUAL(OUString("\x0", 1, RTL_TEXTENCODING_ASCII_US), rProp.Value.get<OUString>()); @@ -1057,10 +1054,9 @@ DECLARE_OOXMLEXPORT_TEST(testFdo67737, "fdo67737.docx") { // The problem was that imported shapes did not import and render the 'flip:x' and 'flip:y' attributes uno::Reference<drawing::XShape> xArrow = getShape(1); - uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xArrow, "CustomShapeGeometry"); - for (int i = 0; i < aProps.getLength(); ++i) + const uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xArrow, "CustomShapeGeometry"); + for (beans::PropertyValue const & rProp : aProps) { - const beans::PropertyValue& rProp = aProps[i]; if (rProp.Name == "MirroredY") { CPPUNIT_ASSERT_EQUAL( true, rProp.Value.get<bool>() ); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx index 2876bb47929a..109c961c5fbc 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport3.cxx @@ -191,20 +191,20 @@ DECLARE_OOXMLEXPORT_TEST(testStyleInheritance, "style-inheritance.docx") // Check latent styles uno::Sequence<beans::PropertyValue> aGrabBag = getProperty< uno::Sequence<beans::PropertyValue> >(mxComponent, "InteropGrabBag"); uno::Sequence<beans::PropertyValue> aLatentStyles; - for (sal_Int32 i = 0; i < aGrabBag.getLength(); ++i) - if (aGrabBag[i].Name == "latentStyles") - aGrabBag[i].Value >>= aLatentStyles; + for (beans::PropertyValue const & prop : std::as_const(aGrabBag)) + if (prop.Name == "latentStyles") + prop.Value >>= aLatentStyles; CPPUNIT_ASSERT(aLatentStyles.getLength()); // document should have latent styles // Check latent style default attributes OUString aCount; uno::Sequence<beans::PropertyValue> aLatentStyleExceptions; - for (sal_Int32 i = 0; i < aLatentStyles.getLength(); ++i) + for (beans::PropertyValue const & prop : std::as_const(aLatentStyles)) { - if (aLatentStyles[i].Name == "count") - aCount = aLatentStyles[i].Value.get<OUString>(); - else if (aLatentStyles[i].Name == "lsdExceptions") - aLatentStyles[i].Value >>= aLatentStyleExceptions; + if (prop.Name == "count") + aCount = prop.Value.get<OUString>(); + else if (prop.Name == "lsdExceptions") + prop.Value >>= aLatentStyleExceptions; } CPPUNIT_ASSERT_EQUAL(OUString("371"), aCount); // This check the "count" attribute. @@ -212,9 +212,9 @@ DECLARE_OOXMLEXPORT_TEST(testStyleInheritance, "style-inheritance.docx") uno::Sequence<beans::PropertyValue> aLatentStyleException; aLatentStyleExceptions[0].Value >>= aLatentStyleException; OUString aName; - for (sal_Int32 i = 0; i < aLatentStyleException.getLength(); ++i) - if (aLatentStyleException[i].Name == "name") - aName = aLatentStyleException[i].Value.get<OUString>(); + for (beans::PropertyValue const & prop : std::as_const(aLatentStyleException)) + if (prop.Name == "name") + aName = prop.Value.get<OUString>(); CPPUNIT_ASSERT_EQUAL(OUString("Normal"), aName); // This checks the "name" attribute of the first exception. // This numbering style wasn't roundtripped. @@ -420,13 +420,13 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx") CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty bool bTheme = false; - for(int i = 0; i < aGrabBag.getLength(); ++i) + for(beans::PropertyValue const & prop : std::as_const(aGrabBag)) { - if (aGrabBag[i].Name == "OOXTheme") + if (prop.Name == "OOXTheme") { bTheme = true; uno::Reference<xml::dom::XDocument> aThemeDom; - CPPUNIT_ASSERT(aGrabBag[i].Value >>= aThemeDom); // PropertyValue of proper type + CPPUNIT_ASSERT(prop.Value >>= aThemeDom); // PropertyValue of proper type CPPUNIT_ASSERT(aThemeDom.get()); // Reference not empty } } @@ -442,42 +442,42 @@ DECLARE_OOXMLEXPORT_TEST(testSmartart, "smartart.docx") CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty bool bData = false, bLayout = false, bQStyle = false, bColor = false, bDrawing = false; - for(int i = 0; i < aGrabBag.getLength(); ++i) + for(beans::PropertyValue const & prop : std::as_const(aGrabBag)) { - if (aGrabBag[i].Name == "OOXData") + if (prop.Name == "OOXData") { bData = true; uno::Reference<xml::dom::XDocument> aDataDom; - CPPUNIT_ASSERT(aGrabBag[i].Value >>= aDataDom); // PropertyValue of proper type + CPPUNIT_ASSERT(prop.Value >>= aDataDom); // PropertyValue of proper type CPPUNIT_ASSERT(aDataDom.get()); // Reference not empty } - else if (aGrabBag[i].Name == "OOXLayout") + else if (prop.Name == "OOXLayout") { bLayout = true; uno::Reference<xml::dom::XDocument> aLayoutDom; - CPPUNIT_ASSERT(aGrabBag[i].Value >>= aLayoutDom); // PropertyValue of proper type + CPPUNIT_ASSERT(prop.Value >>= aLayoutDom); // PropertyValue of proper type CPPUNIT_ASSERT(aLayoutDom.get()); // Reference not empty } - else if (aGrabBag[i].Name == "OOXStyle") + else if (prop.Name == "OOXStyle") { bQStyle = true; uno::Reference<xml::dom::XDocument> aStyleDom; - CPPUNIT_ASSERT(aGrabBag[i].Value >>= aStyleDom); // PropertyValue of proper type + CPPUNIT_ASSERT(prop.Value >>= aStyleDom); // PropertyValue of proper type CPPUNIT_ASSERT(aStyleDom.get()); // Reference not empty } - else if (aGrabBag[i].Name == "OOXColor") + else if (prop.Name == "OOXColor") { bColor = true; uno::Reference<xml::dom::XDocument> aColorDom; - CPPUNIT_ASSERT(aGrabBag[i].Value >>= aColorDom); // PropertyValue of proper type + CPPUNIT_ASSERT(prop.Value >>= aColorDom); // PropertyValue of proper type CPPUNIT_ASSERT(aColorDom.get()); // Reference not empty } - else if (aGrabBag[i].Name == "OOXDrawing") + else if (prop.Name == "OOXDrawing") { bDrawing = true; uno::Sequence< uno::Any > diagramDrawing; uno::Reference<xml::dom::XDocument> aDrawingDom; - CPPUNIT_ASSERT(aGrabBag[i].Value >>= diagramDrawing); + CPPUNIT_ASSERT(prop.Value >>= diagramDrawing); CPPUNIT_ASSERT(diagramDrawing[0] >>= aDrawingDom); // PropertyValue of proper type CPPUNIT_ASSERT(aDrawingDom.get()); // Reference not empty } @@ -530,14 +530,14 @@ DECLARE_OOXMLEXPORT_TEST(testCustomXmlGrabBag, "customxml.docx") xTextDocumentPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag; CPPUNIT_ASSERT(aGrabBag.hasElements()); // Grab Bag not empty bool CustomXml = false; - for(int i = 0; i < aGrabBag.getLength(); ++i) + for(beans::PropertyValue const & prop : std::as_const(aGrabBag)) { - if (aGrabBag[i].Name == "OOXCustomXml" || aGrabBag[i].Name == "OOXCustomXmlProps") + if (prop.Name == "OOXCustomXml" || prop.Name == "OOXCustomXmlProps") { CustomXml = true; uno::Reference<xml::dom::XDocument> aCustomXmlDom; uno::Sequence<uno::Reference<xml::dom::XDocument> > aCustomXmlDomList; - CPPUNIT_ASSERT(aGrabBag[i].Value >>= aCustomXmlDomList); // PropertyValue of proper type + CPPUNIT_ASSERT(prop.Value >>= aCustomXmlDomList); // PropertyValue of proper type sal_Int32 length = aCustomXmlDomList.getLength(); CPPUNIT_ASSERT_EQUAL(sal_Int32(1), length); aCustomXmlDom = aCustomXmlDomList[0]; diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx index 08642a53da7f..621cc1325e6b 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport4.cxx @@ -172,11 +172,11 @@ DECLARE_OOXMLEXPORT_TEST(testMsoSpt180, "mso-spt180.docx") return; uno::Reference<container::XIndexAccess> xGroup(getShape(1), uno::UNO_QUERY); - uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xGroup->getByIndex(0), "CustomShapeGeometry"); + const uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(xGroup->getByIndex(0), "CustomShapeGeometry"); OUString aType; - for (int i = 0; i < aProps.getLength(); ++i) - if (aProps[i].Name == "Type") - aType = aProps[i].Value.get<OUString>(); + for (beans::PropertyValue const & prop : aProps) + if (prop.Name == "Type") + aType = prop.Value.get<OUString>(); // This was exported as borderCallout90, which is an invalid drawingML preset shape string. CPPUNIT_ASSERT_EQUAL(OUString("ooxml-borderCallout1"), aType); } @@ -467,14 +467,14 @@ DECLARE_OOXMLEXPORT_TEST(testEmbeddedXlsx, "embedded-xlsx.docx") // finally check the embedded files are present in the zipped document uno::Reference<packages::zip::XZipFileAccess2> xNameAccess = packages::zip::ZipFileAccess::createWithURL(comphelper::getComponentContext(m_xSFactory), maTempFile.GetURL()); - uno::Sequence<OUString> names = xNameAccess->getElementNames(); + const uno::Sequence<OUString> names = xNameAccess->getElementNames(); int nSheetFiles = 0; int nImageFiles = 0; - for (int i=0; i<names.getLength(); i++) + for (OUString const & n : names) { - if(names[i].startsWith("word/embeddings/oleObject")) + if(n.startsWith("word/embeddings/oleObject")) nSheetFiles++; - if(names[i].startsWith("word/media/image")) + if(n.startsWith("word/media/image")) nImageFiles++; } CPPUNIT_ASSERT_EQUAL(2, nSheetFiles); diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx index 14d8a979facc..9a453ac89553 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx @@ -142,19 +142,17 @@ DECLARE_OOXMLEXPORT_TEST(testDMLCustomGeometry, "dml-customgeometry-cubicbezier. { // The problem was that a custom shape was not exported. - uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(getShape(1), "CustomShapeGeometry"); + const uno::Sequence<beans::PropertyValue> aProps = getProperty< uno::Sequence<beans::PropertyValue> >(getShape(1), "CustomShapeGeometry"); uno::Sequence<beans::PropertyValue> aPathProps; - for (int i = 0; i < aProps.getLength(); ++i) + for (beans::PropertyValue const & rProp : aProps) { - const beans::PropertyValue& rProp = aProps[i]; if (rProp.Name == "Path") rProp.Value >>= aPathProps; } uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aPairs; uno::Sequence<drawing::EnhancedCustomShapeSegment> aSegments; - for (int i = 0; i < aPathProps.getLength(); ++i) + for (beans::PropertyValue const & rProp : std::as_const(aPathProps)) { - const beans::PropertyValue& rProp = aPathProps[i]; if (rProp.Name == "Coordinates") rProp.Value >>= aPairs; else if (rProp.Name == "Segments") diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx index e41501720a49..56e6e6b1079f 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport8.cxx @@ -805,10 +805,8 @@ DECLARE_OOXMLEXPORT_TEST(testFdo59638, "fdo59638.docx") uno::Sequence<beans::PropertyValue> 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") { // Was '*', should be 'o'. 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<beans::PropertyValue> 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<beans::PropertyValue> 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<beans::PropertyValue> 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<sal_Int16>()); + CPPUNIT_ASSERT_EQUAL(style::NumberingType::CIRCLE_NUMBER, prop.Value.get<sal_Int16>()); return; } } diff --git a/sw/qa/extras/rtfexport/rtfexport.cxx b/sw/qa/extras/rtfexport/rtfexport.cxx index 76d880c17a0f..4fec96ab05d5 100644 --- a/sw/qa/extras/rtfexport/rtfexport.cxx +++ b/sw/qa/extras/rtfexport/rtfexport.cxx @@ -410,19 +410,17 @@ DECLARE_RTFEXPORT_TEST(testFdo53113, "fdo53113.odt") * xray oCoordinates(1).Second.Value ' 102 */ - uno::Sequence<beans::PropertyValue> aProps + const uno::Sequence<beans::PropertyValue> aProps = getProperty<uno::Sequence<beans::PropertyValue>>(getShape(1), "CustomShapeGeometry"); uno::Sequence<beans::PropertyValue> aPathProps; - for (int i = 0; i < aProps.getLength(); ++i) + for (beans::PropertyValue const& rProp : aProps) { - const beans::PropertyValue& rProp = aProps[i]; if (rProp.Name == "Path") rProp.Value >>= aPathProps; } uno::Sequence<drawing::EnhancedCustomShapeParameterPair> aPairs; - for (int i = 0; i < aPathProps.getLength(); ++i) + for (beans::PropertyValue const& rProp : std::as_const(aPathProps)) { - const beans::PropertyValue& rProp = aPathProps[i]; if (rProp.Name == "Coordinates") rProp.Value >>= aPairs; } @@ -540,10 +538,8 @@ DECLARE_RTFEXPORT_TEST(testI120928, "i120928.rtf") uno::Reference<awt::XBitmap> xBitmap; sal_Int16 nNumberingType = -1; - 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 == "NumberingType") nNumberingType = rProp.Value.get<sal_Int16>(); else if (rProp.Name == "GraphicBitmap") @@ -669,10 +665,8 @@ DECLARE_RTFEXPORT_TEST(testFdo66682, "fdo66682.rtf") xLevels->getByIndex(0) >>= aProps; // 1st level OUString aListFormat; - 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 == "ListFormat") aListFormat = rProp.Value.get<OUString>(); } @@ -1282,9 +1276,9 @@ DECLARE_RTFEXPORT_TEST(testTdf104085, "tdf104085.rtf") uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aProps; xLevels->getByIndex(0) >>= aProps; - for (int i = 0; i < aProps.getLength(); ++i) + for (beans::PropertyValue const& prop : std::as_const(aProps)) { - if (aProps[i].Name == "BulletChar") + if (prop.Name == "BulletChar") return; } CPPUNIT_FAIL("no BulletChar property"); @@ -1310,12 +1304,12 @@ DECLARE_RTFEXPORT_TEST(testLeveljcCenter, "leveljc-center.rtf") uno::UNO_QUERY); uno::Sequence<beans::PropertyValue> aProps; xLevels->getByIndex(0) >>= aProps; - for (int i = 0; i < aProps.getLength(); ++i) + for (beans::PropertyValue const& prop : std::as_const(aProps)) { - if (aProps[i].Name == "Adjust") + if (prop.Name == "Adjust") { sal_Int16 nValue = 0; - CPPUNIT_ASSERT(aProps[i].Value >>= nValue); + CPPUNIT_ASSERT(prop.Value >>= nValue); CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue); return; } diff --git a/sw/qa/extras/rtfexport/rtfexport2.cxx b/sw/qa/extras/rtfexport/rtfexport2.cxx index d20b46873dd9..75226144932c 100644 --- a/sw/qa/extras/rtfexport/rtfexport2.cxx +++ b/sw/qa/extras/rtfexport/rtfexport2.cxx @@ -887,10 +887,8 @@ DECLARE_RTFEXPORT_TEST(testFdo59638, "fdo59638.rtf") uno::Sequence<beans::PropertyValue> 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") { // Was '*', should be 'o'. |