writerfilter/source/dmapper/DomainMapperTableHandler.cxx | 48 ++++----------- writerfilter/source/dmapper/DomainMapper_Impl.cxx | 39 ++++++------ writerfilter/source/dmapper/GraphicImport.cxx | 7 -- writerfilter/source/dmapper/NumberingManager.cxx | 17 +++-- writerfilter/source/dmapper/SettingsTable.cxx | 25 ++++--- writerfilter/source/dmapper/StyleSheetTable.cxx | 8 +- writerfilter/source/dmapper/WrapPolygonHandler.cxx | 5 - writerfilter/source/dmapper/WriteProtection.cxx | 15 +--- writerfilter/source/ooxml/OOXMLDocumentImpl.cxx | 9 -- writerfilter/source/ooxml/OOXMLFastContextHandler.cxx | 6 - writerfilter/source/ooxml/factoryimpl.py | 3 writerfilter/source/rtftok/rtfsdrimport.cxx | 5 - 12 files changed, 83 insertions(+), 104 deletions(-)
New commits: commit 2b9bd1031cc4f627f83b62288a57b27e6cb9bc3e Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Oct 29 10:26:30 2021 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Nov 1 06:22:35 2021 +0100 Prepare for removal of non-const operator[] from Sequence in writerfilter Change-Id: I4002bc1ca227726bf1c36ecdb657175a42c2d9be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124413 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx index 5278206552f8..916ff5b5828d 100644 --- a/writerfilter/source/dmapper/DomainMapperTableHandler.cxx +++ b/writerfilter/source/dmapper/DomainMapperTableHandler.cxx @@ -363,37 +363,18 @@ TableStyleSheetEntry * DomainMapperTableHandler::endTableGetTableStyle(TableInfo { TablePositionHandler *pTablePositions = m_rDMapper_Impl.getTableManager().getCurrentTableRealPosition(); - uno::Sequence< beans::PropertyValue > aGrabBagTS( 10 ); - - aGrabBagTS[0].Name = "bottomFromText"; - aGrabBagTS[0].Value <<= pTablePositions->getBottomFromText(); - - aGrabBagTS[1].Name = "horzAnchor"; - aGrabBagTS[1].Value <<= pTablePositions->getHorzAnchor(); - - aGrabBagTS[2].Name = "leftFromText"; - aGrabBagTS[2].Value <<= pTablePositions->getLeftFromText(); - - aGrabBagTS[3].Name = "rightFromText"; - aGrabBagTS[3].Value <<= pTablePositions->getRightFromText(); - - aGrabBagTS[4].Name = "tblpX"; - aGrabBagTS[4].Value <<= pTablePositions->getX(); - - aGrabBagTS[5].Name = "tblpXSpec"; - aGrabBagTS[5].Value <<= pTablePositions->getXSpec(); - - aGrabBagTS[6].Name = "tblpY"; - aGrabBagTS[6].Value <<= pTablePositions->getY(); - - aGrabBagTS[7].Name = "tblpYSpec"; - aGrabBagTS[7].Value <<= pTablePositions->getYSpec(); - - aGrabBagTS[8].Name = "topFromText"; - aGrabBagTS[8].Value <<= pTablePositions->getTopFromText(); - - aGrabBagTS[9].Name = "vertAnchor"; - aGrabBagTS[9].Value <<= pTablePositions->getVertAnchor(); + uno::Sequence< beans::PropertyValue > aGrabBagTS{ + comphelper::makePropertyValue("bottomFromText", pTablePositions->getBottomFromText()), + comphelper::makePropertyValue("horzAnchor", pTablePositions->getHorzAnchor()), + comphelper::makePropertyValue("leftFromText", pTablePositions->getLeftFromText()), + comphelper::makePropertyValue("rightFromText", pTablePositions->getRightFromText()), + comphelper::makePropertyValue("tblpX", pTablePositions->getX()), + comphelper::makePropertyValue("tblpXSpec", pTablePositions->getXSpec()), + comphelper::makePropertyValue("tblpY", pTablePositions->getY()), + comphelper::makePropertyValue("tblpYSpec", pTablePositions->getYSpec()), + comphelper::makePropertyValue("topFromText", pTablePositions->getTopFromText()), + comphelper::makePropertyValue("vertAnchor", pTablePositions->getVertAnchor()) + }; aGrabBag["TablePosition"] <<= aGrabBagTS; } @@ -1066,6 +1047,7 @@ css::uno::Sequence<css::beans::PropertyValues> DomainMapperTableHandler::endTabl #endif css::uno::Sequence<css::beans::PropertyValues> aRowProperties( m_aRowProperties.size() ); + auto aRowPropertiesRange = asNonConstRange(aRowProperties); sal_Int32 nRow = 0; for( const auto& rRow : m_aRowProperties ) { @@ -1086,7 +1068,7 @@ css::uno::Sequence<css::beans::PropertyValues> DomainMapperTableHandler::endTabl rRow->Insert(PROP_SIZE_TYPE, uno::makeAny(text::SizeType::FIX)); } - aRowProperties[nRow] = rRow->GetPropertyValues(); + aRowPropertiesRange[nRow] = rRow->GetPropertyValues(); #ifdef DBG_UTIL rRow->dumpXml(); lcl_DumpPropertyValues(aRowProperties[nRow]); @@ -1477,7 +1459,7 @@ void DomainMapperTableHandler::endTable(unsigned int nestedTableLevel, bool bTab uno::Sequence< uno::Sequence< uno::Reference<text::XTextRange> > >& rLastRow = m_aTableRanges[m_aTableRanges.size() - 1]; if (rLastRow.hasElements()) { - uno::Sequence< uno::Reference<text::XTextRange> >& rLastCell = rLastRow[rLastRow.getLength() - 1]; + const uno::Sequence< uno::Reference<text::XTextRange> >& rLastCell = rLastRow[rLastRow.getLength() - 1]; xEnd = rLastCell[1]; } } diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index ccb0a7dc224a..fd54128f5cc5 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -5216,28 +5216,29 @@ static uno::Sequence< beans::PropertyValues > lcl_createTOXLevelHyperlinks( bool beans::PropertyValues* pNewLevel = aNewLevel.getArray(); if( bHyperlinks ) { - beans::PropertyValues aHyperlink(1); - aHyperlink[0].Name = getPropertyName( PROP_TOKEN_TYPE ); - aHyperlink[0].Value <<= getPropertyName( PROP_TOKEN_HYPERLINK_START ); + beans::PropertyValues aHyperlink{ comphelper::makePropertyValue( + getPropertyName( PROP_TOKEN_TYPE ), getPropertyName( PROP_TOKEN_HYPERLINK_START )) }; pNewLevel[0] = aHyperlink; - aHyperlink[0].Value <<= getPropertyName( PROP_TOKEN_HYPERLINK_END ); + aHyperlink = { comphelper::makePropertyValue( + getPropertyName(PROP_TOKEN_TYPE), getPropertyName( PROP_TOKEN_HYPERLINK_END )) }; pNewLevel[aNewLevel.getLength() -1] = aHyperlink; } if( bChapterNoSeparator ) { - beans::PropertyValues aChapterNo(2); - aChapterNo[0].Name = getPropertyName( PROP_TOKEN_TYPE ); - aChapterNo[0].Value <<= getPropertyName( PROP_TOKEN_CHAPTER_INFO ); - aChapterNo[1].Name = getPropertyName( PROP_CHAPTER_FORMAT ); - //todo: is ChapterFormat::Number correct? - aChapterNo[1].Value <<= sal_Int16(text::ChapterFormat::NUMBER); + beans::PropertyValues aChapterNo{ + comphelper::makePropertyValue(getPropertyName( PROP_TOKEN_TYPE ), + getPropertyName( PROP_TOKEN_CHAPTER_INFO )), + comphelper::makePropertyValue(getPropertyName( PROP_CHAPTER_FORMAT ), + //todo: is ChapterFormat::Number correct? + sal_Int16(text::ChapterFormat::NUMBER)) + }; pNewLevel[aNewLevel.getLength() - (bHyperlinks ? 4 : 2) ] = aChapterNo; - beans::PropertyValues aChapterSeparator(2); - aChapterSeparator[0].Name = getPropertyName( PROP_TOKEN_TYPE ); - aChapterSeparator[0].Value <<= getPropertyName( PROP_TOKEN_TEXT ); - aChapterSeparator[1].Name = getPropertyName( PROP_TEXT ); - aChapterSeparator[1].Value <<= sChapterNoSeparator; + beans::PropertyValues aChapterSeparator{ + comphelper::makePropertyValue(getPropertyName( PROP_TOKEN_TYPE ), + getPropertyName( PROP_TOKEN_TEXT )), + comphelper::makePropertyValue(getPropertyName( PROP_TEXT ), sChapterNoSeparator) + }; pNewLevel[aNewLevel.getLength() - (bHyperlinks ? 3 : 1)] = aChapterSeparator; } //copy the 'old' entries except the last (page no) @@ -5521,9 +5522,9 @@ void DomainMapper_Impl::handleToc TOCStyleMap::iterator aTOCStyleIter = aMap.find( nLevel ); uno::Sequence< OUString> aStyles( nLevelCount ); - for ( sal_Int32 nStyle = 0; nStyle < nLevelCount; ++nStyle, ++aTOCStyleIter ) + for ( auto& rStyle : asNonConstRange(aStyles) ) { - aStyles[nStyle] = aTOCStyleIter->second; + rStyle = (aTOCStyleIter++)->second; } xParaStyles->replaceByIndex(nLevel - 1, uno::makeAny(aStyles)); } @@ -6736,14 +6737,14 @@ void DomainMapper_Impl::SetFieldResult(OUString const& rResult) aValue >>= titleStr; titleStr += rResult; propertyVal.Value <<= titleStr; - aValues[nTitleFoundIndex] = propertyVal; + aValues.getArray()[nTitleFoundIndex] = propertyVal; } else { aValues.realloc(aValues.getLength() + 1); propertyVal.Name = "Title"; propertyVal.Value <<= rResult; - aValues[aValues.getLength() - 1] = propertyVal; + aValues.getArray()[aValues.getLength() - 1] = propertyVal; } xFieldProperties->setPropertyValue("Fields", uno::makeAny(aValues)); diff --git a/writerfilter/source/dmapper/GraphicImport.cxx b/writerfilter/source/dmapper/GraphicImport.cxx index d3ea9bcbe225..b6049e78c61a 100644 --- a/writerfilter/source/dmapper/GraphicImport.cxx +++ b/writerfilter/source/dmapper/GraphicImport.cxx @@ -52,6 +52,7 @@ #include <sal/log.hxx> #include <rtl/math.hxx> #include <tools/diagnose_ex.h> +#include <comphelper/propertyvalue.hxx> #include <comphelper/string.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/sequence.hxx> @@ -1925,11 +1926,9 @@ uno::Reference<text::XTextContent> GraphicImport::createGraphicObject(uno::Refer void GraphicImport::data(const sal_uInt8* buf, size_t len) { - beans::PropertyValues aMediaProperties( 1 ); - aMediaProperties[0].Name = getPropertyName(PROP_INPUT_STREAM); - uno::Reference< io::XInputStream > xIStream = new XInputStreamHelper( buf, len ); - aMediaProperties[0].Value <<= xIStream; + beans::PropertyValues aMediaProperties{ comphelper::makePropertyValue( + getPropertyName(PROP_INPUT_STREAM), xIStream) }; uno::Reference<beans::XPropertySet> xPropertySet; uno::Reference<graphic::XGraphicProvider> xGraphicProvider(graphic::GraphicProvider::create(m_xComponentContext)); diff --git a/writerfilter/source/dmapper/NumberingManager.cxx b/writerfilter/source/dmapper/NumberingManager.cxx index 66c26b18cb57..61dbea4a5563 100644 --- a/writerfilter/source/dmapper/NumberingManager.cxx +++ b/writerfilter/source/dmapper/NumberingManager.cxx @@ -84,13 +84,13 @@ static void lcl_mergeProperties( const uno::Sequence< beans::PropertyValue >& aS if ( nPos >= 0 ) { // Replace the property value by the one in aSrc - aDst[nPos] = rProp; + aDst.getArray()[nPos] = rProp; } else { // Simply add the new value aDst.realloc( aDst.getLength( ) + 1 ); - aDst[ aDst.getLength( ) - 1 ] = rProp; + aDst.getArray()[ aDst.getLength( ) - 1 ] = rProp; } } } @@ -301,14 +301,16 @@ void ListLevel::AddParaProperties( uno::Sequence< beans::PropertyValue >* props if ( !hasFirstLineIndent && rParaProp.Name == sParaIndent ) { aProps.realloc( aProps.getLength() + 1 ); - aProps[aProps.getLength( ) - 1] = rParaProp; - aProps[aProps.getLength( ) - 1].Name = sFirstLineIndent; + auto pProps = aProps.getArray(); + pProps[aProps.getLength( ) - 1] = rParaProp; + pProps[aProps.getLength( ) - 1].Name = sFirstLineIndent; } else if ( !hasIndentAt && rParaProp.Name == sParaLeftMargin ) { aProps.realloc( aProps.getLength() + 1 ); - aProps[aProps.getLength( ) - 1] = rParaProp; - aProps[aProps.getLength( ) - 1].Name = sIndentAt; + auto pProps = aProps.getArray(); + pProps[aProps.getLength( ) - 1] = rParaProp; + pProps[aProps.getLength( ) - 1].Name = sIndentAt; } } @@ -438,6 +440,7 @@ uno::Sequence<uno::Sequence<beans::PropertyValue>> ListDef::GetMergedPropertyVal // [1] Call the same method on the abstract list uno::Sequence<uno::Sequence<beans::PropertyValue>> aAbstract = m_pAbstractDef->GetPropertyValues(/*bDefaults=*/true); + auto aAbstractRange = asNonConstRange(aAbstract); // [2] Call the upper class method uno::Sequence<uno::Sequence<beans::PropertyValue>> aThis @@ -452,7 +455,7 @@ uno::Sequence<uno::Sequence<beans::PropertyValue>> ListDef::GetMergedPropertyVal if (level.hasElements() && GetLevel(i)->HasValues()) { // If the element contains something, merge it, but ignore stub overrides. - lcl_mergeProperties( level, aAbstract[i] ); + lcl_mergeProperties( level, aAbstractRange[i] ); } } diff --git a/writerfilter/source/dmapper/SettingsTable.cxx b/writerfilter/source/dmapper/SettingsTable.cxx index f97d0a00d893..732b96ff96db 100644 --- a/writerfilter/source/dmapper/SettingsTable.cxx +++ b/writerfilter/source/dmapper/SettingsTable.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/style/XStyle.hpp> #include <com/sun/star/style/XStyleFamiliesSupplier.hpp> #include <comphelper/propertysequence.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> #include "ConversionHelper.hxx" #include "DomainMapper.hxx" @@ -172,31 +173,31 @@ void SettingsTable::lcl_attribute(Id nName, Value & val) m_pImpl->m_nZoomType = lcl_GetZoomType(nIntValue); break; case NS_ooxml::LN_CT_Language_val: - m_pImpl->m_pThemeFontLangProps[0].Name = "val"; - m_pImpl->m_pThemeFontLangProps[0].Value <<= sStringValue; + m_pImpl->m_pThemeFontLangProps.getArray()[0] + = comphelper::makePropertyValue("val", sStringValue); break; case NS_ooxml::LN_CT_Language_eastAsia: - m_pImpl->m_pThemeFontLangProps[1].Name = "eastAsia"; - m_pImpl->m_pThemeFontLangProps[1].Value <<= sStringValue; + m_pImpl->m_pThemeFontLangProps.getArray()[1] + = comphelper::makePropertyValue("eastAsia", sStringValue); break; case NS_ooxml::LN_CT_Language_bidi: - m_pImpl->m_pThemeFontLangProps[2].Name = "bidi"; - m_pImpl->m_pThemeFontLangProps[2].Value <<= sStringValue; + m_pImpl->m_pThemeFontLangProps.getArray()[2] + = comphelper::makePropertyValue("bidi", sStringValue); break; case NS_ooxml::LN_CT_View_val: m_pImpl->m_nView = nIntValue; break; case NS_ooxml::LN_CT_CompatSetting_name: - m_pImpl->m_pCurrentCompatSetting[0].Name = "name"; - m_pImpl->m_pCurrentCompatSetting[0].Value <<= sStringValue; + m_pImpl->m_pCurrentCompatSetting.getArray()[0] + = comphelper::makePropertyValue("name", sStringValue); break; case NS_ooxml::LN_CT_CompatSetting_uri: - m_pImpl->m_pCurrentCompatSetting[1].Name = "uri"; - m_pImpl->m_pCurrentCompatSetting[1].Value <<= sStringValue; + m_pImpl->m_pCurrentCompatSetting.getArray()[1] + = comphelper::makePropertyValue("uri", sStringValue); break; case NS_ooxml::LN_CT_CompatSetting_val: - m_pImpl->m_pCurrentCompatSetting[2].Name = "val"; - m_pImpl->m_pCurrentCompatSetting[2].Value <<= sStringValue; + m_pImpl->m_pCurrentCompatSetting.getArray()[2] + = comphelper::makePropertyValue("val", sStringValue); break; case NS_ooxml::LN_CT_TrackChangesView_insDel: m_pImpl->m_bShowInsDelChanges = (nIntValue != 0); diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx index 0074fb948a12..5f45672fe915 100644 --- a/writerfilter/source/dmapper/StyleSheetTable.cxx +++ b/writerfilter/source/dmapper/StyleSheetTable.cxx @@ -42,6 +42,7 @@ #include <osl/diagnose.h> #include <rtl/ustrbuf.hxx> #include <sal/log.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/string.hxx> #include <comphelper/sequence.hxx> #include <tools/diagnose_ex.h> @@ -1066,9 +1067,10 @@ void StyleSheetTable::ApplyStyleSheets( const FontTablePtr& rFontTable ) uno::Reference<container::XIndexAccess> xIndexAccess(xNumberingRules, uno::UNO_QUERY_THROW); for (sal_Int32 i = 0; i < xIndexAccess->getCount(); ++i) { - uno::Sequence< beans::PropertyValue > aLvlProps(1); - aLvlProps[0].Name = "NumberingType"; - aLvlProps[0].Value <<= style::NumberingType::NUMBER_NONE; + uno::Sequence< beans::PropertyValue > aLvlProps{ + comphelper::makePropertyValue( + "NumberingType", style::NumberingType::NUMBER_NONE) + }; xNumberingRules->replaceByIndex(i, uno::makeAny(aLvlProps)); xPropertySet->setPropertyValue("NumberingRules", uno::makeAny(xNumberingRules)); } diff --git a/writerfilter/source/dmapper/WrapPolygonHandler.cxx b/writerfilter/source/dmapper/WrapPolygonHandler.cxx index 3f693b45f389..319fae5c4cb0 100644 --- a/writerfilter/source/dmapper/WrapPolygonHandler.cxx +++ b/writerfilter/source/dmapper/WrapPolygonHandler.cxx @@ -156,10 +156,7 @@ WrapPolygon::Pointer_t WrapPolygon::correctCrop(const awt::Size& rGraphicSize, drawing::PointSequenceSequence WrapPolygon::getPointSequenceSequence() const { - drawing::PointSequenceSequence aPolyPolygon(1); - drawing::PointSequence aPolygon = comphelper::containerToSequence(mPoints); - aPolyPolygon[0] = aPolygon; - return aPolyPolygon; + return { comphelper::containerToSequence(mPoints) }; } WrapPolygonHandler::WrapPolygonHandler() diff --git a/writerfilter/source/dmapper/WriteProtection.cxx b/writerfilter/source/dmapper/WriteProtection.cxx index 724dbb77e783..c300ab09e303 100644 --- a/writerfilter/source/dmapper/WriteProtection.cxx +++ b/writerfilter/source/dmapper/WriteProtection.cxx @@ -19,6 +19,8 @@ #include "WriteProtection.hxx" #include "TagLogger.hxx" + +#include <comphelper/propertyvalue.hxx> #include <ooxml/resourceids.hxx> using namespace com::sun::star; @@ -124,15 +126,10 @@ uno::Sequence<beans::PropertyValue> WriteProtection::toSequence() const if (!m_sAlgorithmName.isEmpty() && !m_sSalt.isEmpty() && !m_sHash.isEmpty() && m_sCryptAlgorithmClass == "hash" && m_sCryptAlgorithmType == "typeAny") { - aResult.realloc(4); - aResult[0].Name = "algorithm-name"; - aResult[0].Value <<= m_sAlgorithmName; - aResult[1].Name = "salt"; - aResult[1].Value <<= m_sSalt; - aResult[2].Name = "iteration-count"; - aResult[2].Value <<= m_CryptSpinCount; - aResult[3].Name = "hash"; - aResult[3].Value <<= m_sHash; + aResult = { comphelper::makePropertyValue("algorithm-name", m_sAlgorithmName), + comphelper::makePropertyValue("salt", m_sSalt), + comphelper::makePropertyValue("iteration-count", m_CryptSpinCount), + comphelper::makePropertyValue("hash", m_sHash) }; } return aResult; diff --git a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx index 75caf969f61e..53eeb93fe149 100644 --- a/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx +++ b/writerfilter/source/ooxml/OOXMLDocumentImpl.cxx @@ -694,12 +694,9 @@ void OOXMLDocumentImpl::resolveGlossaryStream(Stream & /*rStream*/) if (xDom.is()) { - uno::Sequence< uno::Any > glossaryTuple (5); - glossaryTuple[0] <<= xDom; - glossaryTuple[1] <<= gId; - glossaryTuple[2] <<= gType; - glossaryTuple[3] <<= gTarget; - glossaryTuple[4] <<= contentType; + uno::Sequence< uno::Any > glossaryTuple{ uno::Any(xDom), uno::Any(gId), + uno::Any(gType), uno::Any(gTarget), + uno::Any(contentType) }; aGlossaryDomList.push_back(glossaryTuple); } } diff --git a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx index bcfc0c10b510..773451d5dc87 100644 --- a/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx +++ b/writerfilter/source/ooxml/OOXMLFastContextHandler.cxx @@ -26,6 +26,7 @@ #include <oox/token/namespaces.hxx> #include <sal/log.hxx> #include <comphelper/embeddedobjectcontainer.hxx> +#include <comphelper/propertyvalue.hxx> #include <cppuhelper/exc_hlp.hxx> #include <tools/globname.hxx> #include <comphelper/classids.hxx> @@ -2195,9 +2196,8 @@ void OOXMLFastContextHandlerMath::process() SvGlobalName name( SO3_SM_CLASSID ); comphelper::EmbeddedObjectContainer container; OUString aName; - uno::Sequence<beans::PropertyValue> objArgs(1); - objArgs[0].Name = "DefaultParentBaseURL"; - objArgs[0].Value <<= getDocument()->GetDocumentBaseURL(); + uno::Sequence<beans::PropertyValue> objArgs{ comphelper::makePropertyValue( + "DefaultParentBaseURL", getDocument()->GetDocumentBaseURL()) }; uno::Reference<embed::XEmbeddedObject> ref = container.CreateEmbeddedObject(name.GetByteSequence(), objArgs, aName); assert(ref.is()); diff --git a/writerfilter/source/ooxml/factoryimpl.py b/writerfilter/source/ooxml/factoryimpl.py index 4fdbfda2ee4b..c68d5ba06160 100644 --- a/writerfilter/source/ooxml/factoryimpl.py +++ b/writerfilter/source/ooxml/factoryimpl.py @@ -154,8 +154,7 @@ def getFastParser(): mxFastParser = css::xml::sax::FastParser::create(mxContext); // the threaded parser is about 20% slower loading writer documents css::uno::Reference< css::lang::XInitialization > xInit( mxFastParser, css::uno::UNO_QUERY_THROW ); - css::uno::Sequence< css::uno::Any > args(1); - args[0] <<= OUString("DisableThreadedParser"); + css::uno::Sequence< css::uno::Any > args{ css::uno::Any(OUString("DisableThreadedParser")) }; xInit->initialize(args); """) for url in sorted(ooxUrlAliases.keys()): diff --git a/writerfilter/source/rtftok/rtfsdrimport.cxx b/writerfilter/source/rtftok/rtfsdrimport.cxx index 9b234b5f5c90..e6dedc73605a 100644 --- a/writerfilter/source/rtftok/rtfsdrimport.cxx +++ b/writerfilter/source/rtftok/rtfsdrimport.cxx @@ -964,7 +964,7 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap if ((xPropertySet->getPropertyValue("PolyPolygon") >>= aPolyPolySequence) && aPolyPolySequence.hasElements()) { - uno::Sequence<awt::Point>& rPolygon = aPolyPolySequence[0]; + uno::Sequence<awt::Point>& rPolygon = aPolyPolySequence.getArray()[0]; basegfx::B2DPolygon aPoly; for (const awt::Point& rPoint : std::as_const(rPolygon)) { @@ -973,10 +973,11 @@ void RTFSdrImport::resolve(RTFShape& rShape, bool bClose, ShapeOrPict const shap basegfx::B2DHomMatrix aTransformation; aTransformation.scale(1.0, *obRelFlipV ? -1.0 : 1.0); aPoly.transform(aTransformation); + auto pPolygon = rPolygon.getArray(); for (sal_Int32 i = 0; i < rPolygon.getLength(); ++i) { basegfx::B2DPoint aPoint(aPoly.getB2DPoint(i)); - rPolygon[i] = awt::Point(static_cast<sal_Int32>(aPoint.getX()), + pPolygon[i] = awt::Point(static_cast<sal_Int32>(aPoint.getX()), static_cast<sal_Int32>(aPoint.getY())); } xPropertySet->setPropertyValue("PolyPolygon", uno::makeAny(aPolyPolySequence));