vbahelper/source/msforms/vbacontrol.cxx | 4 vbahelper/source/msforms/vbacontrols.cxx | 5 - vbahelper/source/msforms/vbalistbox.cxx | 8 - vbahelper/source/msforms/vbalistcontrolhelper.cxx | 7 - vbahelper/source/vbahelper/vbaapplicationbase.cxx | 6 - vbahelper/source/vbahelper/vbacommandbarcontrols.cxx | 52 ++++------ vbahelper/source/vbahelper/vbadocumentbase.cxx | 5 - vbahelper/source/vbahelper/vbadocumentsbase.cxx | 10 +- vbahelper/source/vbahelper/vbaeventshelperbase.cxx | 2 vbahelper/source/vbahelper/vbahelper.cxx | 5 - vcl/osx/DataFlavorMapping.cxx | 2 vcl/qa/cppunit/canvasbitmaptest.cxx | 7 - vcl/qa/cppunit/graphicfilter/filters-test.cxx | 13 +- vcl/qt5/QtFilePicker.cxx | 6 - vcl/qt5/QtTransferable.cxx | 5 - vcl/source/filter/FilterConfigCache.cxx | 3 vcl/source/filter/FilterConfigItem.cxx | 15 +-- vcl/source/filter/GraphicNativeTransform.cxx | 13 +- vcl/source/filter/graphicfilter.cxx | 15 +-- vcl/source/filter/wmf/wmfexternal.cxx | 17 +-- vcl/source/gdi/embeddedfontshelper.cxx | 3 vcl/source/gdi/oldprintadaptor.cxx | 15 +-- vcl/source/gdi/pdfwriter_impl2.cxx | 27 ++--- vcl/source/gdi/print3.cxx | 65 ++++++------- vcl/source/helper/canvasbitmap.cxx | 92 +++++++------------ vcl/source/outdev/outdev.cxx | 13 +- vcl/source/treelist/transfer.cxx | 5 - vcl/source/treelist/transfer2.cxx | 3 vcl/source/uitest/uno/uiobject_uno.cxx | 19 +-- vcl/source/window/mouse.cxx | 18 ++- vcl/source/window/window.cxx | 16 +-- vcl/unx/generic/dtrans/X11_service.cxx | 3 vcl/unx/generic/gdi/salgdi.cxx | 9 + vcl/unx/gtk3/a11y/atktextattributes.cxx | 7 - vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx | 8 + vcl/unx/gtk3/gtkinst.cxx | 6 - vcl/win/dtrans/DOTransferable.cxx | 2 vcl/workben/fftester.cxx | 3 38 files changed, 236 insertions(+), 278 deletions(-)
New commits: commit 951c4ceb2e86c52cb6549afadbe4d3148e1c808c Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Oct 29 10:24:13 2021 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Nov 1 05:26:16 2021 +0100 Prepare for removal of non-const operator[] from Sequence in vbahelper Change-Id: I2450faf4b3e093b2046034e2a5e5657ff5144d98 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124410 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/vbahelper/source/msforms/vbacontrol.cxx b/vbahelper/source/msforms/vbacontrol.cxx index 1c70be2c987d..b0b33543e059 100644 --- a/vbahelper/source/msforms/vbacontrol.cxx +++ b/vbahelper/source/msforms/vbacontrol.cxx @@ -532,7 +532,7 @@ void SAL_CALL ScVbaControl::fireEvent( const script::ScriptEvent& rEvt ) evt.ScriptCode = xNameQuery->getCodeNameForObject( xIf ); // handle if we passed in our own arguments if ( !rEvt.Arguments.hasElements() ) - evt.Arguments[ 0 ] <<= aEvt; + evt.Arguments.getArray()[ 0 ] <<= aEvt; xScriptListener->firing( evt ); } else @@ -546,7 +546,7 @@ void SAL_CALL ScVbaControl::fireEvent( const script::ScriptEvent& rEvt ) evt.Source = xThisControl; aEvt.Source = xControl; evt.ScriptCode = m_sLibraryAndCodeName; - evt.Arguments[ 0 ] <<= aEvt; + evt.Arguments.getArray()[ 0 ] <<= aEvt; xScriptListener->firing( evt ); } } diff --git a/vbahelper/source/msforms/vbacontrols.cxx b/vbahelper/source/msforms/vbacontrols.cxx index 2b7c92374fcf..6f36280aa26f 100644 --- a/vbahelper/source/msforms/vbacontrols.cxx +++ b/vbahelper/source/msforms/vbacontrols.cxx @@ -61,7 +61,7 @@ private: if ( nIndex >= msNames.getLength() ) msNames.realloc( nIndex ); - msNames[ nIndex ] = getControlName( xCtrl ); + msNames.getArray()[ nIndex ] = getControlName( xCtrl ); mControls.push_back( xCtrl ); mIndices[ msNames[ nIndex ] ] = nIndex; } @@ -382,8 +382,7 @@ uno::Any SAL_CALL ScVbaControls::Add( const uno::Any& Object, const uno::Any& St { uno::Reference< script::XInvocation > xControlInvoke( xNewControl, uno::UNO_QUERY_THROW ); - uno::Sequence< uno::Any > aArgs( 1 ); - aArgs[0] <<= aComServiceName; + uno::Sequence< uno::Any > aArgs{ uno::Any(aComServiceName) }; uno::Sequence< sal_Int16 > aOutIDDummy; uno::Sequence< uno::Any > aOutDummy; xControlInvoke->invoke( "SOAddAXControl" , aArgs, aOutIDDummy, aOutDummy ); diff --git a/vbahelper/source/msforms/vbalistbox.cxx b/vbahelper/source/msforms/vbalistbox.cxx index cfa9e54a6134..57ccc38b942c 100644 --- a/vbahelper/source/msforms/vbalistbox.cxx +++ b/vbahelper/source/msforms/vbalistbox.cxx @@ -187,9 +187,10 @@ ScVbaListBox::setValueEvent( const uno::Any& value ) { if( !bValue ) { + auto pList = nList.getArray(); for( ; i < nLength - 1; i++ ) { - nList[i] = nList[i + 1]; + pList[i] = nList[i + 1]; } nList.realloc( nLength - 1 ); //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) ); @@ -205,12 +206,11 @@ ScVbaListBox::setValueEvent( const uno::Any& value ) if( getMultiSelect() ) { nList.realloc( nLength + 1 ); - nList[nLength] = nIndex; + nList.getArray()[nLength] = nIndex; } else { - nList.realloc( 1 ); - nList[0] = nIndex; + nList = { nIndex }; } //m_xProps->setPropertyValue( sSourceName, uno::makeAny( nList ) ); fireClickEvent(); diff --git a/vbahelper/source/msforms/vbalistcontrolhelper.cxx b/vbahelper/source/msforms/vbalistcontrolhelper.cxx index d8ea543bf4ca..9e45b5cc81e0 100644 --- a/vbahelper/source/msforms/vbalistcontrolhelper.cxx +++ b/vbahelper/source/msforms/vbalistcontrolhelper.cxx @@ -75,10 +75,11 @@ uno::Any ListPropListener::getValueEvent() else // List() ( e.g. no args ) { uno::Sequence< uno::Sequence< OUString > > sReturnArray( nLength ); + auto pReturnArray = sReturnArray.getArray(); for ( sal_Int32 i = 0; i < nLength; ++i ) { - sReturnArray[ i ].realloc( 10 ); - sReturnArray[ i ][ 0 ] = sList[ i ]; + pReturnArray[ i ].realloc( 10 ); + pReturnArray[ i ].getArray()[ 0 ] = sList[ i ]; } aRet <<= sReturnArray; } @@ -107,7 +108,7 @@ ListControlHelper::AddItem( const uno::Any& pvargItem, const uno::Any& pvargInde { sal_Int32 nOldSize = sList.getLength(); sList.realloc( nOldSize + 1 ); - sList[ nOldSize ] = sString; + sList.getArray()[ nOldSize ] = sString; } else { diff --git a/vbahelper/source/vbahelper/vbaapplicationbase.cxx b/vbahelper/source/vbahelper/vbaapplicationbase.cxx index 7f1de5b89681..61529cec2b18 100644 --- a/vbahelper/source/vbahelper/vbaapplicationbase.cxx +++ b/vbahelper/source/vbahelper/vbaapplicationbase.cxx @@ -357,6 +357,7 @@ uno::Any SAL_CALL VbaApplicationBase::Run( const OUString& MacroName, const uno: int nArg = SAL_N_ELEMENTS( aArgsPtrArray ); uno::Sequence< uno::Any > aArgs( nArg ); + auto pArgs = aArgs.getArray(); const uno::Any** pArg = aArgsPtrArray; const uno::Any** pArgEnd = aArgsPtrArray + nArg; @@ -364,7 +365,7 @@ uno::Any SAL_CALL VbaApplicationBase::Run( const OUString& MacroName, const uno: sal_Int32 nArgProcessed = 0; for ( ; pArg != pArgEnd; ++pArg, ++nArgProcessed ) - aArgs[ nArgProcessed ] = **pArg; + pArgs[ nArgProcessed ] = **pArg; // resize array to position of last param with value aArgs.realloc( nArgProcessed + 1 ); @@ -418,8 +419,7 @@ uno::Any SAL_CALL VbaApplicationBase::getVBE() try // return empty object on error { // "VBE" object does not have a parent, but pass document model to be able to determine application type - uno::Sequence< uno::Any > aArgs( 1 ); - aArgs[ 0 ] <<= getCurrentDocument(); + uno::Sequence< uno::Any > aArgs{ uno::Any(getCurrentDocument()) }; uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); uno::Reference< uno::XInterface > xVBE = xServiceManager->createInstanceWithArgumentsAndContext( "ooo.vba.vbide.VBE" , aArgs, mxContext ); diff --git a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx index 1b35964446b0..7936247ac541 100644 --- a/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx +++ b/vbahelper/source/vbahelper/vbacommandbarcontrols.cxx @@ -19,6 +19,8 @@ #include "vbacommandbarcontrols.hxx" #include "vbacommandbarcontrol.hxx" #include <com/sun/star/lang/XSingleComponentFactory.hpp> + +#include <comphelper/propertyvalue.hxx> #include <rtl/ref.hxx> using namespace com::sun::star; @@ -63,22 +65,15 @@ uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateMenuItemDat bool isVisible, bool isEnabled ) { - uno::Sequence< beans::PropertyValue > aProps(7); - - aProps[0].Name = ITEM_DESCRIPTOR_COMMANDURL; - aProps[0].Value <<= sCommandURL; - aProps[1].Name = ITEM_DESCRIPTOR_HELPURL; - aProps[1].Value <<= sHelpURL; - aProps[2].Name = ITEM_DESCRIPTOR_LABEL; - aProps[2].Value <<= sLabel; - aProps[3].Name = ITEM_DESCRIPTOR_TYPE; - aProps[3].Value <<= nType; - aProps[4].Name = ITEM_DESCRIPTOR_CONTAINER; - aProps[4].Value = aSubMenu; - aProps[5].Name = ITEM_DESCRIPTOR_ISVISIBLE; - aProps[5].Value <<= isVisible; - aProps[6].Name = ITEM_DESCRIPTOR_ENABLED; - aProps[6].Value <<= isEnabled; + uno::Sequence< beans::PropertyValue > aProps{ + comphelper::makePropertyValue(ITEM_DESCRIPTOR_COMMANDURL, sCommandURL), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_HELPURL, sHelpURL), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_LABEL, sLabel), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_TYPE, nType), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_CONTAINER, aSubMenu), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_ISVISIBLE, isVisible), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_ENABLED, isEnabled) + }; return aProps; } @@ -91,22 +86,15 @@ uno::Sequence< beans::PropertyValue > ScVbaCommandBarControls::CreateToolbarItem bool isVisible, sal_Int32 nStyle ) { - uno::Sequence< beans::PropertyValue > aProps(7); - - aProps[0].Name = ITEM_DESCRIPTOR_COMMANDURL; - aProps[0].Value <<= sCommandURL; - aProps[1].Name = ITEM_DESCRIPTOR_HELPURL; - aProps[1].Value <<= sHelpURL; - aProps[2].Name = ITEM_DESCRIPTOR_LABEL; - aProps[2].Value <<= sLabel; - aProps[3].Name = ITEM_DESCRIPTOR_TYPE; - aProps[3].Value <<= nType; - aProps[4].Name = ITEM_DESCRIPTOR_CONTAINER; - aProps[4].Value = aSubMenu; - aProps[5].Name = ITEM_DESCRIPTOR_ISVISIBLE; - aProps[5].Value <<= isVisible; - aProps[6].Name = ITEM_DESCRIPTOR_STYLE; - aProps[6].Value <<= nStyle; + uno::Sequence< beans::PropertyValue > aProps{ + comphelper::makePropertyValue(ITEM_DESCRIPTOR_COMMANDURL, sCommandURL), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_HELPURL, sHelpURL), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_LABEL, sLabel), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_TYPE, nType), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_CONTAINER, aSubMenu), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_ISVISIBLE, isVisible), + comphelper::makePropertyValue(ITEM_DESCRIPTOR_STYLE, nStyle) + }; return aProps; } diff --git a/vbahelper/source/vbahelper/vbadocumentbase.cxx b/vbahelper/source/vbahelper/vbadocumentbase.cxx index bf199764b0c4..d27804012bca 100644 --- a/vbahelper/source/vbahelper/vbadocumentbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentbase.cxx @@ -278,9 +278,8 @@ VbaDocumentBase::getVBProject() { uno::Reference< XApplicationBase > xApp( Application(), uno::UNO_QUERY_THROW ); uno::Reference< XInterface > xVBE( xApp->getVBE(), uno::UNO_QUERY_THROW ); - uno::Sequence< uno::Any > aArgs( 2 ); - aArgs[ 0 ] <<= xVBE; // the VBE - aArgs[ 1 ] <<= getModel(); // document model for script container access + uno::Sequence< uno::Any > aArgs{ uno::Any(xVBE), // the VBE + uno::Any(getModel()) }; // document model for script container access uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager(), uno::UNO_SET_THROW ); mxVBProject = xServiceManager->createInstanceWithArgumentsAndContext( "ooo.vba.vbide.VBProject", aArgs, mxContext ); diff --git a/vbahelper/source/vbahelper/vbadocumentsbase.cxx b/vbahelper/source/vbahelper/vbadocumentsbase.cxx index 65ef6b6019e4..f2b23997a8da 100644 --- a/vbahelper/source/vbahelper/vbadocumentsbase.cxx +++ b/vbahelper/source/vbahelper/vbadocumentsbase.cxx @@ -288,8 +288,9 @@ uno::Any VbaDocumentsBase::openDocument( const OUString& rFileName, const uno::A uno::Sequence< beans::PropertyValue > sProps( rProps ); sProps.realloc( sProps.getLength() + 1 ); - sProps[ sProps.getLength() - 1 ].Name = "MacroExecutionMode"; - sProps[ sProps.getLength() - 1 ].Value <<= document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN; + auto pProps = sProps.getArray(); + pProps[ sProps.getLength() - 1 ].Name = "MacroExecutionMode"; + pProps[ sProps.getLength() - 1 ].Value <<= document::MacroExecMode::ALWAYS_EXECUTE_NO_WARN; if ( ReadOnly.hasValue() ) { @@ -298,8 +299,9 @@ uno::Any VbaDocumentsBase::openDocument( const OUString& rFileName, const uno::A if ( bIsReadOnly ) { sProps.realloc( sProps.getLength() + 1 ); - sProps[ sProps.getLength() - 1 ].Name = "ReadOnly"; - sProps[ sProps.getLength() - 1 ].Value <<= true; + pProps = sProps.getArray(); + pProps[ sProps.getLength() - 1 ].Name = "ReadOnly"; + pProps[ sProps.getLength() - 1 ].Value <<= true; } } diff --git a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx index 8c8515d8fa1c..1f92e449a156 100644 --- a/vbahelper/source/vbahelper/vbaeventshelperbase.cxx +++ b/vbahelper/source/vbahelper/vbaeventshelperbase.cxx @@ -107,7 +107,7 @@ sal_Bool SAL_CALL VbaEventsHelperBase::processVbaEvent( sal_Int32 nEventId, cons { if( rInfo.mnCancelIndex >= aVbaArgs.getLength() ) throw lang::IllegalArgumentException(); - aVbaArgs[ rInfo.mnCancelIndex ] <<= bCancel; + aVbaArgs.getArray()[ rInfo.mnCancelIndex ] <<= bCancel; } // execute the event handler uno::Any aRet, aCaller; diff --git a/vbahelper/source/vbahelper/vbahelper.cxx b/vbahelper/source/vbahelper/vbahelper.cxx index 9ed61ba32685..25da3beca4d4 100644 --- a/vbahelper/source/vbahelper/vbahelper.cxx +++ b/vbahelper/source/vbahelper/vbahelper.cxx @@ -752,8 +752,9 @@ void setOrAppendPropertyValue( uno::Sequence< beans::PropertyValue >& aProp, con // append the property sal_Int32 nLength = aProp.getLength(); aProp.realloc( nLength + 1 ); - aProp[ nLength ].Name = aName; - aProp[ nLength ].Value = aValue; + auto pProp = aProp.getArray(); + pProp[ nLength ].Name = aName; + pProp[ nLength ].Value = aValue; } // ====UserFormGeomentryHelper==== commit 2e29906567cef053e608588830ddfb013cb53682 Author: Mike Kaganski <mike.kagan...@collabora.com> AuthorDate: Fri Oct 29 10:24:51 2021 +0300 Commit: Mike Kaganski <mike.kagan...@collabora.com> CommitDate: Mon Nov 1 05:26:08 2021 +0100 Prepare for removal of non-const operator[] from Sequence in vcl Change-Id: I65f411affcf0340c054d09426483d57c530edb0f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124411 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kagan...@collabora.com> diff --git a/vcl/osx/DataFlavorMapping.cxx b/vcl/osx/DataFlavorMapping.cxx index 1145c77cfa76..274a2b4a4be7 100644 --- a/vcl/osx/DataFlavorMapping.cxx +++ b/vcl/osx/DataFlavorMapping.cxx @@ -744,7 +744,7 @@ css::uno::Sequence<css::datatransfer::DataFlavor> DataFlavorMapper::typesArrayTo if (isValidFlavor(oOOFlavor)) { flavors.realloc(flavors.getLength() + 1); - flavors[flavors.getLength() - 1] = oOOFlavor; + flavors.getArray()[flavors.getLength() - 1] = oOOFlavor; } } diff --git a/vcl/qa/cppunit/canvasbitmaptest.cxx b/vcl/qa/cppunit/canvasbitmaptest.cxx index 10923d8704f2..91a5cfed4bb8 100644 --- a/vcl/qa/cppunit/canvasbitmaptest.cxx +++ b/vcl/qa/cppunit/canvasbitmaptest.cxx @@ -606,11 +606,8 @@ public: { if( bPalette ) { - maComponentTags.realloc(1); - maComponentTags[0] = rendering::ColorComponentTag::INDEX; - - maComponentBitCounts.realloc(1); - maComponentBitCounts[0] = 8; + maComponentTags = { rendering::ColorComponentTag::INDEX }; + maComponentBitCounts = { 8 }; } else { diff --git a/vcl/qa/cppunit/graphicfilter/filters-test.cxx b/vcl/qa/cppunit/graphicfilter/filters-test.cxx index ad5c1be8e8a4..22078cf9de65 100644 --- a/vcl/qa/cppunit/graphicfilter/filters-test.cxx +++ b/vcl/qa/cppunit/graphicfilter/filters-test.cxx @@ -15,6 +15,7 @@ #include <test/bootstrapfixture.hxx> #include <comphelper/fileformat.h> +#include <comphelper/propertyvalue.hxx> #include <vcl/graphicfilter.hxx> #include <tools/stream.hxx> @@ -111,13 +112,11 @@ void VclFiltersTest::checkExportImport(std::u16string_view aFilterShortName) SvMemoryStream aStream; aStream.SetVersion( SOFFICE_FILEFORMAT_CURRENT ); - css::uno::Sequence< css::beans::PropertyValue > aFilterData( 3 ); - aFilterData[ 0 ].Name = "Interlaced"; - aFilterData[ 0 ].Value <<= sal_Int32(0); - aFilterData[ 1 ].Name = "Compression"; - aFilterData[ 1 ].Value <<= sal_Int32(1); - aFilterData[ 2 ].Name = "Quality"; - aFilterData[ 2 ].Value <<= sal_Int32(90); + css::uno::Sequence< css::beans::PropertyValue > aFilterData{ + comphelper::makePropertyValue("Interlaced", sal_Int32(0)), + comphelper::makePropertyValue("Compression", sal_Int32(1)), + comphelper::makePropertyValue("Quality", sal_Int32(90)) + }; sal_uInt16 aFilterType = mpGraphicFilter->GetExportFormatNumberForShortName(aFilterShortName); mpGraphicFilter->ExportGraphic(BitmapEx(aBitmap), OUString(), aStream, aFilterType, &aFilterData ); diff --git a/vcl/qt5/QtFilePicker.cxx b/vcl/qt5/QtFilePicker.cxx index de8b5f4601c3..ca80b61ef101 100644 --- a/vcl/qt5/QtFilePicker.cxx +++ b/vcl/qt5/QtFilePicker.cxx @@ -261,6 +261,7 @@ uno::Sequence<OUString> SAL_CALL QtFilePicker::getSelectedFiles() pSalInst->RunInMainThread([&urls, this]() { urls = m_pFileDialog->selectedUrls(); }); uno::Sequence<OUString> seq(urls.size()); + auto seqRange = asNonConstRange(seq); auto const trans = css::uri::ExternalUriReferenceTranslator::create(m_context); size_t i = 0; @@ -283,7 +284,7 @@ uno::Sequence<OUString> SAL_CALL QtFilePicker::getSelectedFiles() SAL_WARN("vcl.qt", "cannot convert <" << extUrl << "> from locale encoding to UTF-8"); intUrl = extUrl; } - seq[i++] = intUrl; + seqRange[i++] = intUrl; } return seq; @@ -379,8 +380,9 @@ uno::Any QtFilePicker::handleGetListValue(const QComboBox* pWidget, sal_Int16 nC case ControlActions::GET_ITEMS: { Sequence<OUString> aItemList(pWidget->count()); + auto aItemListRange = asNonConstRange(aItemList); for (sal_Int32 i = 0; i < pWidget->count(); ++i) - aItemList[i] = toOUString(pWidget->itemText(i)); + aItemListRange[i] = toOUString(pWidget->itemText(i)); aAny <<= aItemList; break; } diff --git a/vcl/qt5/QtTransferable.cxx b/vcl/qt5/QtTransferable.cxx index 737468c0b5a5..a2483b4b5f3a 100644 --- a/vcl/qt5/QtTransferable.cxx +++ b/vcl/qt5/QtTransferable.cxx @@ -64,6 +64,7 @@ css::uno::Sequence<css::datatransfer::DataFlavor> SAL_CALL QtTransferable::getTr const int nMimeTypeSeqSize = aFormatList.size() + 1; bool bHaveNoCharset = false, bHaveUTF16 = false; css::uno::Sequence<css::datatransfer::DataFlavor> aMimeTypeSeq(nMimeTypeSeqSize); + auto pMimeTypeSeq = aMimeTypeSeq.getArray(); css::datatransfer::DataFlavor aFlavor; int nMimeTypeCount = 0; @@ -94,7 +95,7 @@ css::uno::Sequence<css::datatransfer::DataFlavor> SAL_CALL QtTransferable::getTr aFlavor.MimeType = toOUString(rMimeType); assert(nMimeTypeCount < nMimeTypeSeqSize); - aMimeTypeSeq[nMimeTypeCount] = aFlavor; + pMimeTypeSeq[nMimeTypeCount] = aFlavor; nMimeTypeCount++; } @@ -104,7 +105,7 @@ css::uno::Sequence<css::datatransfer::DataFlavor> SAL_CALL QtTransferable::getTr aFlavor.MimeType = "text/plain;charset=utf-16"; aFlavor.DataType = cppu::UnoType<OUString>::get(); assert(nMimeTypeCount < nMimeTypeSeqSize); - aMimeTypeSeq[nMimeTypeCount] = aFlavor; + pMimeTypeSeq[nMimeTypeCount] = aFlavor; nMimeTypeCount++; } diff --git a/vcl/source/filter/FilterConfigCache.cxx b/vcl/source/filter/FilterConfigCache.cxx index 1783b0f35702..64e4e6929dea 100644 --- a/vcl/source/filter/FilterConfigCache.cxx +++ b/vcl/source/filter/FilterConfigCache.cxx @@ -96,7 +96,6 @@ static Reference< XInterface > openConfig(const char* sPackage) // get access to config API (not to file!) Reference< XMultiServiceFactory > xConfigProvider = theDefaultProvider::get( xContext ); - Sequence< Any > lParams(1); PropertyValue aParam ; // define cfg path for open @@ -105,7 +104,7 @@ static Reference< XInterface > openConfig(const char* sPackage) aParam.Value <<= OUString( "/org.openoffice.TypeDetection.Types/Types" ); if (rtl_str_compareIgnoreAsciiCase(sPackage, "filters") == 0) aParam.Value <<= OUString( "/org.openoffice.TypeDetection.GraphicFilter/Filters" ); - lParams[0] <<= aParam; + Sequence< Any > lParams{ Any(aParam) }; // get access to file xCfg = xConfigProvider->createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", lParams); diff --git a/vcl/source/filter/FilterConfigItem.cxx b/vcl/source/filter/FilterConfigItem.cxx index 7a2e98aba8bb..962d970bf4ab 100644 --- a/vcl/source/filter/FilterConfigItem.cxx +++ b/vcl/source/filter/FilterConfigItem.cxx @@ -21,6 +21,7 @@ #include <unotools/configmgr.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <osl/diagnose.h> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp> @@ -51,12 +52,9 @@ static bool ImpIsTreeAvailable( Reference< XMultiServiceFactory > const & rXCfgP ++nIdx; // creation arguments: nodepath - PropertyValue aPathArgument; - aPathArgument.Name = "nodepath"; - aPathArgument.Value <<= rTree.getToken(0, '/', nIdx); - - Sequence< Any > aArguments( 1 ); - aArguments[ 0 ] <<= aPathArgument; + PropertyValue aPathArgument = comphelper::makePropertyValue("nodepath", + rTree.getToken(0, '/', nIdx)); + Sequence< Any > aArguments{ Any(aPathArgument) }; Reference< XInterface > xReadAccess; try @@ -113,8 +111,7 @@ void FilterConfigItem::ImpInitTree( std::u16string_view rSubTree ) aPathArgument.Name = "nodepath"; aPathArgument.Value <<= sTree; - Sequence< Any > aArguments( 1 ); - aArguments[ 0 ] <<= aPathArgument; + Sequence< Any > aArguments{ Any(aPathArgument) }; try { @@ -242,7 +239,7 @@ bool FilterConfigItem::WritePropertyValue( Sequence< PropertyValue >& rPropSeq, if ( i == nCount ) rPropSeq.realloc( ++nCount ); - rPropSeq[ i ] = rPropValue; + rPropSeq.getArray()[ i ] = rPropValue; bRet = true; } diff --git a/vcl/source/filter/GraphicNativeTransform.cxx b/vcl/source/filter/GraphicNativeTransform.cxx index b591217edd91..230e9891e7b7 100644 --- a/vcl/source/filter/GraphicNativeTransform.cxx +++ b/vcl/source/filter/GraphicNativeTransform.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/uno/Sequence.hxx> #include <tools/stream.hxx> +#include <comphelper/propertyvalue.hxx> #include "jpeg/Exif.hxx" #include "jpeg/JpegTransform.hxx" @@ -94,13 +95,11 @@ bool GraphicNativeTransform::rotateGeneric(Degree10 aRotation, std::u16string_vi GraphicFilter& rFilter = GraphicFilter::GetGraphicFilter(); - css::uno::Sequence<css::beans::PropertyValue> aFilterData(3); - aFilterData[0].Name = "Interlaced"; - aFilterData[0].Value <<= sal_Int32(0); - aFilterData[1].Name = "Compression"; - aFilterData[1].Value <<= sal_Int32(9); - aFilterData[2].Name = "Quality"; - aFilterData[2].Value <<= sal_Int32(90); + css::uno::Sequence<css::beans::PropertyValue> aFilterData{ + comphelper::makePropertyValue("Interlaced", sal_Int32(0)), + comphelper::makePropertyValue("Compression", sal_Int32(9)), + comphelper::makePropertyValue("Quality", sal_Int32(90)) + }; sal_uInt16 nFilterFormat = rFilter.GetExportFormatNumberForShortName(aType); diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 24c1ccd66000..add513e1b72e 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -21,6 +21,7 @@ #include <sal/log.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/threadpool.hxx> #include <cppuhelper/implbase.hxx> #include <tools/fract.hxx> @@ -1805,8 +1806,8 @@ ErrCode GraphicFilter::ExportGraphic( const Graphic& rGraphic, const OUString& r css::uno::Reference< css::xml::sax::XDocumentHandler > xSaxWriter( css::xml::sax::Writer::create( xContext ), css::uno::UNO_QUERY_THROW); - css::uno::Sequence< css::uno::Any > aArguments( 1 ); - aArguments[ 0 ] <<= aConfigItem.GetFilterData(); + css::uno::Sequence< css::uno::Any > aArguments{ css::uno::Any( + aConfigItem.GetFilterData()) }; css::uno::Reference< css::svg::XSVGWriter > xSVGWriter( xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "com.sun.star.svg.SVGWriter", aArguments, xContext), css::uno::UNO_QUERY ); @@ -1898,9 +1899,10 @@ IMPL_LINK( GraphicFilter, FilterCallback, ConvertData&, rData, bool ) if (aShortName == PNG_SHORTNAME) { aFilterData.realloc(aFilterData.getLength() + 1); - aFilterData[aFilterData.getLength() - 1].Name = "Compression"; + auto pFilterData = aFilterData.getArray(); + pFilterData[aFilterData.getLength() - 1].Name = "Compression"; // We "know" that this gets passed to zlib's deflateInit2_(). 1 means best speed. - aFilterData[aFilterData.getLength() - 1].Value <<= static_cast<sal_Int32>(1); + pFilterData[aFilterData.getLength() - 1].Value <<= static_cast<sal_Int32>(1); } #endif nFormat = GetExportFormatNumberForShortName( aShortName ); @@ -1981,9 +1983,8 @@ ErrCode GraphicFilter::LoadGraphic( const OUString &rPath, const OUString &rFilt ErrCode GraphicFilter::compressAsPNG(const Graphic& rGraphic, SvStream& rOutputStream) { - css::uno::Sequence< css::beans::PropertyValue > aFilterData(1); - aFilterData[0].Name = "Compression"; - aFilterData[0].Value <<= sal_uInt32(9); + css::uno::Sequence< css::beans::PropertyValue > aFilterData{ comphelper::makePropertyValue( + "Compression", sal_uInt32(9)) }; sal_uInt16 nFilterFormat = GetExportFormatNumberForShortName(u"PNG"); return ExportGraphic(rGraphic, OUString(), rOutputStream, nFilterFormat, &aFilterData); diff --git a/vcl/source/filter/wmf/wmfexternal.cxx b/vcl/source/filter/wmf/wmfexternal.cxx index cc7dc3b1e972..c5616beac71e 100644 --- a/vcl/source/filter/wmf/wmfexternal.cxx +++ b/vcl/source/filter/wmf/wmfexternal.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <comphelper/propertyvalue.hxx> #include <vcl/wmfexternal.hxx> #include <com/sun/star/beans/PropertyValue.hpp> @@ -30,20 +33,14 @@ WmfExternal::WmfExternal() css::uno::Sequence<css::beans::PropertyValue> WmfExternal::getSequence() const { - css::uno::Sequence<css::beans::PropertyValue> aSequence; - if (0 != xExt || 0 != yExt || 0 != mapMode) { - aSequence.realloc(3); - aSequence[0].Name = "Width"; - aSequence[0].Value <<= static_cast<sal_Int16>(xExt); - aSequence[1].Name = "Height"; - aSequence[1].Value <<= static_cast<sal_Int16>(yExt); - aSequence[2].Name = "MapMode"; - aSequence[2].Value <<= static_cast<sal_Int16>(mapMode); + return { comphelper::makePropertyValue("Width", static_cast<sal_Int16>(xExt)), + comphelper::makePropertyValue("Height", static_cast<sal_Int16>(yExt)), + comphelper::makePropertyValue("MapMode", static_cast<sal_Int16>(mapMode)) }; } - return aSequence; + return {}; } bool WmfExternal::setSequence(const css::uno::Sequence<css::beans::PropertyValue>& rSequence) diff --git a/vcl/source/gdi/embeddedfontshelper.cxx b/vcl/source/gdi/embeddedfontshelper.cxx index 846f23262a03..34d227e5f5b2 100644 --- a/vcl/source/gdi/embeddedfontshelper.cxx +++ b/vcl/source/gdi/embeddedfontshelper.cxx @@ -87,10 +87,11 @@ bool EmbeddedFontsHelper::addEmbeddedFont( const uno::Reference< io::XInputStrea { uno::Sequence< sal_Int8 > buffer; sal_uInt64 read = stream->readBytes( buffer, 1024 ); + auto bufferRange = asNonConstRange(buffer); for( sal_uInt64 pos = 0; pos < read && keyPos < key.size(); ++pos ) - buffer[ pos ] ^= key[ keyPos++ ]; + bufferRange[ pos ] ^= key[ keyPos++ ]; // if eot, don't write the file out yet, since we need to unpack it first. if( !eot && read > 0 ) { diff --git a/vcl/source/gdi/oldprintadaptor.cxx b/vcl/source/gdi/oldprintadaptor.cxx index 6a07eee9b619..599e1a543f3c 100644 --- a/vcl/source/gdi/oldprintadaptor.cxx +++ b/vcl/source/gdi/oldprintadaptor.cxx @@ -17,6 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ +#include <sal/config.h> + +#include <comphelper/propertyvalue.hxx> #include <vcl/oldprintadaptor.hxx> #include <vcl/gdimtf.hxx> @@ -88,16 +91,10 @@ int OldStylePrintAdaptor::getPageCount() const Sequence< PropertyValue > OldStylePrintAdaptor::getPageParameters( int i_nPage ) const { - Sequence< PropertyValue > aRet( 1 ); - aRet[0].Name = "PageSize"; + css::awt::Size aSize; if( i_nPage < int(mpData->maPages.size() ) ) - aRet[0].Value <<= mpData->maPages[i_nPage].maPageSize; - else - { - awt::Size aEmpty( 0, 0 ); - aRet[0].Value <<= aEmpty; - } - return aRet; + aSize = mpData->maPages[i_nPage].maPageSize; + return { comphelper::makePropertyValue("PageSize", css::uno::Any(aSize)) }; } void OldStylePrintAdaptor::printPage( int i_nPage ) const diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 8d1cc7310da3..c2fb49e84d87 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -35,6 +35,7 @@ #include <comphelper/fileformat.h> #include <comphelper/hash.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/io/XSeekable.hpp> @@ -203,11 +204,10 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz aAlphaMask = aBitmapEx.GetAlpha(); Graphic aGraphic(BitmapEx(aBitmapEx.GetBitmap())); - Sequence< PropertyValue > aFilterData( 2 ); - aFilterData[ 0 ].Name = "Quality"; - aFilterData[ 0 ].Value <<= sal_Int32(i_rContext.m_nJPEGQuality); - aFilterData[ 1 ].Name = "ColorMode"; - aFilterData[ 1 ].Value <<= sal_Int32(0); + Sequence< PropertyValue > aFilterData{ + comphelper::makePropertyValue("Quality", sal_Int32(i_rContext.m_nJPEGQuality)), + comphelper::makePropertyValue("ColorMode", sal_Int32(0)) + }; try { @@ -217,13 +217,11 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz uno::Reference< graphic::XGraphicProvider > xGraphicProvider( graphic::GraphicProvider::create(xContext) ); uno::Reference< graphic::XGraphic > xGraphic( aGraphic.GetXGraphic() ); uno::Reference < io::XOutputStream > xOut( xStream->getOutputStream() ); - uno::Sequence< beans::PropertyValue > aOutMediaProperties( 3 ); - aOutMediaProperties[0].Name = "OutputStream"; - aOutMediaProperties[0].Value <<= xOut; - aOutMediaProperties[1].Name = "MimeType"; - aOutMediaProperties[1].Value <<= OUString("image/jpeg"); - aOutMediaProperties[2].Name = "FilterData"; - aOutMediaProperties[2].Value <<= aFilterData; + uno::Sequence< beans::PropertyValue > aOutMediaProperties{ + comphelper::makePropertyValue("OutputStream", xOut), + comphelper::makePropertyValue("MimeType", OUString("image/jpeg")), + comphelper::makePropertyValue("FilterData", aFilterData) + }; xGraphicProvider->storeGraphic( xGraphic, aOutMediaProperties ); xOut->flush(); if ( !bIsJpeg && xSeekable->getLength() > nZippedFileSize ) @@ -235,9 +233,8 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz pStrm->Seek( STREAM_SEEK_TO_END ); xSeekable->seek( 0 ); - Sequence< PropertyValue > aArgs( 1 ); - aArgs[ 0 ].Name = "InputStream"; - aArgs[ 0 ].Value <<= xStream; + Sequence< PropertyValue > aArgs{ comphelper::makePropertyValue("InputStream", + xStream) }; uno::Reference< XPropertySet > xPropSet( xGraphicProvider->queryGraphicDescriptor( aArgs ) ); if ( xPropSet.is() ) { diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index dc48e55efa94..f33d59820caa 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -20,6 +20,7 @@ #include <sal/types.h> #include <sal/log.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> #include <tools/diagnose_ex.h> #include <tools/debug.hxx> @@ -1456,12 +1457,13 @@ css::uno::Sequence< css::beans::PropertyValue > PrinterController::getJobPropert aMergeSet.insert( rPropVal.Name ); css::uno::Sequence< css::beans::PropertyValue > aResult( nResultLen ); - std::copy(i_rMergeList.begin(), i_rMergeList.end(), aResult.getArray()); + auto pResult = aResult.getArray(); + std::copy(i_rMergeList.begin(), i_rMergeList.end(), pResult); int nCur = i_rMergeList.getLength(); for(const css::beans::PropertyValue & rPropVal : mpImplData->maUIProperties) { if( aMergeSet.find( rPropVal.Name ) == aMergeSet.end() ) - aResult[nCur++] = rPropVal; + pResult[nCur++] = rPropVal; } // append IsFirstPage if( aMergeSet.find( "IsFirstPage" ) == aMergeSet.end() ) @@ -1469,7 +1471,7 @@ css::uno::Sequence< css::beans::PropertyValue > PrinterController::getJobPropert css::beans::PropertyValue aVal; aVal.Name = "IsFirstPage"; aVal.Value <<= mpImplData->mbFirstPage; - aResult[nCur++] = aVal; + pResult[nCur++] = aVal; } // append IsLastPage if( aMergeSet.find( "IsLastPage" ) == aMergeSet.end() ) @@ -1477,7 +1479,7 @@ css::uno::Sequence< css::beans::PropertyValue > PrinterController::getJobPropert css::beans::PropertyValue aVal; aVal.Name = "IsLastPage"; aVal.Value <<= mpImplData->mbLastPage; - aResult[nCur++] = aVal; + pResult[nCur++] = aVal; } // append IsPrinter if( aMergeSet.find( "IsPrinter" ) == aMergeSet.end() ) @@ -1485,7 +1487,7 @@ css::uno::Sequence< css::beans::PropertyValue > PrinterController::getJobPropert css::beans::PropertyValue aVal; aVal.Name = "IsPrinter"; aVal.Value <<= true; - aResult[nCur++] = aVal; + pResult[nCur++] = aVal; } aResult.realloc( nCur ); return aResult; @@ -1880,10 +1882,8 @@ void PrinterOptionsHelper::appendPrintUIOptions( css::uno::Sequence< css::beans: { sal_Int32 nIndex = io_rProps.getLength(); io_rProps.realloc( nIndex+1 ); - css::beans::PropertyValue aVal; - aVal.Name = "ExtraPrintUIOptions"; - aVal.Value <<= comphelper::containerToSequence(m_aUIProperties); - io_rProps[ nIndex ] = aVal; + io_rProps.getArray()[ nIndex ] = comphelper::makePropertyValue( + "ExtraPrintUIOptions", comphelper::containerToSequence(m_aUIProperties)); } } @@ -1914,60 +1914,61 @@ css::uno::Any PrinterOptionsHelper::setUIControlOpt(const css::uno::Sequence< OU } css::uno::Sequence< css::beans::PropertyValue > aCtrl( nElements ); + auto pCtrl = aCtrl.getArray(); sal_Int32 nUsed = 0; if( !i_rTitle.isEmpty() ) { - aCtrl[nUsed ].Name = "Text"; - aCtrl[nUsed++].Value <<= i_rTitle; + pCtrl[nUsed ].Name = "Text"; + pCtrl[nUsed++].Value <<= i_rTitle; } if( i_rHelpIds.hasElements() ) { - aCtrl[nUsed ].Name = "HelpId"; - aCtrl[nUsed++].Value <<= i_rHelpIds; + pCtrl[nUsed ].Name = "HelpId"; + pCtrl[nUsed++].Value <<= i_rHelpIds; } - aCtrl[nUsed ].Name = "ControlType"; - aCtrl[nUsed++].Value <<= i_rType; - aCtrl[nUsed ].Name = "ID"; - aCtrl[nUsed++].Value <<= i_rIDs; + pCtrl[nUsed ].Name = "ControlType"; + pCtrl[nUsed++].Value <<= i_rType; + pCtrl[nUsed ].Name = "ID"; + pCtrl[nUsed++].Value <<= i_rIDs; if( i_pVal ) { - aCtrl[nUsed ].Name = "Property"; - aCtrl[nUsed++].Value <<= *i_pVal; + pCtrl[nUsed ].Name = "Property"; + pCtrl[nUsed++].Value <<= *i_pVal; } if( !i_rControlOptions.maDependsOnName.isEmpty() ) { - aCtrl[nUsed ].Name = "DependsOnName"; - aCtrl[nUsed++].Value <<= i_rControlOptions.maDependsOnName; + pCtrl[nUsed ].Name = "DependsOnName"; + pCtrl[nUsed++].Value <<= i_rControlOptions.maDependsOnName; if( i_rControlOptions.mnDependsOnEntry != -1 ) { - aCtrl[nUsed ].Name = "DependsOnEntry"; - aCtrl[nUsed++].Value <<= i_rControlOptions.mnDependsOnEntry; + pCtrl[nUsed ].Name = "DependsOnEntry"; + pCtrl[nUsed++].Value <<= i_rControlOptions.mnDependsOnEntry; } if( i_rControlOptions.mbAttachToDependency ) { - aCtrl[nUsed ].Name = "AttachToDependency"; - aCtrl[nUsed++].Value <<= i_rControlOptions.mbAttachToDependency; + pCtrl[nUsed ].Name = "AttachToDependency"; + pCtrl[nUsed++].Value <<= i_rControlOptions.mbAttachToDependency; } } if( !i_rControlOptions.maGroupHint.isEmpty() ) { - aCtrl[nUsed ].Name = "GroupingHint"; - aCtrl[nUsed++].Value <<= i_rControlOptions.maGroupHint; + pCtrl[nUsed ].Name = "GroupingHint"; + pCtrl[nUsed++].Value <<= i_rControlOptions.maGroupHint; } if( i_rControlOptions.mbInternalOnly ) { - aCtrl[nUsed ].Name = "InternalUIOnly"; - aCtrl[nUsed++].Value <<= true; + pCtrl[nUsed ].Name = "InternalUIOnly"; + pCtrl[nUsed++].Value <<= true; } if( ! i_rControlOptions.mbEnabled ) { - aCtrl[nUsed ].Name = "Enabled"; - aCtrl[nUsed++].Value <<= false; + pCtrl[nUsed ].Name = "Enabled"; + pCtrl[nUsed++].Value <<= false; } sal_Int32 nAddProps = i_rControlOptions.maAddProps.size(); for( sal_Int32 i = 0; i < nAddProps; i++ ) - aCtrl[ nUsed++ ] = i_rControlOptions.maAddProps[i]; + pCtrl[ nUsed++ ] = i_rControlOptions.maAddProps[i]; SAL_WARN_IF( nUsed != nElements, "vcl.gdi", "nUsed != nElements, probable heap corruption" ); diff --git a/vcl/source/helper/canvasbitmap.cxx b/vcl/source/helper/canvasbitmap.cxx index 68bef1b79b77..2eaa16223789 100644 --- a/vcl/source/helper/canvasbitmap.cxx +++ b/vcl/source/helper/canvasbitmap.cxx @@ -173,19 +173,15 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : m_nBitsPerInputPixel = 32; m_aLayout.IsMsbFirst = false; // doesn't matter - m_aComponentTags.realloc(4); - sal_Int8* pTags = m_aComponentTags.getArray(); - pTags[0] = rendering::ColorComponentTag::ALPHA; - pTags[1] = rendering::ColorComponentTag::RGB_BLUE; - pTags[2] = rendering::ColorComponentTag::RGB_GREEN; - pTags[3] = rendering::ColorComponentTag::RGB_RED; - - m_aComponentBitCounts.realloc(4); - sal_Int32* pCounts = m_aComponentBitCounts.getArray(); - pCounts[0] = 8; - pCounts[1] = 8; - pCounts[2] = 8; - pCounts[3] = 8; + m_aComponentTags = { /* 0 */ rendering::ColorComponentTag::ALPHA, + /* 1 */ rendering::ColorComponentTag::RGB_BLUE, + /* 2 */ rendering::ColorComponentTag::RGB_GREEN, + /* 3 */ rendering::ColorComponentTag::RGB_RED }; + + m_aComponentBitCounts = { /* 0 */ 8, + /* 1 */ 8, + /* 2 */ 8, + /* 3 */ 8 }; m_nRedIndex = 3; m_nGreenIndex = 2; @@ -200,19 +196,15 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : m_nBitsPerInputPixel = 32; m_aLayout.IsMsbFirst = false; // doesn't matter - m_aComponentTags.realloc(4); - sal_Int8* pTags = m_aComponentTags.getArray(); - pTags[0] = rendering::ColorComponentTag::ALPHA; - pTags[1] = rendering::ColorComponentTag::RGB_RED; - pTags[2] = rendering::ColorComponentTag::RGB_GREEN; - pTags[3] = rendering::ColorComponentTag::RGB_BLUE; + m_aComponentTags = { /* 0 */ rendering::ColorComponentTag::ALPHA, + /* 1 */ rendering::ColorComponentTag::RGB_RED, + /* 2 */ rendering::ColorComponentTag::RGB_GREEN, + /* 3 */ rendering::ColorComponentTag::RGB_BLUE }; - m_aComponentBitCounts.realloc(4); - sal_Int32* pCounts = m_aComponentBitCounts.getArray(); - pCounts[0] = 8; - pCounts[1] = 8; - pCounts[2] = 8; - pCounts[3] = 8; + m_aComponentBitCounts = { /* 0 */ 8, + /* 1 */ 8, + /* 2 */ 8, + /* 3 */ 8 }; m_nRedIndex = 1; m_nGreenIndex = 2; @@ -227,19 +219,15 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : m_nBitsPerInputPixel = 32; m_aLayout.IsMsbFirst = false; // doesn't matter - m_aComponentTags.realloc(4); - sal_Int8* pTags = m_aComponentTags.getArray(); - pTags[0] = rendering::ColorComponentTag::RGB_BLUE; - pTags[1] = rendering::ColorComponentTag::RGB_GREEN; - pTags[2] = rendering::ColorComponentTag::RGB_RED; - pTags[3] = rendering::ColorComponentTag::ALPHA; + m_aComponentTags = { /* 0 */ rendering::ColorComponentTag::RGB_BLUE, + /* 1 */ rendering::ColorComponentTag::RGB_GREEN, + /* 2 */ rendering::ColorComponentTag::RGB_RED, + /* 3 */ rendering::ColorComponentTag::ALPHA }; - m_aComponentBitCounts.realloc(4); - sal_Int32* pCounts = m_aComponentBitCounts.getArray(); - pCounts[0] = 8; - pCounts[1] = 8; - pCounts[2] = 8; - pCounts[3] = 8; + m_aComponentBitCounts = { /* 0 */ 8, + /* 1 */ 8, + /* 2 */ 8, + /* 3 */ 8 }; m_nRedIndex = 2; m_nGreenIndex = 1; @@ -254,19 +242,15 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : m_nBitsPerInputPixel = 32; m_aLayout.IsMsbFirst = false; // doesn't matter - m_aComponentTags.realloc(4); - sal_Int8* pTags = m_aComponentTags.getArray(); - pTags[0] = rendering::ColorComponentTag::RGB_RED; - pTags[1] = rendering::ColorComponentTag::RGB_GREEN; - pTags[2] = rendering::ColorComponentTag::RGB_BLUE; - pTags[3] = rendering::ColorComponentTag::ALPHA; + m_aComponentTags = { /* 0 */ rendering::ColorComponentTag::RGB_RED, + /* 1 */ rendering::ColorComponentTag::RGB_GREEN, + /* 2 */ rendering::ColorComponentTag::RGB_BLUE, + /* 3 */ rendering::ColorComponentTag::ALPHA }; - m_aComponentBitCounts.realloc(4); - sal_Int32* pCounts = m_aComponentBitCounts.getArray(); - pCounts[0] = 8; - pCounts[1] = 8; - pCounts[2] = 8; - pCounts[3] = 8; + m_aComponentBitCounts = { /* 0 */ 8, + /* 1 */ 8, + /* 2 */ 8, + /* 3 */ 8 }; m_nRedIndex = 0; m_nGreenIndex = 1; @@ -291,11 +275,9 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : if( m_bPalette ) { - m_aComponentTags.realloc(1); - m_aComponentTags[0] = rendering::ColorComponentTag::INDEX; + m_aComponentTags = { rendering::ColorComponentTag::INDEX }; - m_aComponentBitCounts.realloc(1); - m_aComponentBitCounts[0] = m_nBitsPerInputPixel; + m_aComponentBitCounts = { m_nBitsPerInputPixel }; m_nIndexIndex = 0; } @@ -318,10 +300,10 @@ VclCanvasBitmap::VclCanvasBitmap( const BitmapEx& rBitmap ) : // BMP_FORMAT_32BIT_XX_ARGB formats, duplicate alpha // channels might happen! m_aComponentTags.realloc(m_aComponentTags.getLength()+1); - m_aComponentTags[m_aComponentTags.getLength()-1] = rendering::ColorComponentTag::ALPHA; + m_aComponentTags.getArray()[m_aComponentTags.getLength()-1] = rendering::ColorComponentTag::ALPHA; m_aComponentBitCounts.realloc(m_aComponentBitCounts.getLength()+1); - m_aComponentBitCounts[m_aComponentBitCounts.getLength()-1] = m_aBmpEx.IsAlpha() ? 8 : 1; + m_aComponentBitCounts.getArray()[m_aComponentBitCounts.getLength()-1] = m_aBmpEx.IsAlpha() ? 8 : 1; // always add a full byte to the pixel size, otherwise // pixel packing hell breaks loose. diff --git a/vcl/source/outdev/outdev.cxx b/vcl/source/outdev/outdev.cxx index 78c4ff97d3bf..1083ff9b0d04 100644 --- a/vcl/source/outdev/outdev.cxx +++ b/vcl/source/outdev/outdev.cxx @@ -829,12 +829,13 @@ com::sun::star::uno::Reference< css::rendering::XCanvas > OutputDevice::ImplGetC 3: XWindow for creating Window (or empty for VirtualDevice) 4: SystemGraphicsData as a streamed Any */ - Sequence< Any > aArg(5); - aArg[ 0 ] <<= reinterpret_cast<sal_Int64>(this); - aArg[ 1 ] <<= css::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ); - aArg[ 2 ] <<= false; - aArg[ 3 ] <<= Reference< css::awt::XWindow >(); - aArg[ 4 ] = GetSystemGfxDataAny(); + Sequence< Any > aArg{ + Any(reinterpret_cast<sal_Int64>(this)), + Any(css::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight )), + Any(false), + Any(Reference< css::awt::XWindow >()), + GetSystemGfxDataAny() + }; Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); diff --git a/vcl/source/treelist/transfer.cxx b/vcl/source/treelist/transfer.cxx index 9d6be1feb0c2..35422acc2273 100644 --- a/vcl/source/treelist/transfer.cxx +++ b/vcl/source/treelist/transfer.cxx @@ -655,9 +655,10 @@ bool TransferableHelper::SetString( const OUString& rString, const DataFlavor& r { const OString aByteStr(OUStringToOString(rString, osl_getThreadTextEncoding())); Sequence< sal_Int8 > aSeq( aByteStr.getLength() + 1 ); + auto pSeq = aSeq.getArray(); - memcpy( aSeq.getArray(), aByteStr.getStr(), aByteStr.getLength() ); - aSeq[ aByteStr.getLength() ] = 0; + memcpy( pSeq, aByteStr.getStr(), aByteStr.getLength() ); + pSeq[ aByteStr.getLength() ] = 0; maAny <<= aSeq; } else diff --git a/vcl/source/treelist/transfer2.cxx b/vcl/source/treelist/transfer2.cxx index 9fdeae5071cc..c63770d8a4cc 100644 --- a/vcl/source/treelist/transfer2.cxx +++ b/vcl/source/treelist/transfer2.cxx @@ -499,8 +499,7 @@ Reference<XClipboard> GetSystemPrimarySelection() #if USING_X11 // A hack, making the primary selection available as an instance // of the SystemClipboard service on X11: - Sequence< Any > args(1); - args[0] <<= OUString("PRIMARY"); + Sequence< Any > args{ Any(OUString("PRIMARY")) }; xSelection.set(xContext->getServiceManager()->createInstanceWithArgumentsAndContext( "com.sun.star.datatransfer.clipboard.SystemClipboard", args, xContext), UNO_QUERY_THROW); #else diff --git a/vcl/source/uitest/uno/uiobject_uno.cxx b/vcl/source/uitest/uno/uiobject_uno.cxx index 2490a48c479b..d64a595442a4 100644 --- a/vcl/source/uitest/uno/uiobject_uno.cxx +++ b/vcl/source/uitest/uno/uiobject_uno.cxx @@ -9,12 +9,14 @@ #include <sal/config.h> +#include <algorithm> #include <atomic> #include <condition_variable> #include <memory> #include <mutex> #include "uiobject_uno.hxx" #include <utility> +#include <comphelper/propertyvalue.hxx> #include <cppuhelper/supportsservice.hxx> #include <tools/link.hxx> #include <vcl/svapp.hxx> @@ -161,13 +163,9 @@ css::uno::Sequence<css::beans::PropertyValue> UIObjectUnoObj::getState() SolarMutexGuard aGuard; StringMap aMap = mpObj->get_state(); css::uno::Sequence<css::beans::PropertyValue> aProps(aMap.size()); - sal_Int32 i = 0; - for (auto const& elem : aMap) - { - aProps[i].Name = elem.first; - aProps[i].Value <<= elem.second; - ++i; - } + std::transform(aMap.begin(), aMap.end(), aProps.getArray(), + [](auto const& elem) + { return comphelper::makePropertyValue(elem.first, elem.second); }); return aProps; } @@ -185,12 +183,7 @@ css::uno::Sequence<OUString> UIObjectUnoObj::getChildren() } css::uno::Sequence<OUString> aRet(aChildren.size()); - sal_Int32 i = 0; - for (auto const& child : aChildren) - { - aRet[i] = child; - ++i; - } + std::copy(aChildren.begin(), aChildren.end(), aRet.getArray()); return aRet; } diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index f443509af71d..dc50e3c11233 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -739,27 +739,29 @@ Reference< css::datatransfer::dnd::XDragSource > Window::GetDragSource() if( pEnvData ) { Sequence< Any > aDragSourceAL( 2 ), aDropTargetAL( 2 ); + auto pDragSourceAL = aDragSourceAL.getArray(); + auto pDropTargetAL = aDropTargetAL.getArray(); OUString aDragSourceSN, aDropTargetSN; #if defined(_WIN32) aDragSourceSN = "com.sun.star.datatransfer.dnd.OleDragSource"; aDropTargetSN = "com.sun.star.datatransfer.dnd.OleDropTarget"; - aDragSourceAL[ 1 ] <<= static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->hWnd) ); - aDropTargetAL[ 0 ] <<= static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->hWnd) ); + pDragSourceAL[ 1 ] <<= static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->hWnd) ); + pDropTargetAL[ 0 ] <<= static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->hWnd) ); #elif defined MACOSX /* FIXME: macOS specific dnd interface does not exist! * * Using Windows based dnd as a temporary solution */ aDragSourceSN = "com.sun.star.datatransfer.dnd.OleDragSource"; aDropTargetSN = "com.sun.star.datatransfer.dnd.OleDropTarget"; - aDragSourceAL[ 1 ] <<= static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->mpNSView) ); - aDropTargetAL[ 0 ] <<= static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->mpNSView) ); + pDragSourceAL[ 1 ] <<= static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->mpNSView) ); + pDropTargetAL[ 0 ] <<= static_cast<sal_uInt64>( reinterpret_cast<sal_IntPtr>(pEnvData->mpNSView) ); #elif USING_X11 aDragSourceSN = "com.sun.star.datatransfer.dnd.X11DragSource"; aDropTargetSN = "com.sun.star.datatransfer.dnd.X11DropTarget"; - aDragSourceAL[ 0 ] <<= Application::GetDisplayConnection(); - aDragSourceAL[ 1 ] <<= pEnvData->aShellWindow; - aDropTargetAL[ 0 ] <<= Application::GetDisplayConnection(); - aDropTargetAL[ 1 ] <<= pEnvData->aShellWindow; + pDragSourceAL[ 0 ] <<= Application::GetDisplayConnection(); + pDragSourceAL[ 1 ] <<= pEnvData->aShellWindow; + pDropTargetAL[ 0 ] <<= Application::GetDisplayConnection(); + pDropTargetAL[ 1 ] <<= pEnvData->aShellWindow; #endif if( !aDragSourceSN.isEmpty() ) mpWindowImpl->mpFrameData->mxDragSource.set( diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx index 61eea6837924..bfab65f2fa8a 100644 --- a/vcl/source/window/window.cxx +++ b/vcl/source/window/window.cxx @@ -3707,18 +3707,18 @@ bool Window::IsNativeWidgetEnabled() const Reference< css::rendering::XCanvas > WindowOutputDevice::ImplGetCanvas( bool bSpriteCanvas ) const { - Sequence< Any > aArg(5); - // Feed any with operating system's window handle // common: first any is VCL pointer to window (for VCL canvas) - aArg[ 0 ] <<= reinterpret_cast<sal_Int64>(this); - aArg[ 1 ] <<= css::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight ); - aArg[ 2 ] <<= mxOwnerWindow->mpWindowImpl->mbAlwaysOnTop; - aArg[ 3 ] <<= Reference< css::awt::XWindow >( + Sequence< Any > aArg{ + Any(reinterpret_cast<sal_Int64>(this)), + Any(css::awt::Rectangle( mnOutOffX, mnOutOffY, mnOutWidth, mnOutHeight )), + Any(mxOwnerWindow->mpWindowImpl->mbAlwaysOnTop), + Any(Reference< css::awt::XWindow >( mxOwnerWindow->GetComponentInterface(), - UNO_QUERY ); - aArg[ 4 ] = GetSystemGfxDataAny(); + UNO_QUERY )), + GetSystemGfxDataAny() + }; Reference< XComponentContext > xContext = comphelper::getProcessComponentContext(); diff --git a/vcl/unx/generic/dtrans/X11_service.cxx b/vcl/unx/generic/dtrans/X11_service.cxx index c05773dbad80..6738245cde6c 100644 --- a/vcl/unx/generic/dtrans/X11_service.cxx +++ b/vcl/unx/generic/dtrans/X11_service.cxx @@ -55,8 +55,7 @@ css::uno::Reference< XInterface > X11SalInstance::CreateClipboard( const Sequenc return SalInstance::CreateClipboard( arguments ); SelectionManager& rManager = SelectionManager::get(); - css::uno::Sequence<css::uno::Any> mgrArgs(1); - mgrArgs[0] <<= Application::GetDisplayConnection(); + css::uno::Sequence<css::uno::Any> mgrArgs{ css::uno::Any(Application::GetDisplayConnection()) }; rManager.initialize(mgrArgs); OUString sel; diff --git a/vcl/unx/generic/gdi/salgdi.cxx b/vcl/unx/generic/gdi/salgdi.cxx index 31567d63461a..43198c579bae 100644 --- a/vcl/unx/generic/gdi/salgdi.cxx +++ b/vcl/unx/generic/gdi/salgdi.cxx @@ -561,10 +561,11 @@ cairo::SurfaceSharedPtr X11SalGraphics::CreateBitmapSurface( const OutputDevice& css::uno::Any X11SalGraphics::GetNativeSurfaceHandle(cairo::SurfaceSharedPtr& rSurface, const basegfx::B2ISize& /*rSize*/) const { cairo::X11Surface& rXlibSurface=dynamic_cast<cairo::X11Surface&>(*rSurface); - css::uno::Sequence< css::uno::Any > args( 3 ); - args[0] <<= false; // do not call XFreePixmap on it - args[1] <<= sal_Int64(rXlibSurface.getPixmap()->mhDrawable); - args[2] <<= sal_Int32( rXlibSurface.getDepth() ); + css::uno::Sequence< css::uno::Any > args{ + css::uno::Any(false), // do not call XFreePixmap on it + css::uno::Any(sal_Int64(rXlibSurface.getPixmap()->mhDrawable)), + css::uno::Any(sal_Int32( rXlibSurface.getDepth() )) + }; return css::uno::Any(args); } diff --git a/vcl/unx/gtk3/a11y/atktextattributes.cxx b/vcl/unx/gtk3/a11y/atktextattributes.cxx index 31c5ebd3585b..f73d79aefe3f 100644 --- a/vcl/unx/gtk3/a11y/atktextattributes.cxx +++ b/vcl/unx/gtk3/a11y/atktextattributes.cxx @@ -1351,6 +1351,7 @@ attribute_set_map_to_property_values( { // Ensure enough space .. uno::Sequence< beans::PropertyValue > aAttributeList (SAL_N_ELEMENTS(g_TextAttrMap)); + auto pAttributeList = aAttributeList.getArray(); sal_Int32 nIndex = 0; for( GSList * item = attribute_set; item != nullptr; item = g_slist_next( item ) ) @@ -1362,11 +1363,11 @@ attribute_set_map_to_property_values( { if( g_TextAttrMap[text_attr].name[0] != '\0' ) { - if( ! g_TextAttrMap[text_attr].toPropertyValue( aAttributeList[nIndex].Value, attribute->value) ) + if( ! g_TextAttrMap[text_attr].toPropertyValue( pAttributeList[nIndex].Value, attribute->value) ) return false; - aAttributeList[nIndex].Name = OUString::createFromAscii( g_TextAttrMap[text_attr].name ); - aAttributeList[nIndex].State = beans::PropertyState_DIRECT_VALUE; + pAttributeList[nIndex].Name = OUString::createFromAscii( g_TextAttrMap[text_attr].name ); + pAttributeList[nIndex].State = beans::PropertyState_DIRECT_VALUE; ++nIndex; } } diff --git a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx index d0d852e99d5d..8c0e638d024b 100644 --- a/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk3/fpicker/SalGtkFilePicker.cxx @@ -749,6 +749,7 @@ uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() GTK_FILE_CHOOSER( m_pDialog )); uno::Sequence< OUString > aSelectedFiles(nCount); + auto aSelectedFilesRange = asNonConstRange(aSelectedFiles); // Convert to OOo #if !GTK_CHECK_VERSION(4, 0, 0) @@ -761,7 +762,7 @@ uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() gchar *pURI = g_file_get_uri(static_cast<GFile*>(pElem)); #endif - aSelectedFiles[ nIndex ] = uritounicode(pURI); + aSelectedFilesRange[ nIndex ] = uritounicode(pURI); if( GTK_FILE_CHOOSER_ACTION_SAVE == eAction ) { @@ -861,7 +862,7 @@ uno::Sequence<OUString> SAL_CALL SalGtkFilePicker::getSelectedFiles() { //if the filename does not already have the auto extension, stick it on OUString sExtension = "." + sToken; - OUString &rBase = aSelectedFiles[nIndex]; + OUString &rBase = aSelectedFilesRange[nIndex]; sal_Int32 nExtensionIdx = rBase.getLength() - sExtension.getLength(); SAL_INFO( "vcl.gtk", @@ -1248,12 +1249,13 @@ uno::Any SalGtkFilePicker::HandleGetListValue(GtkComboBox *pWidget, sal_Int16 nC pTree, nullptr); aItemList.realloc(nSize); + auto pItemList = aItemList.getArray(); for (sal_Int32 i=0; i < nSize; ++i) { gchar *item; gtk_tree_model_get(gtk_combo_box_get_model(pWidget), &iter, 0, &item, -1); - aItemList[i] = OUString(item, strlen(item), RTL_TEXTENCODING_UTF8); + pItemList[i] = OUString(item, strlen(item), RTL_TEXTENCODING_UTF8); g_free(item); (void)gtk_tree_model_iter_next(pTree, &iter); } diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx index 504172208e74..30fda52e5c79 100644 --- a/vcl/unx/gtk3/gtkinst.cxx +++ b/vcl/unx/gtk3/gtkinst.cxx @@ -59,6 +59,7 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <comphelper/lok.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertyvalue.hxx> #include <comphelper/sequence.hxx> #include <comphelper/string.hxx> #include <cppuhelper/compbase.hxx> @@ -4605,10 +4606,9 @@ namespace SvMemoryStream aMemStm; - css::uno::Sequence<css::beans::PropertyValue> aFilterData(1); - aFilterData[0].Name = "Compression"; // We "know" that this gets passed to zlib's deflateInit2_(). 1 means best speed. - aFilterData[0].Value <<= sal_Int32(1); + css::uno::Sequence<css::beans::PropertyValue> aFilterData{ comphelper::makePropertyValue( + "Compression", sal_Int32(1)) }; vcl::PNGWriter aWriter(aImage.GetBitmapEx(), &aFilterData); aWriter.Write(aMemStm); diff --git a/vcl/win/dtrans/DOTransferable.cxx b/vcl/win/dtrans/DOTransferable.cxx index 7b9f28203d7e..363601d7a0d7 100644 --- a/vcl/win/dtrans/DOTransferable.cxx +++ b/vcl/win/dtrans/DOTransferable.cxx @@ -367,7 +367,7 @@ void CDOTransferable::addSupportedFlavor( const DataFlavor& aFlavor ) OSL_ASSERT( isValidFlavor( aFlavor ) ); m_FlavorList.realloc( m_FlavorList.getLength( ) + 1 ); - m_FlavorList[m_FlavorList.getLength( ) - 1] = aFlavor; + m_FlavorList.getArray()[m_FlavorList.getLength( ) - 1] = aFlavor; } } diff --git a/vcl/workben/fftester.cxx b/vcl/workben/fftester.cxx index f700b0660f0f..218909dde6c7 100644 --- a/vcl/workben/fftester.cxx +++ b/vcl/workben/fftester.cxx @@ -129,8 +129,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) // initialise unconfigured UCB: css::uno::Reference<css::ucb::XUniversalContentBroker> xUcb(comphelper::getProcessServiceFactory()-> createInstance("com.sun.star.ucb.UniversalContentBroker"), css::uno::UNO_QUERY_THROW); - css::uno::Sequence<css::uno::Any> aArgs(1); - aArgs[0] <<= OUString("NoConfig"); + css::uno::Sequence<css::uno::Any> aArgs{ css::uno::Any(OUString("NoConfig")) }; css::uno::Reference<css::ucb::XContentProvider> xFileProvider(comphelper::getProcessServiceFactory()-> createInstanceWithArguments("com.sun.star.ucb.FileContentProvider", aArgs), css::uno::UNO_QUERY_THROW); xUcb->registerContentProvider(xFileProvider, "file", true);