diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-10-29 10:28:28 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-11-01 07:11:36 +0100 |
commit | 8cb57be792e6991c38cf5d4434569dc118dd0ed4 (patch) | |
tree | 46f394a22466fb7281d9c48f6d7fbed8a1a448a6 /xmloff/source/draw | |
parent | 34d0dd41e1e7bb69d6c4f817b39da26bcd33831f (diff) |
Prepare for removal of non-const operator[] from Sequence in xmloff
Change-Id: I7ea7964f76f0a5db678510ac3533003726dc49fa
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124416
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmloff/source/draw')
-rw-r--r-- | xmloff/source/draw/sdxmlexp.cxx | 6 | ||||
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 22 | ||||
-rw-r--r-- | xmloff/source/draw/shapeimport.cxx | 5 | ||||
-rw-r--r-- | xmloff/source/draw/ximpshap.cxx | 49 |
4 files changed, 42 insertions, 40 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx index a306236ac13e..d02a5731ad25 100644 --- a/xmloff/source/draw/sdxmlexp.cxx +++ b/xmloff/source/draw/sdxmlexp.cxx @@ -621,7 +621,7 @@ void SdXMLExport::ImpPrepAutoLayoutInfos() return; OUString aStr; - + auto DrawPagesAutoLayoutNamesRange = asNonConstRange(maDrawPagesAutoLayoutNames); Reference< presentation::XHandoutMasterSupplier > xHandoutSupp( GetModel(), UNO_QUERY ); if( xHandoutSupp.is() ) { @@ -629,7 +629,7 @@ void SdXMLExport::ImpPrepAutoLayoutInfos() if( xHandoutPage.is() ) { if(ImpPrepAutoLayoutInfo(xHandoutPage, aStr)) - maDrawPagesAutoLayoutNames[0] = aStr; + DrawPagesAutoLayoutNamesRange[0] = aStr; } } @@ -642,7 +642,7 @@ void SdXMLExport::ImpPrepAutoLayoutInfos() if((aAny >>= xDrawPage) && xDrawPage.is()) { if(ImpPrepAutoLayoutInfo(xDrawPage, aStr)) - maDrawPagesAutoLayoutNames[nCnt+1] = aStr; + DrawPagesAutoLayoutNamesRange[nCnt+1] = aStr; } } } diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index ae5dbf041d1e..d47ea15b2758 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -81,6 +81,7 @@ #include <comphelper/classids.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/storagehelper.hxx> #include <officecfg/Office/Common.hxx> @@ -232,13 +233,11 @@ uno::Reference< drawing::XShape > XMLShapeExport::checkForCustomShapeReplacement if ( !aEngine.isEmpty() ) { - uno::Sequence< uno::Any > aArgument( 1 ); - uno::Sequence< beans::PropertyValue > aPropValues( 2 ); - aPropValues[ 0 ].Name = "CustomShape"; - aPropValues[ 0 ].Value <<= xShape; - aPropValues[ 1 ].Name = "ForceGroupWithText"; - aPropValues[ 1 ].Value <<= true; - aArgument[ 0 ] <<= aPropValues; + uno::Sequence< beans::PropertyValue > aPropValues{ + comphelper::makePropertyValue("CustomShape", xShape), + comphelper::makePropertyValue("ForceGroupWithText", true) + }; + uno::Sequence< uno::Any > aArgument = { uno::Any(aPropValues) }; uno::Reference< uno::XInterface > xInterface( xContext->getServiceManager()->createInstanceWithArgumentsAndContext(aEngine, aArgument, xContext) ); if ( xInterface.is() ) @@ -4994,11 +4993,10 @@ void XMLShapeExport::ImpExportTableShape( const uno::Reference< drawing::XShape } uno::Reference< graphic::XGraphicProvider > xProvider( graphic::GraphicProvider::create(xContext) ); - uno::Sequence< beans::PropertyValue > aArgs( 2 ); - aArgs[ 0 ].Name = "MimeType"; - aArgs[ 0 ].Value <<= OUString( "image/x-vclgraphic" ); - aArgs[ 1 ].Name = "OutputStream"; - aArgs[ 1 ].Value <<= xPictureStream->getOutputStream(); + uno::Sequence< beans::PropertyValue > aArgs{ + comphelper::makePropertyValue("MimeType", OUString( "image/x-vclgraphic" )), + comphelper::makePropertyValue("OutputStream", xPictureStream->getOutputStream()) + }; xProvider->storeGraphic( xGraphic, aArgs ); if( xPictureStorage.is() ) diff --git a/xmloff/source/draw/shapeimport.cxx b/xmloff/source/draw/shapeimport.cxx index ba4a5646c90f..76ac0075c564 100644 --- a/xmloff/source/draw/shapeimport.cxx +++ b/xmloff/source/draw/shapeimport.cxx @@ -639,6 +639,7 @@ void ShapeGroupContext::popGroupAndPostProcess() if( xShapes3.is()) { uno::Sequence<sal_Int32> aNewOrder(maZOrderList.size() + maUnsortedList.size()); + auto pNewOrder = aNewOrder.getArray(); sal_Int32 nIndex = 0; for (const ZOrderHint& rHint : maZOrderList) @@ -646,11 +647,11 @@ void ShapeGroupContext::popGroupAndPostProcess() // fill in the gaps from unordered list for (vector<ZOrderHint>::iterator aIt = maUnsortedList.begin(); aIt != maUnsortedList.end() && nIndex < rHint.nShould; ) { - aNewOrder[nIndex++] = (*aIt).nIs; + pNewOrder[nIndex++] = (*aIt).nIs; aIt = maUnsortedList.erase(aIt); } - aNewOrder[nIndex] = rHint.nIs; + pNewOrder[nIndex] = rHint.nIs; nIndex++; } diff --git a/xmloff/source/draw/ximpshap.cxx b/xmloff/source/draw/ximpshap.cxx index 8b395ddd9757..c1f93885c9c7 100644 --- a/xmloff/source/draw/ximpshap.cxx +++ b/xmloff/source/draw/ximpshap.cxx @@ -355,21 +355,22 @@ void SdXMLShapeContext::endFastElement(sal_Int32 ) { Reference< XNameReplace > xEvents( xEventsSupplier->getEvents(), UNO_SET_THROW ); - uno::Sequence< beans::PropertyValue > aProperties( 3 ); - aProperties[0].Name = "EventType"; - aProperties[0].Handle = -1; - aProperties[0].Value <<= OUString( "Presentation" ); - aProperties[0].State = beans::PropertyState_DIRECT_VALUE; - - aProperties[1].Name = "ClickAction"; - aProperties[1].Handle = -1; - aProperties[1].Value <<= css::presentation::ClickAction_DOCUMENT; - aProperties[1].State = beans::PropertyState_DIRECT_VALUE; - - aProperties[2].Name = "Bookmark"; - aProperties[2].Handle = -1; - aProperties[2].Value <<= msHyperlink; - aProperties[2].State = beans::PropertyState_DIRECT_VALUE; + uno::Sequence< beans::PropertyValue > aProperties{ + { /* Name */ "EventType", + /* Handle */ -1, + /* Value */ uno::Any(OUString( "Presentation" )), + /* State */ beans::PropertyState_DIRECT_VALUE }, + + { /* Name */ "ClickAction", + /* Handle */ -1, + /* Value */ uno::Any(css::presentation::ClickAction_DOCUMENT), + /* State */ beans::PropertyState_DIRECT_VALUE }, + + { /* Name */ "Bookmark", + /* Handle */ -1, + /* Value */ uno::Any(msHyperlink), + /* State */ beans::PropertyState_DIRECT_VALUE } + }; xEvents->replaceByName( "OnClick", Any( aProperties ) ); } @@ -2810,10 +2811,11 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLAppletShapeContex { sal_Int32 nIndex = maParams.getLength(); maParams.realloc( nIndex + 1 ); - maParams[nIndex].Name = aParamName; - maParams[nIndex].Handle = -1; - maParams[nIndex].Value <<= aParamValue; - maParams[nIndex].State = beans::PropertyState_DIRECT_VALUE; + auto pParams = maParams.getArray(); + pParams[nIndex].Name = aParamName; + pParams[nIndex].Handle = -1; + pParams[nIndex].Value <<= aParamValue; + pParams[nIndex].State = beans::PropertyState_DIRECT_VALUE; } return new SvXMLImportContext( GetImport() ); @@ -3055,10 +3057,11 @@ css::uno::Reference< css::xml::sax::XFastContextHandler > SdXMLPluginShapeContex { sal_Int32 nIndex = maParams.getLength(); maParams.realloc( nIndex + 1 ); - maParams[nIndex].Name = aParamName; - maParams[nIndex].Handle = -1; - maParams[nIndex].Value <<= aParamValue; - maParams[nIndex].State = beans::PropertyState_DIRECT_VALUE; + auto pParams = maParams.getArray(); + pParams[nIndex].Name = aParamName; + pParams[nIndex].Handle = -1; + pParams[nIndex].Value <<= aParamValue; + pParams[nIndex].State = beans::PropertyState_DIRECT_VALUE; } return new SvXMLImportContext( GetImport() ); |