diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2024-01-27 15:42:54 +0600 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2024-01-27 12:43:48 +0100 |
commit | 0fa827dbb2147d1d3850b2181eb6ab6a02a04500 (patch) | |
tree | 721d02c64c26365e605a2348fd1ff744c4dd8d29 /oox/source | |
parent | db227dc7d032d642983c313ab74c34a301464c2a (diff) |
Drop std::as_const from css::uno::Sequence iterations
Obsoleted by commit 2484de6728bd11bb7949003d112f1ece2223c7a1 (Remove
non-const Sequence::begin()/end() in internal code, 2021-10-15) and
commit fb3c04bd1930eedacd406874e1a285d62bbf27d9 (Drop non-const
Sequence::operator[] in internal code, 2021-11-05).
Change-Id: Idbafef5d34c0d4771cbbf75b9db9712e504164cd
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/162640
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'oox/source')
-rw-r--r-- | oox/source/core/filterbase.cxx | 2 | ||||
-rw-r--r-- | oox/source/core/xmlfilterbase.cxx | 2 | ||||
-rw-r--r-- | oox/source/crypto/DocumentEncryption.cxx | 2 | ||||
-rw-r--r-- | oox/source/docprop/ooxmldocpropimport.cxx | 4 | ||||
-rw-r--r-- | oox/source/export/chartexport.cxx | 4 | ||||
-rw-r--r-- | oox/source/export/drawingml.cxx | 56 | ||||
-rw-r--r-- | oox/source/export/shapes.cxx | 12 | ||||
-rw-r--r-- | oox/source/helper/propertymap.cxx | 4 |
8 files changed, 43 insertions, 43 deletions
diff --git a/oox/source/core/filterbase.cxx b/oox/source/core/filterbase.cxx index ac2c1f5c7e0a..3f47283d0825 100644 --- a/oox/source/core/filterbase.cxx +++ b/oox/source/core/filterbase.cxx @@ -425,7 +425,7 @@ void SAL_CALL FilterBase::initialize( const Sequence< Any >& rArgs ) Sequence<css::beans::PropertyValue> aSeq; rArgs[0] >>= aSeq; - for (const auto& rVal : std::as_const(aSeq)) + for (const auto& rVal : aSeq) { if (rVal.Name == "UserData") { diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx index 2c0cfa9732eb..2e7ce9a75cbc 100644 --- a/oox/source/core/xmlfilterbase.cxx +++ b/oox/source/core/xmlfilterbase.cxx @@ -1152,7 +1152,7 @@ void XmlFilterBase::exportCustomFragments() uno::Sequence<beans::PropertyValue> propList; xPropSet->getPropertyValue(UNO_NAME_MISC_OBJ_INTEROPGRABBAG) >>= propList; - for (const auto& rProp : std::as_const(propList)) + for (const auto& rProp : propList) { const OUString propName = rProp.Name; if (propName == "OOXCustomXml") diff --git a/oox/source/crypto/DocumentEncryption.cxx b/oox/source/crypto/DocumentEncryption.cxx index 6b88549299a1..dd0b4a3e42fb 100644 --- a/oox/source/crypto/DocumentEncryption.cxx +++ b/oox/source/crypto/DocumentEncryption.cxx @@ -82,7 +82,7 @@ bool DocumentEncryption::encrypt() Sequence<NamedValue> aStreams = mxPackageEncryption->encrypt(xInputStream); - for (const NamedValue & aStream : std::as_const(aStreams)) + for (const NamedValue& aStream : aStreams) { Reference<XOutputStream> xOutputStream(mrOleStorage.openOutputStream(aStream.Name), UNO_SET_THROW); BinaryXOutputStream aBinaryOutputStream(xOutputStream, true); diff --git a/oox/source/docprop/ooxmldocpropimport.cxx b/oox/source/docprop/ooxmldocpropimport.cxx index f58476c5688f..23e754d6bbcf 100644 --- a/oox/source/docprop/ooxmldocpropimport.cxx +++ b/oox/source/docprop/ooxmldocpropimport.cxx @@ -176,9 +176,9 @@ void SAL_CALL DocumentPropertiesImport::importProperties( if( aCoreStreams.hasElements() ) aParser.parseStream( aCoreStreams[ 0 ], true ); - for( const auto& rExtStream : std::as_const(aExtStreams) ) + for (const auto& rExtStream : aExtStreams) aParser.parseStream( rExtStream, true ); - for( const auto& rCustomStream : std::as_const(aCustomStreams) ) + for (const auto& rCustomStream : aCustomStreams) aParser.parseStream( rCustomStream, true ); } diff --git a/oox/source/export/chartexport.cxx b/oox/source/export/chartexport.cxx index c80e8c1ba688..e980a4f18f35 100644 --- a/oox/source/export/chartexport.cxx +++ b/oox/source/export/chartexport.cxx @@ -1348,7 +1348,7 @@ void ChartExport::exportLegend( const Reference< css::chart::XChartDocument >& x { Sequence<sal_Int32> deletedLegendEntriesSeq; aSeriesProp.getProperty(deletedLegendEntriesSeq, PROP_DeletedLegendEntries); - for (const auto& deletedLegendEntry : std::as_const(deletedLegendEntriesSeq)) + for (const auto& deletedLegendEntry : deletedLegendEntriesSeq) { pFS->startElement(FSNS(XML_c, XML_legendEntry)); pFS->singleElement(FSNS(XML_c, XML_idx), XML_val, @@ -3960,7 +3960,7 @@ void ChartExport::exportDataLabels( ; } - for (const sal_Int32 nIdx : std::as_const(aAttrLabelIndices)) + for (const sal_Int32 nIdx : aAttrLabelIndices) { uno::Reference<beans::XPropertySet> xLabelPropSet = xSeries->getDataPointByIndex(nIdx); diff --git a/oox/source/export/drawingml.cxx b/oox/source/export/drawingml.cxx index a3e5356c0523..9cd97d0b5f3e 100644 --- a/oox/source/export/drawingml.cxx +++ b/oox/source/export/drawingml.cxx @@ -449,7 +449,7 @@ void DrawingML::WriteSolidFill( const Reference< XPropertySet >& rXPropSet ) { Sequence< PropertyValue > aGrabBag; mAny >>= aGrabBag; - for( const auto& rProp : std::as_const(aGrabBag) ) + for (const auto& rProp : aGrabBag) { if( rProp.Name == "SpPrSolidFillSchemeClr" ) rProp.Value >>= sColorFillScheme; @@ -615,7 +615,7 @@ void DrawingML::WriteGradientFill( const Reference< XPropertySet >& rXPropSet ) { Sequence< PropertyValue > aGrabBag; mAny >>= aGrabBag; - for( const auto& rProp : std::as_const(aGrabBag) ) + for (const auto& rProp : aGrabBag) if( rProp.Name == "GradFillDefinition" ) rProp.Value >>= aGradientStops; else if( rProp.Name == "OriginalGradFill" ) @@ -696,7 +696,7 @@ void DrawingML::WriteGrabBagGradientFill( const Sequence< PropertyValue >& aGrad sal_Int16 nTransparency = 0; ::Color nRgbClr; Sequence< PropertyValue > aTransformations; - for( const auto& rProp : std::as_const(aGradientStop) ) + for (const auto& rProp : aGradientStop) { if( rProp.Name == "SchemeClr" ) rProp.Value >>= sSchemeClr; @@ -972,7 +972,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc Sequence<PropertyValue> aGrabBag; mAny >>= aGrabBag; - for (const auto& rProp : std::as_const(aGrabBag)) + for (const auto& rProp : aGrabBag) { if( rProp.Name == "SpPrLnSolidFillSchemeClr" ) rProp.Value >>= sColorFillScheme; @@ -987,7 +987,7 @@ void DrawingML::WriteOutline( const Reference<XPropertySet>& rXPropSet, Referenc else if( rProp.Name == "EmuLineWidth" ) rProp.Value >>= nEmuLineWidth; } - for (const auto& rStyleProp : std::as_const(aStyleProperties)) + for (const auto& rStyleProp : aStyleProperties) { if( rStyleProp.Name == "Color" ) rStyleProp.Value >>= nStyleColor; @@ -3166,7 +3166,7 @@ void DrawingML::WriteParagraphNumbering(const Reference< XPropertySet >& rXPropS bool bHasBulletColor = false; awt::Size aGraphicSize; - for ( const PropertyValue& rPropValue : std::as_const(aPropertySequence) ) + for (const PropertyValue& rPropValue : aPropertySequence) { OUString aPropName( rPropValue.Name ); SAL_INFO("oox.shape", "pro name: " << aPropName); @@ -3320,7 +3320,7 @@ void DrawingML::WriteParagraphTabStops(const Reference<XPropertySet>& rXPropSet) if (aTabStops.getLength() > 0) mpFS->startElementNS(XML_a, XML_tabLst); - for (const css::style::TabStop& rTabStop : std::as_const(aTabStops)) + for (const css::style::TabStop& rTabStop : aTabStops) { OString sPosition = OString::number(GetPointFromCoordinate(rTabStop.Position)); OString sAlignment; @@ -3374,7 +3374,7 @@ sal_Int32 DrawingML::getBulletMarginIndentation (const Reference< XPropertySet > if (!aPropertySequence.hasElements()) return 0; - for ( const PropertyValue& rPropValue : std::as_const(aPropertySequence) ) + for (const PropertyValue& rPropValue : aPropertySequence) { OUString aPropName( rPropValue.Name ); SAL_INFO("oox.shape", "pro name: " << aPropName); @@ -3677,12 +3677,12 @@ bool DrawingML::IsFontworkShape(const css::uno::Reference<css::beans::XPropertyS { mAny >>= aCustomShapeGeometryProps; uno::Sequence<beans::PropertyValue> aTextPathSeq; - for (const auto& rProp : std::as_const(aCustomShapeGeometryProps)) + for (const auto& rProp : aCustomShapeGeometryProps) { if (rProp.Name == "TextPath") { rProp.Value >>= aTextPathSeq; - for (const auto& rTextPathItem : std::as_const(aTextPathSeq)) + for (const auto& rTextPathItem : aTextPathSeq) { if (rTextPathItem.Name == "TextPath") { @@ -3791,7 +3791,7 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo Sequence< PropertyValue > aProps; if ( mAny >>= aProps ) { - for ( const auto& rProp : std::as_const(aProps) ) + for (const auto& rProp : aProps) { if (rProp.Name == "TextPreRotateAngle") rProp.Value >>= nTextPreRotateAngle; @@ -3808,7 +3808,7 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo else if (rProp.Name == "TextPath") { rProp.Value >>= aTextPathSeq; - for (const auto& rTextPathItem : std::as_const(aTextPathSeq)) + for (const auto& rTextPathItem : aTextPathSeq) { if (rTextPathItem.Name == "ScaleX") rTextPathItem.Value >>= bScaleX; @@ -3865,7 +3865,7 @@ void DrawingML::WriteText(const Reference<XInterface>& rXIface, bool bBodyPr, bo { uno::Sequence<beans::PropertyValue> aGrabBag; rXPropSet->getPropertyValue("InteropGrabBag") >>= aGrabBag; - for (const auto& aProp : std::as_const(aGrabBag)) + for (const auto& aProp : aGrabBag) { if (aProp.Name == "Upright") { @@ -4665,7 +4665,7 @@ bool DrawingML::WriteCustomGeometry( uno::Sequence<awt::Size> aPathSize; bool bReplaceGeoWidth = false; bool bReplaceGeoHeight = false; - for (const beans::PropertyValue& rPathProp : std::as_const(aPathProp)) + for (const beans::PropertyValue& rPathProp : aPathProp) { if (rPathProp.Name == "Coordinates") rPathProp.Value >>= aPairs; @@ -4777,7 +4777,7 @@ bool DrawingML::WriteCustomGeometry( aPairs[0].Second.Value >>= nYMin; sal_Int32 nYMax = nYMin; - for (const auto& rPair : std::as_const(aPairs)) + for (const auto& rPair : aPairs) { sal_Int32 nX = GetCustomGeometryPointValue(rPair.First, aCustomShape2d, bReplaceGeoWidth, false); @@ -5497,7 +5497,7 @@ void DrawingML::WriteShapeStyle( const Reference< XPropertySet >& xPropSet ) Sequence< PropertyValue > aGrabBag; Sequence< PropertyValue > aFillRefProperties, aLnRefProperties, aEffectRefProperties; mAny >>= aGrabBag; - for( const auto& rProp : std::as_const(aGrabBag)) + for (const auto& rProp : aGrabBag) { if( rProp.Name == "StyleFillRef" ) rProp.Value >>= aFillRefProperties; @@ -5557,7 +5557,7 @@ void DrawingML::WriteShapeEffect( std::u16string_view sName, const Sequence< Pro // read tag attributes uno::Sequence< beans::PropertyValue > aOuterShdwProps; rEffectProp.Value >>= aOuterShdwProps; - for( const auto& rOuterShdwProp : std::as_const(aOuterShdwProps) ) + for (const auto& rOuterShdwProp : aOuterShdwProps) { if( rOuterShdwProp.Name == "algn" ) { @@ -5822,7 +5822,7 @@ void DrawingML::WriteShapeEffects( const Reference< XPropertySet >& rXPropSet ) mpFS->startElementNS(XML_a, XML_effectLst); bool bGlowWritten = false; - for( const auto& rEffect : std::as_const(aEffects) ) + for (const auto& rEffect : aEffects) { if (!bGlowWritten && (rEffect.Name == "innerShdw" || rEffect.Name == "outerShdw" @@ -5913,7 +5913,7 @@ void DrawingML::Write3DEffects( const Reference< XPropertySet >& xPropSet, bool { Sequence< PropertyValue > a3DEffectProps; pShapeProp->Value >>= a3DEffectProps; - for( const auto& r3DEffectProp : std::as_const(a3DEffectProps) ) + for (const auto& r3DEffectProp : a3DEffectProps) { if( r3DEffectProp.Name == "Camera" ) r3DEffectProp.Value >>= aEffectProps; @@ -5930,7 +5930,7 @@ void DrawingML::Write3DEffects( const Reference< XPropertySet >& xPropSet, bool bool bCameraRotationPresent = false; rtl::Reference<sax_fastparser::FastAttributeList> aCameraAttrList = FastSerializerHelper::createAttrList(); rtl::Reference<sax_fastparser::FastAttributeList> aCameraRotationAttrList = FastSerializerHelper::createAttrList(); - for( const auto& rEffectProp : std::as_const(aEffectProps) ) + for (const auto& rEffectProp : aEffectProps) { if( rEffectProp.Name == "prst" ) { @@ -5970,7 +5970,7 @@ void DrawingML::Write3DEffects( const Reference< XPropertySet >& xPropSet, bool bool bLightRigRotationPresent = false; rtl::Reference<sax_fastparser::FastAttributeList> aLightRigAttrList = FastSerializerHelper::createAttrList(); rtl::Reference<sax_fastparser::FastAttributeList> aLightRigRotationAttrList = FastSerializerHelper::createAttrList(); - for( const auto& rLightRigProp : std::as_const(aLightRigProps) ) + for (const auto& rLightRigProp : aLightRigProps) { if( rLightRigProp.Name == "rig" || rLightRigProp.Name == "dir" ) { @@ -6042,7 +6042,7 @@ void DrawingML::Write3DEffects( const Reference< XPropertySet >& xPropSet, bool rtl::Reference<sax_fastparser::FastAttributeList> aBevelTAttrList = FastSerializerHelper::createAttrList(); rtl::Reference<sax_fastparser::FastAttributeList> aBevelBAttrList = FastSerializerHelper::createAttrList(); rtl::Reference<sax_fastparser::FastAttributeList> aShape3DAttrList = FastSerializerHelper::createAttrList(); - for( const auto& rShape3DProp : std::as_const(aShape3DProps) ) + for (const auto& rShape3DProp : aShape3DProps) { if( rShape3DProp.Name == "extrusionH" || rShape3DProp.Name == "contourW" || rShape3DProp.Name == "z" ) { @@ -6088,7 +6088,7 @@ void DrawingML::Write3DEffects( const Reference< XPropertySet >& xPropSet, bool bBevelBPresent = true; aBevelAttrList = aBevelBAttrList; } - for( const auto& rBevelProp : std::as_const(aBevelProps) ) + for (const auto& rBevelProp : aBevelProps) { if( rBevelProp.Name == "w" || rBevelProp.Name == "h" ) { @@ -6126,7 +6126,7 @@ void DrawingML::Write3DEffects( const Reference< XPropertySet >& xPropSet, bool ::Color nColor; sal_Int32 nTransparency(0); Sequence< PropertyValue > aColorTransformations; - for( const auto& rExtrusionColorProp : std::as_const(aExtrusionColorProps) ) + for (const auto& rExtrusionColorProp : aExtrusionColorProps) { if( rExtrusionColorProp.Name == "schemeClr" ) rExtrusionColorProp.Value >>= sSchemeClr; @@ -6152,7 +6152,7 @@ void DrawingML::Write3DEffects( const Reference< XPropertySet >& xPropSet, bool ::Color nColor; sal_Int32 nTransparency(0); Sequence< PropertyValue > aColorTransformations; - for( const auto& rContourColorProp : std::as_const(aContourColorProps) ) + for (const auto& rContourColorProp : aContourColorProps) { if( rContourColorProp.Name == "schemeClr" ) rContourColorProp.Value >>= sSchemeClr; @@ -6195,7 +6195,7 @@ void DrawingML::WriteArtisticEffect( const Reference< XPropertySet >& rXPropSet aEffect.Value >>= aAttrs; rtl::Reference<sax_fastparser::FastAttributeList> aAttrList = FastSerializerHelper::createAttrList(); OString sRelId; - for( const auto& rAttr : std::as_const(aAttrs) ) + for (const auto& rAttr : aAttrs) { sal_Int32 nToken = ArtisticEffectProperties::getEffectToken( rAttr.Name ); if( nToken != XML_none ) @@ -6210,7 +6210,7 @@ void DrawingML::WriteArtisticEffect( const Reference< XPropertySet >& rXPropSet rAttr.Value >>= aGraphic; Sequence< sal_Int8 > aGraphicData; OUString sGraphicId; - for( const auto& rProp : std::as_const(aGraphic) ) + for (const auto& rProp : aGraphic) { if( rProp.Name == "Id" ) rProp.Value >>= sGraphicId; @@ -6276,7 +6276,7 @@ void DrawingML::WriteDiagram(const css::uno::Reference<css::drawing::XShape>& rX // retrieve the doms from the GrabBag uno::Sequence<beans::PropertyValue> propList; xPropSet->getPropertyValue(UNO_NAME_MISC_OBJ_INTEROPGRABBAG) >>= propList; - for (const auto& rProp : std::as_const(propList)) + for (const auto& rProp : propList) { OUString propName = rProp.Name; if (propName == "OOXData") diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index c0c08c7ccf28..8c003bcdb438 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -778,7 +778,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) { bHasGeometrySeq = true; SAL_INFO("oox.shape", "got custom shape geometry sequence"); - for (const PropertyValue& rProp : std::as_const(aGeometrySeq)) + for (const PropertyValue& rProp : aGeometrySeq) { SAL_INFO("oox.shape", "geometry property: " << rProp.Name); if (rProp.Name == "Type") @@ -1156,7 +1156,7 @@ ShapeExport& ShapeExport::WriteCustomShape( const Reference< XShape >& xShape ) uno::Sequence<beans::PropertyValue> grabBag; rXPropSet->getPropertyValue("InteropGrabBag") >>= grabBag; - for (auto const& it : std::as_const(grabBag)) + for (auto const& it : grabBag) if (it.Name == "3DEffectProperties") bHas3DEffectinShape = true; @@ -2385,7 +2385,7 @@ void ShapeExport::WriteTableCellProperties(const Reference< XPropertySet>& xCell if( !aTextVerticalValue && (xCellPropSet->getPropertyValue("CellInteropGrabBag") >>= aGrabBag) ) { - for (auto const& rIt : std::as_const(aGrabBag)) + for (auto const& rIt : aGrabBag) { if (rIt.Name == "mso-tcPr-vert-value") { @@ -2697,19 +2697,19 @@ ShapeExport& ShapeExport::WriteOLE2Shape( const Reference< XShape >& xShape ) OUString progID; - for (auto const& it : std::as_const(grabBag)) + for (auto const& it : grabBag) { if (it.Name == "EmbeddedObjects") { uno::Sequence<beans::PropertyValue> objects; it.Value >>= objects; - for (auto const& object : std::as_const(objects)) + for (auto const& object : objects) { if (object.Name == entryName) { uno::Sequence<beans::PropertyValue> props; object.Value >>= props; - for (auto const& prop : std::as_const(props)) + for (auto const& prop : props) { if (prop.Name == "ProgID") { diff --git a/oox/source/helper/propertymap.cxx b/oox/source/helper/propertymap.cxx index 9b2bd48e5715..d5a89e6f2388 100644 --- a/oox/source/helper/propertymap.cxx +++ b/oox/source/helper/propertymap.cxx @@ -391,7 +391,7 @@ static void lclDumpAnyValue( const Any& value) Sequence< PropertyValue > aBulletPropSeq; fprintf (stderr, "level %d\n", k); if (xNumRule->getByIndex (k) >>= aBulletPropSeq) { - for (const PropertyValue& rProp : std::as_const(aBulletPropSeq)) { + for (const PropertyValue& rProp : aBulletPropSeq) { fprintf(stderr, "%46s = ", USS (rProp.Name)); lclDumpAnyValue (rProp.Value); } @@ -820,7 +820,7 @@ static const char* lclDumpAnyValueCode( const Any& value, int level) Sequence< PropertyValue > aBulletPropSeq; fprintf (stderr, "level %d\n", k); if (xNumRule->getByIndex (k) >>= aBulletPropSeq) { - for (const PropertyValue& rProp : std::as_const(aBulletPropSeq)) { + for (const PropertyValue& rProp : aBulletPropSeq) { fprintf(stderr, "%46s = ", USS (rProp.Name)); lclDumpAnyValue (rProp.Value); } |