diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 09:52:20 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-30 19:22:33 +0200 |
commit | 3c1085fcdd8814180507d8ea1aa6e75d4f94f14f (patch) | |
tree | 7b4ec56497648b58bdd3a816a96365d13edb98e9 /oox/source/drawingml/chart | |
parent | d53340b2253537104abe6f95c8c63cc74487c3ec (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/drawingml/chart')
-rw-r--r-- | oox/source/drawingml/chart/axisconverter.cxx | 2 | ||||
-rw-r--r-- | oox/source/drawingml/chart/seriesconverter.cxx | 8 | ||||
-rw-r--r-- | oox/source/drawingml/chart/typegroupconverter.cxx | 5 |
3 files changed, 7 insertions, 8 deletions
diff --git a/oox/source/drawingml/chart/axisconverter.cxx b/oox/source/drawingml/chart/axisconverter.cxx index 4620f5b5a15c..a8ccc6cdf164 100644 --- a/oox/source/drawingml/chart/axisconverter.cxx +++ b/oox/source/drawingml/chart/axisconverter.cxx @@ -315,7 +315,7 @@ void AxisConverter::convertFromModel(const Reference<XCoordinateSystem>& rxCoord // minor increment Sequence< SubIncrement >& rSubIncrementSeq = rIncrementData.SubIncrements; rSubIncrementSeq.realloc( 1 ); - Any& rIntervalCount = rSubIncrementSeq[ 0 ].IntervalCount; + Any& rIntervalCount = rSubIncrementSeq.getArray()[ 0 ].IntervalCount; rIntervalCount.clear(); if( bLogScale ) { diff --git a/oox/source/drawingml/chart/seriesconverter.cxx b/oox/source/drawingml/chart/seriesconverter.cxx index 324f3817d6f1..d4fa267da536 100644 --- a/oox/source/drawingml/chart/seriesconverter.cxx +++ b/oox/source/drawingml/chart/seriesconverter.cxx @@ -309,7 +309,6 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat if( bCustomLabelField ) { css::uno::Reference< XComponentContext > xContext = getComponentContext(); - uno::Sequence< css::uno::Reference< XDataPointCustomLabelField > > aSequence; auto& rParagraphs = mrModel.mxText->mxTextBody->getParagraphs(); @@ -336,7 +335,8 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat } } - aSequence.realloc( nSequenceSize ); + uno::Sequence< css::uno::Reference< XDataPointCustomLabelField > > aSequence( nSequenceSize ); + auto aSequenceRange = asNonConstRange(aSequence); int nPos = 0; @@ -373,7 +373,7 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat xCustomLabel->setString( pRun->getText() ); xCustomLabel->setFieldType( DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_TEXT ); } - aSequence[ nPos++ ] = xCustomLabel; + aSequenceRange[ nPos++ ] = xCustomLabel; } if( nParagraphs > 1 && nPos < nSequenceSize ) @@ -381,7 +381,7 @@ void DataLabelConverter::convertFromModel( const Reference< XDataSeries >& rxDat css::uno::Reference< XDataPointCustomLabelField > xCustomLabel = DataPointCustomLabelField::create( xContext ); xCustomLabel->setFieldType( DataPointCustomLabelFieldType::DataPointCustomLabelFieldType_NEWLINE ); xCustomLabel->setString("\n"); - aSequence[ nPos++ ] = xCustomLabel; + aSequenceRange[ nPos++ ] = xCustomLabel; } } diff --git a/oox/source/drawingml/chart/typegroupconverter.cxx b/oox/source/drawingml/chart/typegroupconverter.cxx index 9a0b9342ac56..36c035efcc60 100644 --- a/oox/source/drawingml/chart/typegroupconverter.cxx +++ b/oox/source/drawingml/chart/typegroupconverter.cxx @@ -328,10 +328,9 @@ void TypeGroupConverter::convertFromModel( const Reference< XDiagram >& rxDiagra { case TYPECATEGORY_BAR: { - Sequence< sal_Int32 > aInt32Seq( 2 ); - aInt32Seq[ 0 ] = aInt32Seq[ 1 ] = mrModel.mnOverlap; + Sequence< sal_Int32 > aInt32Seq{ mrModel.mnOverlap, mrModel.mnOverlap }; aTypeProp.setProperty( PROP_OverlapSequence, aInt32Seq ); - aInt32Seq[ 0 ] = aInt32Seq[ 1 ] = mrModel.mnGapWidth; + aInt32Seq = { mrModel.mnGapWidth, mrModel.mnGapWidth }; aTypeProp.setProperty( PROP_GapwidthSequence, aInt32Seq ); } break; |