summaryrefslogtreecommitdiff
path: root/oox/source/vml
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-10-29 09:52:20 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2021-10-30 19:22:33 +0200
commit3c1085fcdd8814180507d8ea1aa6e75d4f94f14f (patch)
tree7b4ec56497648b58bdd3a816a96365d13edb98e9 /oox/source/vml
parentd53340b2253537104abe6f95c8c63cc74487c3ec (diff)
Prepare for removal of non-const operator[] from Sequence in oox
Change-Id: Iee1e16c516547e8f23631b33c928ac6637050f68 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124376 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'oox/source/vml')
-rw-r--r--oox/source/vml/vmlformatting.cxx2
-rw-r--r--oox/source/vml/vmlinputstream.cxx6
-rw-r--r--oox/source/vml/vmlshape.cxx41
3 files changed, 24 insertions, 25 deletions
diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx
index 72c967d103c4..c7ff6796db21 100644
--- a/oox/source/vml/vmlformatting.cxx
+++ b/oox/source/vml/vmlformatting.cxx
@@ -939,7 +939,7 @@ void TextpathModel::pushToPropMap(ShapePropertyMap& rPropMap, const uno::Referen
{
sal_Int32 nSize = aGeomPropSeq.getLength();
aGeomPropSeq.realloc(nSize+1);
- aGeomPropSeq[nSize] = lcl_createTextpathProps();
+ aGeomPropSeq.getArray()[nSize] = lcl_createTextpathProps();
}
rPropMap.setAnyProperty(PROP_CustomShapeGeometry, uno::makeAny(aGeomPropSeq));
}
diff --git a/oox/source/vml/vmlinputstream.cxx b/oox/source/vml/vmlinputstream.cxx
index cdb8b9724ec6..93204ac50710 100644
--- a/oox/source/vml/vmlinputstream.cxx
+++ b/oox/source/vml/vmlinputstream.cxx
@@ -269,14 +269,12 @@ constexpr OStringLiteral gaClosingCData( "]]>" );
InputStream::InputStream( const Reference< XComponentContext >& rxContext, const Reference< XInputStream >& rxInStrm ) :
// use single-byte ISO-8859-1 encoding which maps all byte characters to the first 256 Unicode characters
mxTextStrm( TextInputStream::createXTextInputStream( rxContext, rxInStrm, RTL_TEXTENCODING_ISO_8859_1 ) ),
- maOpeningBracket( 1 ),
- maClosingBracket( 1 ),
+ maOpeningBracket{ '<' },
+ maClosingBracket{ '>' },
mnBufferPos( 0 )
{
if (!mxTextStrm.is())
throw IOException();
- maOpeningBracket[ 0 ] = '<';
- maClosingBracket[ 0 ] = '>';
}
InputStream::~InputStream()
diff --git a/oox/source/vml/vmlshape.cxx b/oox/source/vml/vmlshape.cxx
index f197bd009af6..81abe64e5322 100644
--- a/oox/source/vml/vmlshape.cxx
+++ b/oox/source/vml/vmlshape.cxx
@@ -432,29 +432,32 @@ Reference< XShape > ShapeBase::convertAndInsert( const Reference< XShapes >& rxS
length = aGrabBag.getLength();
aGrabBag.realloc( length+1 );
- aGrabBag[length].Name = "VML-Z-ORDER";
- aGrabBag[length].Value <<= maTypeModel.maZIndex.toInt32();
+ auto pGrabBag = aGrabBag.getArray();
+ pGrabBag[length].Name = "VML-Z-ORDER";
+ pGrabBag[length].Value <<= maTypeModel.maZIndex.toInt32();
if( !s_mso_next_textbox.isEmpty() )
{
length = aGrabBag.getLength();
aGrabBag.realloc( length+1 );
- aGrabBag[length].Name = "mso-next-textbox";
- aGrabBag[length].Value <<= s_mso_next_textbox;
+ pGrabBag = aGrabBag.getArray();
+ pGrabBag[length].Name = "mso-next-textbox";
+ pGrabBag[length].Value <<= s_mso_next_textbox;
}
if( !sLinkChainName.isEmpty() )
{
length = aGrabBag.getLength();
aGrabBag.realloc( length+4 );
- aGrabBag[length].Name = "TxbxHasLink";
- aGrabBag[length].Value <<= true;
- aGrabBag[length+1].Name = "Txbx-Id";
- aGrabBag[length+1].Value <<= id;
- aGrabBag[length+2].Name = "Txbx-Seq";
- aGrabBag[length+2].Value <<= seq;
- aGrabBag[length+3].Name = "LinkChainName";
- aGrabBag[length+3].Value <<= sLinkChainName;
+ pGrabBag = aGrabBag.getArray();
+ pGrabBag[length].Name = "TxbxHasLink";
+ pGrabBag[length].Value <<= true;
+ pGrabBag[length+1].Name = "Txbx-Id";
+ pGrabBag[length+1].Value <<= id;
+ pGrabBag[length+2].Name = "Txbx-Seq";
+ pGrabBag[length+2].Value <<= seq;
+ pGrabBag[length+3].Name = "LinkChainName";
+ pGrabBag[length+3].Value <<= sLinkChainName;
}
propertySet->setPropertyValue( "InteropGrabBag", uno::makeAny(aGrabBag) );
}
@@ -1057,8 +1060,7 @@ Reference< XShape > PolyLineShape::implConvertAndInsert( const Reference< XShape
if (!aAbsPoints.empty())
{
- PointSequenceSequence aPointSeq( 1 );
- aPointSeq[ 0 ] = comphelper::containerToSequence( aAbsPoints );
+ PointSequenceSequence aPointSeq{ comphelper::containerToSequence( aAbsPoints ) };
PropertySet aPropSet( xShape );
aPropSet.setProperty( PROP_PolyPolygon, aPointSeq );
}
@@ -1225,12 +1227,14 @@ Reference< XShape > BezierShape::implConvertAndInsert( const Reference< XShapes
}
aBezierCoords.Coordinates.realloc( aCoordLists.size() );
+ auto pCoordinates = aBezierCoords.Coordinates.getArray();
for ( size_t i = 0; i < aCoordLists.size(); i++ )
- aBezierCoords.Coordinates[i] = comphelper::containerToSequence( aCoordLists[i] );
+ pCoordinates[i] = comphelper::containerToSequence( aCoordLists[i] );
aBezierCoords.Flags.realloc( aFlagLists.size() );
+ auto pFlags = aBezierCoords.Flags.getArray();
for ( size_t i = 0; i < aFlagLists.size(); i++ )
- aBezierCoords.Flags[i] = comphelper::containerToSequence( aFlagLists[i] );
+ pFlags[i] = comphelper::containerToSequence( aFlagLists[i] );
if( !aCoordLists.front().empty() && !aCoordLists.back().empty()
&& aCoordLists.front().front().X == aCoordLists.back().back().X
@@ -1545,12 +1549,9 @@ Reference< XShape > GroupShape::implConvertAndInsert( const Reference< XShapes >
{
uno::Sequence<beans::PropertyValue> aGrabBag;
xPropertySet->getPropertyValue("InteropGrabBag") >>= aGrabBag;
- beans::PropertyValue aPair;
- aPair.Name = "mso-edit-as";
- aPair.Value <<= maTypeModel.maEditAs;
sal_Int32 nLength = aGrabBag.getLength();
aGrabBag.realloc(nLength + 1);
- aGrabBag[nLength] = aPair;
+ aGrabBag.getArray()[nLength] = comphelper::makePropertyValue("mso-edit-as", maTypeModel.maEditAs);
xPropertySet->setPropertyValue("InteropGrabBag", uno::makeAny(aGrabBag));
}
// Make sure group shapes are inline as well, unless there is an explicit different style.