From 639511d7194726b188a2ecae9b3489a250532d03 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Thu, 21 May 2020 09:05:51 +0200 Subject: use for-range on Sequence in i18npool..sd Change-Id: I19eba57bc6058c317473d0746f06699a09ba2830 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94608 Tested-by: Jenkins Reviewed-by: Noel Grandin --- oox/source/core/xmlfilterbase.cxx | 4 ++-- oox/source/export/drawingml.cxx | 3 +-- oox/source/helper/propertymap.cxx | 42 +++++++++++++++++++-------------------- 3 files changed, 24 insertions(+), 25 deletions(-) (limited to 'oox') diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index e7a355e2c7dd..03d68fc232c4 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -597,9 +597,9 @@ writeElement( const FSHelperPtr& pDoc, sal_Int32 nXmlElement, const Sequence< OU OUStringBuffer sRep; sRep.append( aItems[ 0 ] ); - for( sal_Int32 i = 1, end = aItems.getLength(); i < end; ++i ) + for( const OUString& rItem : aItems ) { - sRep.append( " " ).append( aItems[ i ] ); + sRep.append( " " ).append( rItem ); } writeElement( pDoc, nXmlElement, sRep.makeStringAndClear() ); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index 2d44aec64465..63fec0d6d18c 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -3095,9 +3095,8 @@ bool DrawingML::WriteCustomGeometry( if ( pGeometrySeq ) { - for( int i = 0; i < pGeometrySeq->getLength(); ++i ) + for( const beans::PropertyValue& rProp : *pGeometrySeq ) { - const beans::PropertyValue& rProp = (*pGeometrySeq)[ i ]; if ( rProp.Name == "Path" ) { uno::Sequence aPathProp; diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx index f7016022b478..aff0e66452c4 100644 --- a/oox/source/helper/propertymap.cxx +++ b/oox/source/helper/propertymap.cxx @@ -378,9 +378,9 @@ static void lclDumpAnyValue( const Any& value) Sequence< PropertyValue > aBulletPropSeq; fprintf (stderr, "level %d\n", k); if (xNumRule->getByIndex (k) >>= aBulletPropSeq) { - for (int j=0; j aBulletPropSeq; fprintf (stderr, "level %d\n", k); if (xNumRule->getByIndex (k) >>= aBulletPropSeq) { - for (int j=0; jgetPropertyValue (props [i].Name), level + 1); + const char* var = lclDumpAnyValueCode (rXPropSet->getPropertyValue (rProp.Name), level + 1); printLevel (level + 1); fprintf (stderr,"aPropertyMap.setProperty(PROP_%s, %s);\n", name.getStr(), var); printLevel (level); fprintf (stderr, "}\n"); } catch (const Exception&) { - fprintf (stderr,"unable to get '%s' value\n", USS(props [i].Name)); + fprintf (stderr,"unable to get '%s' value\n", USS(rProp.Name)); } } } @@ -924,12 +924,12 @@ void PropertyMap::dumpCode( const Reference< XPropertySet >& rXPropSet ) void PropertyMap::dumpData(const Reference& xPropertySet) { Reference xPropertySetInfo = xPropertySet->getPropertySetInfo(); - Sequence aProperties = xPropertySetInfo->getProperties(); + const Sequence aProperties = xPropertySetInfo->getProperties(); - for (int i = 0; i < aProperties.getLength(); ++i) + for (const Property& rProp : aProperties) { - std::cerr << aProperties[i].Name << std::endl; - std::cerr << comphelper::anyToString(xPropertySet->getPropertyValue(aProperties[i].Name)) << std::endl; + std::cerr << rProp.Name << std::endl; + std::cerr << comphelper::anyToString(xPropertySet->getPropertyValue(rProp.Name)) << std::endl; } } -- cgit