summaryrefslogtreecommitdiff
path: root/oox
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-05 10:10:54 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-05 12:44:25 +0000
commitf07ff7ed8a23b4982ed9cd7d9e2083c9d0928384 (patch)
tree636c69f83d25d0bfe540322b24dcbe3779c6b9b7 /oox
parent931a72efbc8708fab91e849b39a84e6b7939c7de (diff)
clang-tidy modernize-loop-convert in oox to sax
Change-Id: If0d87b6679765fc6d1f9300c6972845cf3742b9c Reviewed-on: https://gerrit.libreoffice.org/24674 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'oox')
-rw-r--r--oox/source/drawingml/customshapegeometry.cxx4
-rw-r--r--oox/source/drawingml/fillpropertiesgroupcontext.cxx8
-rw-r--r--oox/source/drawingml/shape.cxx6
-rw-r--r--oox/source/export/shapes.cxx12
-rw-r--r--oox/source/vml/vmlshape.cxx6
5 files changed, 18 insertions, 18 deletions
diff --git a/oox/source/drawingml/customshapegeometry.cxx b/oox/source/drawingml/customshapegeometry.cxx
index a29ea074b220..d019c9fb8d82 100644
--- a/oox/source/drawingml/customshapegeometry.cxx
+++ b/oox/source/drawingml/customshapegeometry.cxx
@@ -423,8 +423,8 @@ static OUString convertToOOEquation( CustomShapeProperties& rCustomShapeProperti
if ( !pCommandHashMap )
{
FormulaCommandHMap* pHM = new FormulaCommandHMap();
- for( sal_Int32 i = 0; i < FC_LAST; i++ )
- (*pHM)[ OUString::createFromAscii( pFormularCommandNameTable[ i ].pS ) ] = pFormularCommandNameTable[ i ].pE;
+ for(const FormularCommandNameTable& i : pFormularCommandNameTable)
+ (*pHM)[ OUString::createFromAscii( i.pS ) ] = i.pE;
pCommandHashMap = pHM;
}
diff --git a/oox/source/drawingml/fillpropertiesgroupcontext.cxx b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
index 78d4b16ecc9b..69175f4d647e 100644
--- a/oox/source/drawingml/fillpropertiesgroupcontext.cxx
+++ b/oox/source/drawingml/fillpropertiesgroupcontext.cxx
@@ -360,13 +360,13 @@ ContextHandlerRef ArtisticEffectContext::onCreateContext(
XML_size, XML_brushSize, XML_scaling, XML_detail, XML_bright, XML_contrast,
XML_colorTemp, XML_sat, XML_amount
};
- for( sal_Int32 i=0; i<19; ++i )
+ for(sal_Int32 nAttrib : aAttribs)
{
- if( rAttribs.hasAttribute( aAttribs[i] ) )
+ if( rAttribs.hasAttribute( nAttrib ) )
{
- OUString sName = ArtisticEffectProperties::getEffectString( aAttribs[i] );
+ OUString sName = ArtisticEffectProperties::getEffectString( nAttrib );
if( !sName.isEmpty() )
- maEffect.maAttribs[sName] = uno::makeAny( rAttribs.getInteger( aAttribs[i], 0 ) );
+ maEffect.maAttribs[sName] = uno::makeAny( rAttribs.getInteger( nAttrib, 0 ) );
}
}
diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx
index fb5a30a2c649..eb7a5395e84b 100644
--- a/oox/source/drawingml/shape.cxx
+++ b/oox/source/drawingml/shape.cxx
@@ -833,13 +833,13 @@ Reference< XShape > Shape::createAndInsert(
{
PROP_TopBorder, PROP_LeftBorder, PROP_BottomBorder, PROP_RightBorder
};
- for (unsigned int i = 0; i < SAL_N_ELEMENTS(aBorders); ++i)
+ for (sal_Int32 nBorder : aBorders)
{
- css::table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(aBorders[i])).get<css::table::BorderLine2>();
+ css::table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(nBorder)).get<css::table::BorderLine2>();
aBorderLine.Color = aShapeProps.getProperty(PROP_LineColor).get<sal_Int32>();
if (aLineProperties.moLineWidth.has())
aBorderLine.LineWidth = convertEmuToHmm(aLineProperties.moLineWidth.get());
- aShapeProps.setProperty(aBorders[i], uno::makeAny(aBorderLine));
+ aShapeProps.setProperty(nBorder, uno::makeAny(aBorderLine));
}
aShapeProps.erase(PROP_LineColor);
}
diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx
index b14ad338372d..e389fc6db416 100644
--- a/oox/source/export/shapes.cxx
+++ b/oox/source/export/shapes.cxx
@@ -237,18 +237,18 @@ static uno::Reference<io::XInputStream> lcl_StoreOwnAsOOXML(
const char * pFilterName(nullptr);
SvGlobalName const classId(xObj->getClassID());
- for (size_t i = 0; i < SAL_N_ELEMENTS(s_Mapping); ++i)
+ for (auto & i : s_Mapping)
{
- auto const& rId(s_Mapping[i].ClassId);
+ auto const& rId(i.ClassId);
SvGlobalName const temp(rId.n1, rId.n2, rId.n3, rId.b8, rId.b9, rId.b10, rId.b11, rId.b12, rId.b13, rId.b14, rId.b15);
if (temp == classId)
{
assert(SvGlobalName(SO3_SCH_CLASSID_60) != classId); // chart should be written elsewhere!
assert(SvGlobalName(SO3_SM_CLASSID_60) != classId); // formula should be written elsewhere!
- pFilterName = s_Mapping[i].pFilterName;
- o_rMediaType = OUString::createFromAscii(s_Mapping[i].pMediaType);
- o_rpProgID = s_Mapping[i].pProgID;
- o_rSuffix = OUString::createFromAscii(s_Mapping[i].pSuffix);
+ pFilterName = i.pFilterName;
+ o_rMediaType = OUString::createFromAscii(i.pMediaType);
+ o_rpProgID = i.pProgID;
+ o_rSuffix = OUString::createFromAscii(i.pSuffix);
o_rRelationType = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/package";
break;
}
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index 34527f06a4fc..b58248f7e810 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -504,13 +504,13 @@ void ShapeBase::convertShapeProperties( const Reference< XShape >& rxShape ) con
static const sal_Int32 aBorders[] = {
PROP_TopBorder, PROP_LeftBorder, PROP_BottomBorder, PROP_RightBorder
};
- for (unsigned int i = 0; i < SAL_N_ELEMENTS(aBorders); ++i)
+ for (sal_Int32 nBorder : aBorders)
{
- table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(aBorders[i])).get<table::BorderLine2>();
+ table::BorderLine2 aBorderLine = xPropertySet->getPropertyValue(PropertyMap::getPropertyName(nBorder)).get<table::BorderLine2>();
aBorderLine.Color = aPropMap.getProperty(PROP_LineColor).get<sal_Int32>();
if (oLineWidth)
aBorderLine.LineWidth = *oLineWidth;
- aPropMap.setProperty(aBorders[i], uno::makeAny(aBorderLine));
+ aPropMap.setProperty(nBorder, uno::makeAny(aBorderLine));
}
aPropMap.erase(PROP_LineColor);
}