diff options
47 files changed, 318 insertions, 436 deletions
diff --git a/chart2/qa/extras/PivotChartTest.cxx b/chart2/qa/extras/PivotChartTest.cxx index f1a345fa964c..d03afda37b2e 100644 --- a/chart2/qa/extras/PivotChartTest.cxx +++ b/chart2/qa/extras/PivotChartTest.cxx @@ -188,10 +188,8 @@ uno::Reference<sheet::XDataPilotTable> lclGetPivotTableByName(sal_Int32 nIndex, uno::Sequence<uno::Reference<chart2::data::XLabeledDataSequence>> lclGetCategories(Reference<chart2::XChartDocument> const & xChartDoc) { - uno::Sequence<beans::PropertyValue> aArguments(1); - aArguments[0] = beans::PropertyValue("CellRangeRepresentation", -1, - uno::makeAny<OUString>("PT@categories"), - beans::PropertyState_DIRECT_VALUE); + uno::Sequence<beans::PropertyValue> aArguments( comphelper::InitPropertySequence( + {{"CellRangeRepresentation", uno::Any(OUString("PT@categories"))}} )); uno::Reference<chart2::data::XDataProvider> xDataProvider(xChartDoc->getDataProvider(), uno::UNO_QUERY_THROW); return xDataProvider->createDataSource(aArguments)->getDataSequences(); diff --git a/chart2/source/model/main/ChartModel.cxx b/chart2/source/model/main/ChartModel.cxx index b83e04408b82..bef84f2006b3 100644 --- a/chart2/source/model/main/ChartModel.cxx +++ b/chart2/source/model/main/ChartModel.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/chart2/data/XPivotTableDataProvider.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/supportsservice.hxx> #include <svl/numuno.hxx> @@ -744,25 +745,12 @@ Reference< chart2::data::XDataSource > ChartModel::impl_createDefaultData() xIni->initialize(aArgs); } //create data - uno::Sequence<beans::PropertyValue> aArgs(4); - aArgs[0] = beans::PropertyValue( - "CellRangeRepresentation", -1, - uno::Any( OUString("all") ), beans::PropertyState_DIRECT_VALUE ); - aArgs[1] = beans::PropertyValue( - "HasCategories", - -1, - uno::Any( true ), - beans::PropertyState_DIRECT_VALUE ); - aArgs[2] = beans::PropertyValue( - "FirstCellAsLabel", - -1, - uno::Any( true ), - beans::PropertyState_DIRECT_VALUE ); - aArgs[3] = beans::PropertyValue( - "DataRowSource", - -1, - uno::Any( css::chart::ChartDataRowSource_COLUMNS ), - beans::PropertyState_DIRECT_VALUE ); + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "CellRangeRepresentation", uno::Any( OUString("all") ) }, + { "HasCategories", uno::Any( true ) }, + { "FirstCellAsLabel", uno::Any( true ) }, + { "DataRowSource", uno::Any( css::chart::ChartDataRowSource_COLUMNS ) } + })); xDataSource = m_xInternalDataProvider->createDataSource( aArgs ); } } diff --git a/i18npool/source/localedata/localedata.cxx b/i18npool/source/localedata/localedata.cxx index bded191b7020..4a349d4b30db 100644 --- a/i18npool/source/localedata/localedata.cxx +++ b/i18npool/source/localedata/localedata.cxx @@ -1293,8 +1293,7 @@ LocaleDataImpl::getContinuousNumberingLevels( const lang::Locale& rLocale ) return pv; } - Sequence< Sequence<beans::PropertyValue> > seq1(0); - return seq1; + return Sequence< Sequence<beans::PropertyValue> >(); } // OutlineNumbering helper class diff --git a/linguistic/source/gciterator.cxx b/linguistic/source/gciterator.cxx index 6b2540ab18ab..9d853dc567c8 100644 --- a/linguistic/source/gciterator.cxx +++ b/linguistic/source/gciterator.cxx @@ -54,6 +54,7 @@ #include <cppuhelper/supportsservice.hxx> #include <i18nlangtag/languagetag.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/extract.hxx> #include <deque> @@ -490,16 +491,12 @@ uno::Reference< linguistic2::XProofreader > GrammarCheckingIterator::GetGrammarC static uno::Sequence<beans::PropertyValue> lcl_makeProperties(uno::Reference<text::XFlatParagraph> const& xFlatPara) { - uno::Sequence<beans::PropertyValue> ret(2); uno::Reference<beans::XPropertySet> const xProps( xFlatPara, uno::UNO_QUERY_THROW); - ret[0] = beans::PropertyValue("FieldPositions", -1, - xProps->getPropertyValue("FieldPositions"), - beans::PropertyState_DIRECT_VALUE); - ret[1] = beans::PropertyValue("FootnotePositions", -1, - xProps->getPropertyValue("FootnotePositions"), - beans::PropertyState_DIRECT_VALUE); - return ret; + return comphelper::InitPropertySequence({ + { "FieldPositions", xProps->getPropertyValue("FieldPositions") }, + { "FootnotePositions", xProps->getPropertyValue("FootnotePositions") } + }); } void GrammarCheckingIterator::DequeueAndCheck() diff --git a/oox/source/export/shapes.cxx b/oox/source/export/shapes.cxx index 7d3090c1cd65..810391e22623 100644 --- a/oox/source/export/shapes.cxx +++ b/oox/source/export/shapes.cxx @@ -79,6 +79,7 @@ #include <tools/stream.hxx> #include <tools/globname.hxx> #include <comphelper/classids.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/storagehelper.hxx> #include <sot/exchange.hxx> #include <utility> @@ -275,11 +276,10 @@ static uno::Reference<io::XInputStream> lcl_StoreOwnAsOOXML( xContext->getServiceManager()->createInstanceWithContext( "com.sun.star.comp.MemoryStream", xContext), uno::UNO_QUERY_THROW); - uno::Sequence<beans::PropertyValue> args(2); - args[0].Name = "OutputStream"; - args[0].Value <<= xTempStream->getOutputStream(); - args[1].Name = "FilterName"; - args[1].Value <<= OUString::createFromAscii(pFilterName); + uno::Sequence<beans::PropertyValue> args( comphelper::InitPropertySequence({ + { "OutputStream", Any(xTempStream->getOutputStream()) }, + { "FilterName", Any(OUString::createFromAscii(pFilterName)) } + })); uno::Reference<frame::XStorable> xStorable(xObj->getComponent(), uno::UNO_QUERY); try { diff --git a/oox/source/vml/vmlformatting.cxx b/oox/source/vml/vmlformatting.cxx index cb7ea244c554..e2b4583ff7a2 100644 --- a/oox/source/vml/vmlformatting.cxx +++ b/oox/source/vml/vmlformatting.cxx @@ -35,6 +35,7 @@ #include <oox/token/properties.hxx> #include <oox/token/tokens.hxx> #include <svx/svdtrans.hxx> +#include <comphelper/propertysequence.hxx> namespace oox { namespace vml { @@ -864,15 +865,12 @@ TextpathModel::TextpathModel() beans::PropertyValue lcl_createTextpathProps() { - uno::Sequence<beans::PropertyValue> aTextpathPropSeq(4); - aTextpathPropSeq[0].Name = "TextPath"; - aTextpathPropSeq[0].Value <<= true; - aTextpathPropSeq[1].Name = "TextPathMode"; - aTextpathPropSeq[1].Value <<= drawing::EnhancedCustomShapeTextPathMode_SHAPE; - aTextpathPropSeq[2].Name = "ScaleX"; - aTextpathPropSeq[2].Value <<= false; - aTextpathPropSeq[3].Name = "SameLetterHeights"; - aTextpathPropSeq[3].Value <<= false; + uno::Sequence<beans::PropertyValue> aTextpathPropSeq( comphelper::InitPropertySequence({ + { "TextPath", uno::Any(true) }, + { "TextPathMode", uno::Any(drawing::EnhancedCustomShapeTextPathMode_SHAPE) }, + { "ScaleX", uno::Any(false) }, + { "SameLetterHeights", uno::Any(false) } + })); beans::PropertyValue aRet; aRet.Name = "TextPath"; diff --git a/reportdesign/source/ui/dlg/PageNumber.cxx b/reportdesign/source/ui/dlg/PageNumber.cxx index 2e28a3a2a479..cbe3fe9a7ef6 100644 --- a/reportdesign/source/ui/dlg/PageNumber.cxx +++ b/reportdesign/source/ui/dlg/PageNumber.cxx @@ -29,6 +29,7 @@ #include "UITools.hxx" #include "uistrings.hrc" #include "ReportController.hxx" +#include <comphelper/propertysequence.hxx> #include <algorithm> namespace rptui @@ -108,16 +109,11 @@ short OPageNumberDialog::Execute() if ( m_pAlignmentLst->GetSelectEntryPos() > 2 ) nPosX = nPos2X; - sal_Int32 nLength = 0; - uno::Sequence<beans::PropertyValue> aValues( 3 ); - aValues[nLength].Name = PROPERTY_POSITION; - aValues[nLength++].Value <<= awt::Point(nPosX,0); - - aValues[nLength].Name = PROPERTY_PAGEHEADERON; - aValues[nLength++].Value <<= m_pTopPage->IsChecked(); - - aValues[nLength].Name = PROPERTY_STATE; - aValues[nLength++].Value <<= m_pPageNofM->IsChecked(); + uno::Sequence<beans::PropertyValue> aValues( comphelper::InitPropertySequence({ + { PROPERTY_POSITION, uno::Any(awt::Point(nPosX,0)) }, + { PROPERTY_PAGEHEADERON, uno::Any(m_pTopPage->IsChecked()) }, + { PROPERTY_STATE, uno::Any(m_pPageNofM->IsChecked()) } + })); m_pController->executeChecked(SID_INSERT_FLD_PGNUMBER,aValues); } diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index 1568e477967f..355b6de39105 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -34,6 +34,7 @@ #include <unotools/mediadescriptor.hxx> #include <comphelper/processfactory.hxx> #include <comphelper/property.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/sequenceashashmap.hxx> #include <connectivity/dbtools.hxx> @@ -3004,11 +3005,10 @@ void OReportController::insertGraphic() { bool bLink = true; xController->getValue( ui::dialogs::ExtendedFilePickerElementIds::CHECKBOX_LINK, 0) >>= bLink; - uno::Sequence<beans::PropertyValue> aArgs(2); - aArgs[0].Name = PROPERTY_IMAGEURL; - aArgs[0].Value <<= aDialog.GetPath(); - aArgs[1].Name = PROPERTY_PRESERVEIRI; - aArgs[1].Value <<= bLink; + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { PROPERTY_IMAGEURL, Any(aDialog.GetPath()) }, + { PROPERTY_PRESERVEIRI, Any(bLink) } + })); createControl(aArgs,xSection,OUString(),OBJ_DLG_IMAGECONTROL); } } diff --git a/reportdesign/source/ui/report/dlgedfunc.cxx b/reportdesign/source/ui/report/dlgedfunc.cxx index a3bc7e3c3a3a..a513fab6efe1 100644 --- a/reportdesign/source/ui/report/dlgedfunc.cxx +++ b/reportdesign/source/ui/report/dlgedfunc.cxx @@ -51,6 +51,7 @@ #include <uistrings.hrc> #include "UndoEnv.hxx" #include <RptModel.hxx> +#include <comphelper/propertysequence.hxx> #include <tools/diagnose_ex.h> #define DEFAUL_MOVE_SIZE 100 @@ -169,9 +170,9 @@ bool DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) if ( rMEvt.GetClicks() > 1 ) { // show property browser - uno::Sequence<beans::PropertyValue> aArgs(1); - aArgs[0].Name = "ShowProperties"; - aArgs[0].Value <<= true; + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "ShowProperties", uno::Any(true) } + })); m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->getController().executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs); m_pParent->getSectionWindow()->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_rView); // TODO character in shapes diff --git a/sc/qa/extras/sccellrangeobj.cxx b/sc/qa/extras/sccellrangeobj.cxx index 40a3ebc638c1..07f6110d01fc 100644 --- a/sc/qa/extras/sccellrangeobj.cxx +++ b/sc/qa/extras/sccellrangeobj.cxx @@ -120,14 +120,13 @@ void ScCellRangeObj::testSortOOB() uno::Sequence<beans::PropertyValue> aEmptyDescriptor; xSortable->sort(aEmptyDescriptor); - uno::Sequence<beans::PropertyValue> aProps(1); uno::Sequence<util::SortField> aSort(1); - aSort[0].Field = 0xffffff; aSort[0].SortAscending = true; - aProps[0].Name = "SortFields"; - aProps[0].Value <<= aSort; + uno::Sequence<beans::PropertyValue> aProps( comphelper::InitPropertySequence({ + { "SortFields", Any(aSort) } + })); xSortable->sort(aProps); } diff --git a/sc/qa/unit/tiledrendering/tiledrendering.cxx b/sc/qa/unit/tiledrendering/tiledrendering.cxx index 565aa3bfe08c..3778f4be1093 100644 --- a/sc/qa/unit/tiledrendering/tiledrendering.cxx +++ b/sc/qa/unit/tiledrendering/tiledrendering.cxx @@ -209,13 +209,12 @@ void ScTiledRenderingTest::testRowColumnSelections() { comphelper::LibreOfficeKit::setActive(); ScModelObj* pModelObj = createDoc("select-row-cols.ods"); - uno::Sequence<beans::PropertyValue> aArgs(2); // Select the 5th row with no modifier - aArgs[0].Name = OUString::fromUtf8("Row"); - aArgs[0].Value <<= static_cast<sal_Int32>(5 - 1); - aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(0); + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "Row", uno::Any(sal_Int32(5 - 1)) }, + { "Modifier", uno::Any(sal_uInt16(0)) } + })); comphelper::dispatchCommand(".uno:SelectRow", aArgs); // Check if it is selected @@ -384,13 +383,12 @@ void ScTiledRenderingTest::testEmptyColumnSelection() { comphelper::LibreOfficeKit::setActive(); ScModelObj* pModelObj = createDoc("select-row-cols.ods"); - uno::Sequence<beans::PropertyValue> aArgs(2); // Select empty column, 1000 - aArgs[0].Name = OUString::fromUtf8("Col"); - aArgs[0].Value <<= static_cast<sal_Int32>(1000 - 1); - aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(0); + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "Col", uno::Any(sal_Int32(1000 - 1)) }, + { "Modifier", uno::Any(sal_uInt16(0)) } + })); comphelper::dispatchCommand(".uno:SelectColumn", aArgs); // Get plain selection @@ -640,15 +638,14 @@ void ScTiledRenderingTest::testColRowResize() pViewShell->registerLibreOfficeKitViewCallback(&ScTiledRenderingTest::callback, this); - uno::Sequence<beans::PropertyValue> aArgs(2); ScDocument& rDoc = pDocSh->GetDocument(); // Col 3, Tab 0 int nOldWidth = rDoc.GetColWidth(static_cast<SCCOL>(2), static_cast<SCTAB>(0), false); - aArgs[0].Name = OUString::fromUtf8("Column"); - aArgs[0].Value <<= static_cast<sal_Int16>(3); - aArgs[1].Name = OUString::fromUtf8("Width"); - aArgs[1].Value <<= static_cast<sal_uInt16>(nOldWidth + 100); + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "Column", uno::Any(sal_Int16(3)) }, + { "Width", uno::Any(sal_uInt16(nOldWidth + 100)) } + })); comphelper::dispatchCommand(".uno:ColumnWidth", aArgs); int nNewWidth = rDoc.GetColWidth(static_cast<SCCOL>(2), static_cast<SCTAB>(0), false); @@ -657,11 +654,11 @@ void ScTiledRenderingTest::testColRowResize() // Row 5, Tab 0 int nOldHeight = rDoc.GetRowHeight(static_cast<SCROW>(4), static_cast<SCTAB>(0), false); - aArgs[0].Name = OUString::fromUtf8("Row"); - aArgs[0].Value <<= static_cast<sal_Int16>(5); - aArgs[1].Name = OUString::fromUtf8("Height"); - aArgs[1].Value <<= static_cast<sal_uInt16>(nOldHeight + 100); - comphelper::dispatchCommand(".uno:RowHeight", aArgs); + uno::Sequence<beans::PropertyValue> aArgs2( comphelper::InitPropertySequence({ + { "Row", uno::Any(sal_Int16(5)) }, + { "Height", uno::Any(sal_uInt16(nOldHeight + 100)) } + })); + comphelper::dispatchCommand(".uno:RowHeight", aArgs2); int nNewHeight = rDoc.GetRowHeight(static_cast<SCROW>(4), static_cast<SCTAB>(0), false); CPPUNIT_ASSERT(nNewHeight > nOldHeight); @@ -902,21 +899,18 @@ void ScTiledRenderingTest::testHideColRow() comphelper::LibreOfficeKit::setActive(); createDoc("small.ods"); { - uno::Sequence<beans::PropertyValue> aArgs(2); - - aArgs[0].Name = OUString::fromUtf8("Col"); - aArgs[0].Value <<= static_cast<sal_Int32>(2 - 1); - aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= KEY_SHIFT; - + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "Col", uno::Any(sal_Int32(2 - 1)) }, + { "Modifier", uno::Any(KEY_SHIFT) } + })); comphelper::dispatchCommand(".uno:SelectColumn", aArgs); - aArgs[0].Name = OUString::fromUtf8("Col"); - aArgs[0].Value <<= static_cast<sal_Int32>(3 - 1); - aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(0); + uno::Sequence<beans::PropertyValue> aArgs2( comphelper::InitPropertySequence({ + { "Col", uno::Any(sal_Int32(3 - 1)) }, + { "Modifier", uno::Any(sal_uInt16(0)) } + })); - comphelper::dispatchCommand(".uno:SelectColumn", aArgs); + comphelper::dispatchCommand(".uno:SelectColumn", aArgs2); Scheduler::ProcessEventsToIdle(); } @@ -933,21 +927,17 @@ void ScTiledRenderingTest::testHideColRow() CPPUNIT_ASSERT(nNewCurX > nOldCurX); CPPUNIT_ASSERT_EQUAL(nOldCurY, nNewCurY); { - uno::Sequence<beans::PropertyValue> aArgs(2); - - aArgs[0].Name = OUString::fromUtf8("Row"); - aArgs[0].Value <<= static_cast<sal_Int32>(6 - 1); - aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= KEY_SHIFT; - + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "Row", uno::Any(sal_Int32(6 - 1)) }, + { "Modifier", uno::Any(KEY_SHIFT) } + })); comphelper::dispatchCommand(".uno:SelectRow", aArgs); - aArgs[0].Name = OUString::fromUtf8("Row"); - aArgs[0].Value <<= static_cast<sal_Int32>(7 - 1); - aArgs[1].Name = OUString::fromUtf8("Modifier"); - aArgs[1].Value <<= static_cast<sal_uInt16>(0); - - comphelper::dispatchCommand(".uno:SelectRow", aArgs); + uno::Sequence<beans::PropertyValue> aArgs2( comphelper::InitPropertySequence({ + { "Row", uno::Any(sal_Int32(7 - 1)) }, + { "Modifier", uno::Any(sal_uInt16(0)) } + })); + comphelper::dispatchCommand(".uno:SelectRow", aArgs2); Scheduler::ProcessEventsToIdle(); } @@ -1301,9 +1291,9 @@ void ScTiledRenderingTest::testInsertGraphicInvalidations() // insert an image in view and see if both views are invalidated aView.m_bInvalidateTiles = false; - uno::Sequence<beans::PropertyValue> aArgs(1); - aArgs[0].Name = OUString::fromUtf8("FileName"); - aArgs[0].Value <<= (m_directories.getURLFromSrc(DATA_DIRECTORY) + "smile.png"); + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "FileName", uno::Any(m_directories.getURLFromSrc(DATA_DIRECTORY) + "smile.png") } + })); comphelper::dispatchCommand(".uno:InsertGraphic", aArgs); Scheduler::ProcessEventsToIdle(); CPPUNIT_ASSERT(aView.m_bInvalidateTiles); diff --git a/sc/source/filter/xml/XMLStylesExportHelper.cxx b/sc/source/filter/xml/XMLStylesExportHelper.cxx index a9d0464a82d8..6236dd6e7369 100644 --- a/sc/source/filter/xml/XMLStylesExportHelper.cxx +++ b/sc/source/filter/xml/XMLStylesExportHelper.cxx @@ -33,6 +33,7 @@ #include <com/sun/star/sheet/XSheetCondition.hpp> #include <com/sun/star/sheet/TableValidationVisibility.hpp> #include <comphelper/extract.hxx> +#include <comphelper/propertysequence.hxx> #include <sfx2/app.hxx> #include <o3tl/make_unique.hxx> @@ -411,15 +412,11 @@ void ScMyValidationsContainer::WriteValidations(ScXMLExport& rExport) bool bScriptURL = SfxApplication::IsXScriptURL( aItr->sErrorTitle ); const OUString sScript("Script"); - uno::Sequence<beans::PropertyValue> aSeq(3); - beans::PropertyValue* pArr(aSeq.getArray()); - pArr[0].Name = "EventType"; - pArr[0].Value <<= bScriptURL ? sScript : OUString("StarBasic"); - pArr[1].Name = "Library"; - pArr[1].Value <<= OUString(); - pArr[2].Name = bScriptURL ? sScript : OUString("MacroName"); - pArr[2].Value <<= aItr->sErrorTitle; - + uno::Sequence<beans::PropertyValue> aSeq( comphelper::InitPropertySequence({ + { "EventType", uno::Any(bScriptURL ? sScript : OUString("StarBasic")) }, + { "Library", uno::Any(OUString()) }, + { bScriptURL ? sScript : OUString("MacroName"), uno::Any(aItr->sErrorTitle) } + })); // 2) export the sequence rExport.GetEventExport().ExportSingleEvent( aSeq, "OnError"); } diff --git a/sc/source/filter/xml/xmlwrap.cxx b/sc/source/filter/xml/xmlwrap.cxx index 0e702d0e5a13..880c2f5320ea 100644 --- a/sc/source/filter/xml/xmlwrap.cxx +++ b/sc/source/filter/xml/xmlwrap.cxx @@ -24,6 +24,7 @@ #include <sot/storage.hxx> #include <osl/diagnose.h> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <unotools/streamwrap.hxx> #include <svx/xmlgrhlp.hxx> #include <svtools/sfxecode.hxx> @@ -747,10 +748,9 @@ bool ScXMLImportWrapper::Export(bool bStylesOnly) if (pMedium) sFileName = pMedium->GetName(); SfxObjectShell* pObjSh = rDoc.GetDocumentShell(); - uno::Sequence<beans::PropertyValue> aDescriptor(1); - beans::PropertyValue* pProps = aDescriptor.getArray(); - pProps[0].Name = "FileName"; - pProps[0].Value <<= sFileName; + uno::Sequence<beans::PropertyValue> aDescriptor( comphelper::InitPropertySequence({ + { "FileName", uno::Any(sFileName) } + })); /** property map for export info set */ comphelper::PropertyMapEntry const aExportInfoMap[] = diff --git a/sc/source/ui/docshell/docsh8.cxx b/sc/source/ui/docshell/docsh8.cxx index fe715fa66cf6..85d73f4070d7 100644 --- a/sc/source/ui/docshell/docsh8.cxx +++ b/sc/source/ui/docshell/docsh8.cxx @@ -23,6 +23,7 @@ #include <tools/urlobj.hxx> #include <svl/converter.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/string.hxx> #include <comphelper/types.hxx> #include <ucbhelper/content.hxx> @@ -140,11 +141,10 @@ namespace aCharSetStr = OUString::createFromAscii( pIanaName ); } - uno::Sequence<beans::PropertyValue> aProps(2); - aProps[0].Name = SC_DBPROP_EXTENSION; - aProps[0].Value <<= aExtension; - aProps[1].Name = SC_DBPROP_CHARSET; - aProps[1].Value <<= aCharSetStr; + uno::Sequence<beans::PropertyValue> aProps( comphelper::InitPropertySequence({ + { SC_DBPROP_EXTENSION, uno::Any(aExtension) }, + { SC_DBPROP_CHARSET, uno::Any(aCharSetStr) } + })); _rConnection = _rDrvMgr->getConnectionWithInfo( aConnUrl, aProps ); return 0L; diff --git a/sc/source/ui/unoobj/PivotTableDataProvider.cxx b/sc/source/ui/unoobj/PivotTableDataProvider.cxx index 65046a075021..7e13f3429eb7 100644 --- a/sc/source/ui/unoobj/PivotTableDataProvider.cxx +++ b/sc/source/ui/unoobj/PivotTableDataProvider.cxx @@ -26,6 +26,7 @@ #include <vcl/svapp.hxx> #include <sfx2/objsh.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/sequence.hxx> #include <com/sun/star/chart2/data/LabeledDataSequence.hpp> @@ -699,26 +700,15 @@ uno::Reference<chart2::data::XDataSource> uno::Sequence<beans::PropertyValue> SAL_CALL PivotTableDataProvider::detectArguments( const uno::Reference<chart2::data::XDataSource> & xDataSource) { - uno::Sequence<beans::PropertyValue> aArguments; - if (!m_pDocument ||!xDataSource.is()) - return aArguments; - - aArguments.realloc(4); - - aArguments[0] = beans::PropertyValue("CellRangeRepresentation", -1, uno::Any(OUString("PivotChart")), - beans::PropertyState_DIRECT_VALUE); - - aArguments[1] = beans::PropertyValue("DataRowSource", -1, uno::Any(chart::ChartDataRowSource_COLUMNS), - beans::PropertyState_DIRECT_VALUE); - - aArguments[2] = beans::PropertyValue("FirstCellAsLabel", -1, uno::Any(false), - beans::PropertyState_DIRECT_VALUE); - - aArguments[3] = beans::PropertyValue("HasCategories", -1, uno::Any(true), - beans::PropertyState_DIRECT_VALUE); - - return aArguments; + return uno::Sequence<beans::PropertyValue>(); + + return comphelper::InitPropertySequence({ + { "CellRangeRepresentation", uno::Any(OUString("PivotChart")) }, + { "DataRowSource", uno::Any(chart::ChartDataRowSource_COLUMNS) }, + { "FirstCellAsLabel", uno::Any(false) }, + { "HasCategories", uno::Any(true) } + }); } sal_Bool SAL_CALL PivotTableDataProvider::createDataSequenceByRangeRepresentationPossible(const OUString& /*aRangeRepresentation*/) diff --git a/sc/source/ui/unoobj/TablePivotCharts.cxx b/sc/source/ui/unoobj/TablePivotCharts.cxx index e07be4068e59..16d260fec458 100644 --- a/sc/source/ui/unoobj/TablePivotCharts.cxx +++ b/sc/source/ui/unoobj/TablePivotCharts.cxx @@ -23,6 +23,7 @@ #include <svx/charthelper.hxx> #include <sfx2/app.hxx> #include <unotools/moduleoptions.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/classids.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/globname.hxx> @@ -145,10 +146,11 @@ void SAL_CALL TablePivotCharts::addNewByName(OUString const & rName, uno::Reference<util::XNumberFormatsSupplier> xNumberFormatsSupplier(m_pDocShell->GetModel(), uno::UNO_QUERY); xReceiver->attachNumberFormatsSupplier(xNumberFormatsSupplier); - uno::Sequence<beans::PropertyValue> aArgs(3); - aArgs[0] = beans::PropertyValue("CellRangeRepresentation", -1, uno::makeAny(rDataPilotName), beans::PropertyState_DIRECT_VALUE); - aArgs[1] = beans::PropertyValue("HasCategories", -1, uno::makeAny(true), beans::PropertyState_DIRECT_VALUE); - aArgs[2] = beans::PropertyValue("DataRowSource", -1, uno::makeAny(chart::ChartDataRowSource_COLUMNS), beans::PropertyState_DIRECT_VALUE); + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "CellRangeRepresentation", uno::makeAny(rDataPilotName) }, + { "HasCategories", uno::makeAny(true) }, + { "DataRowSource", uno::makeAny(chart::ChartDataRowSource_COLUMNS) } + })); xReceiver->setArguments(aArgs); } diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx index 99d8add7102b..6a18af374367 100644 --- a/sc/source/ui/unoobj/dapiuno.cxx +++ b/sc/source/ui/unoobj/dapiuno.cxx @@ -57,6 +57,7 @@ #include <com/sun/star/sheet/GeneralFunction2.hpp> #include <comphelper/extract.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/sequence.hxx> #include <comphelper/servicehelper.hxx> @@ -958,22 +959,18 @@ Any SAL_CALL ScDataPilotDescriptorBase::getPropertyValue( const OUString& aPrope const ScDPServiceDesc* pServiceDesc = pDPObject->GetDPServiceDesc(); if (pServiceDesc) { - uno::Sequence<beans::PropertyValue> aSeq( 4 ); - beans::PropertyValue* pArray = aSeq.getArray(); - pArray[0].Name = SC_UNO_DP_SOURCENAME; - pArray[0].Value <<= pServiceDesc->aParSource; - pArray[1].Name = SC_UNO_DP_OBJECTNAME; - pArray[1].Value <<= pServiceDesc->aParName; - pArray[2].Name = SC_UNO_DP_USERNAME; - pArray[2].Value <<= pServiceDesc->aParUser; - pArray[3].Name = SC_UNO_DP_PASSWORD; - pArray[3].Value <<= pServiceDesc->aParPass; + uno::Sequence<beans::PropertyValue> aSeq( comphelper::InitPropertySequence({ + { SC_UNO_DP_SOURCENAME, Any(pServiceDesc->aParSource) }, + { SC_UNO_DP_OBJECTNAME, Any(pServiceDesc->aParName) }, + { SC_UNO_DP_USERNAME, Any(pServiceDesc->aParUser) }, + { SC_UNO_DP_PASSWORD, Any(pServiceDesc->aParPass) } + })); aRet <<= aSeq; } else { // empty sequence - uno::Sequence<beans::PropertyValue> aEmpty(0); + uno::Sequence<beans::PropertyValue> aEmpty; aRet <<= aEmpty; } } diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index 5df2608e73e6..305e788670cb 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -34,6 +34,7 @@ #include <LibreOfficeKit/LibreOfficeKitEnums.h> #include <comphelper/lok.hxx> +#include <comphelper/propertysequence.hxx> #include <officecfg/Office/Common.hxx> #include <officecfg/Office/Calc.hxx> #include <svl/numuno.hxx> @@ -1644,10 +1645,9 @@ uno::Sequence<beans::PropertyValue> SAL_CALL ScModelObj::getRenderer( sal_Int32 Size aTwips = aDefaultFunc.GetPageSize(); awt::Size aPageSize( TwipsToHMM( aTwips.Width() ), TwipsToHMM( aTwips.Height() ) ); - uno::Sequence<beans::PropertyValue> aSequence(1); - beans::PropertyValue* pArray = aSequence.getArray(); - pArray[0].Name = SC_UNONAME_PAGESIZE; - pArray[0].Value <<= aPageSize; + uno::Sequence<beans::PropertyValue> aSequence( comphelper::InitPropertySequence({ + { SC_UNONAME_PAGESIZE, uno::Any(aPageSize) } + })); if( ! pPrinterOptions ) pPrinterOptions = new ScPrintUIOptions; diff --git a/sc/source/ui/unoobj/eventuno.cxx b/sc/source/ui/unoobj/eventuno.cxx index 1ab409416273..e54a6938a94e 100644 --- a/sc/source/ui/unoobj/eventuno.cxx +++ b/sc/source/ui/unoobj/eventuno.cxx @@ -22,6 +22,7 @@ #include "docsh.hxx" #include "sheetevents.hxx" #include "unonames.hxx" +#include <comphelper/propertysequence.hxx> #include <vcl/svapp.hxx> using namespace ::com::sun::star; @@ -132,13 +133,10 @@ uno::Any SAL_CALL ScSheetEventsObj::getByName( const OUString& aName ) uno::Any aRet; if (pScript) { - uno::Sequence<beans::PropertyValue> aPropSeq( 2 ); - aPropSeq[0] = beans::PropertyValue( - "EventType", -1, - uno::makeAny( OUString("Script") ), beans::PropertyState_DIRECT_VALUE ); - aPropSeq[1] = beans::PropertyValue( - "Script", -1, - uno::makeAny( *pScript ), beans::PropertyState_DIRECT_VALUE ); + uno::Sequence<beans::PropertyValue> aPropSeq( comphelper::InitPropertySequence({ + { "EventType", uno::Any( OUString("Script") ) }, + { "Script", uno::Any( *pScript ) } + })); aRet <<= aPropSeq; } // empty Any if nothing was set diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx index 7b805717aae6..f31eba2295bf 100644 --- a/sc/source/ui/unoobj/filtuno.cxx +++ b/sc/source/ui/unoobj/filtuno.cxx @@ -39,6 +39,7 @@ #include <optutil.hxx> #include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Sequence.hxx> +#include <comphelper/propertysequence.hxx> #include <memory> using namespace com::sun::star; @@ -119,13 +120,9 @@ Calc_FilterOptionsDialog_get_implementation(css::uno::XComponentContext*, css::u uno::Sequence<beans::PropertyValue> SAL_CALL ScFilterOptionsObj::getPropertyValues() { - uno::Sequence<beans::PropertyValue> aRet(1); - beans::PropertyValue* pArray = aRet.getArray(); - - pArray[0].Name = SC_UNONAME_FILTEROPTIONS; - pArray[0].Value <<= aFilterOptions; - - return aRet; + return comphelper::InitPropertySequence({ + { SC_UNONAME_FILTEROPTIONS, Any(aFilterOptions) } + }); } void SAL_CALL ScFilterOptionsObj::setPropertyValues( const uno::Sequence<beans::PropertyValue>& aProps ) diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index b4266155f859..33600f6165ee 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -51,6 +51,7 @@ #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> #include <com/sun/star/lang/Locale.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/supportsservice.hxx> #include "styleuno.hxx" @@ -529,20 +530,11 @@ void SAL_CALL ScStyleFamiliesObj::loadStylesFromURL( const OUString& aURL, uno::Sequence<beans::PropertyValue> SAL_CALL ScStyleFamiliesObj::getStyleLoaderOptions() { // return defaults for options (?) - - uno::Sequence<beans::PropertyValue> aSequence(3); - beans::PropertyValue* pArray = aSequence.getArray(); - - pArray[0].Name = SC_UNONAME_OVERWSTL; - pArray[0].Value <<= true; - - pArray[1].Name = SC_UNONAME_LOADCELL; - pArray[1].Value <<= true; - - pArray[2].Name = SC_UNONAME_LOADPAGE; - pArray[2].Value <<= true; - - return aSequence; + return comphelper::InitPropertySequence({ + { SC_UNONAME_OVERWSTL, uno::Any(true) }, + { SC_UNONAME_LOADCELL, uno::Any(true) }, + { SC_UNONAME_LOADPAGE, uno::Any(true) } + }); } // style::XStyleLoader2 diff --git a/sdext/source/pdfimport/wrapper/wrapper.cxx b/sdext/source/pdfimport/wrapper/wrapper.cxx index a31e78cb1100..1fa018c5bd31 100644 --- a/sdext/source/pdfimport/wrapper/wrapper.cxx +++ b/sdext/source/pdfimport/wrapper/wrapper.cxx @@ -35,6 +35,7 @@ #include "rtl/strbuf.hxx" #include "rtl/byteseq.hxx" +#include <comphelper/propertysequence.hxx> #include "cppuhelper/exc_hlp.hxx" #include "com/sun/star/io/XInputStream.hpp" #include "com/sun/star/uno/XComponentContext.hpp" @@ -718,19 +719,11 @@ uno::Sequence<beans::PropertyValue> Parser::readImageImpl() xFactory->createInstanceWithArgumentsAndContext( "com.sun.star.io.SequenceInputStream", aStreamCreationArgs, m_xContext ), uno::UNO_QUERY_THROW ); - uno::Sequence<beans::PropertyValue> aSequence(3); - aSequence[0] = beans::PropertyValue( "URL", - 0, - uno::makeAny(aFileName), - beans::PropertyState_DIRECT_VALUE ); - aSequence[1] = beans::PropertyValue( "InputStream", - 0, - uno::makeAny( xDataStream ), - beans::PropertyState_DIRECT_VALUE ); - aSequence[2] = beans::PropertyValue( "InputSequence", - 0, - uno::makeAny(aDataSequence), - beans::PropertyState_DIRECT_VALUE ); + uno::Sequence<beans::PropertyValue> aSequence( comphelper::InitPropertySequence({ + { "URL", uno::makeAny(aFileName) }, + { "InputStream", uno::makeAny( xDataStream ) }, + { "InputSequence", uno::makeAny(aDataSequence) } + })); return aSequence; } diff --git a/sfx2/source/control/emojicontrol.cxx b/sfx2/source/control/emojicontrol.cxx index e71a30ff60d4..58650a604983 100644 --- a/sfx2/source/control/emojicontrol.cxx +++ b/sfx2/source/control/emojicontrol.cxx @@ -160,18 +160,16 @@ IMPL_LINK_NOARG(SfxEmojiControl, ActivatePageHdl, TabControl*, void) IMPL_STATIC_LINK(SfxEmojiControl, InsertHdl, ThumbnailViewItem*, pItem, void) { - OUStringBuffer sHexText = ""; - sHexText.appendUtf32(pItem->getTitle().toUInt32(16)); + OUString sHexText = OUString::number(pItem->getTitle().toUInt32(16)); uno::Reference< uno::XComponentContext > xContext( comphelper::getProcessComponentContext() ); OUString sFontName(officecfg::Office::Common::Misc::EmojiFont::get(xContext)); - uno::Sequence<beans::PropertyValue> aArgs(2); - aArgs[0].Name = OUString::fromUtf8("Symbols"); - aArgs[0].Value <<= sHexText.toString(); - //add font settings here - aArgs[1].Name = OUString::fromUtf8("FontName"); - aArgs[1].Value <<= sFontName; + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "Symbols", uno::Any(sHexText) }, + // add font settings here + { "FontName", uno::Any(sFontName) } + })); comphelper::dispatchCommand(".uno:InsertSymbol", aArgs); } diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx index b4e59a4ce3f2..0ea4a1f093c2 100644 --- a/sfx2/source/doc/doctemplates.cxx +++ b/sfx2/source/doc/doctemplates.cxx @@ -27,6 +27,7 @@ #include <vcl/wrkwin.hxx> #include <unotools/pathoptions.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/sequenceashashmap.hxx> #include <comphelper/storagehelper.hxx> #include <comphelper/string.hxx> @@ -614,11 +615,10 @@ bool SfxDocTplService_Impl::setTitleForURL( const OUString& rURL, const OUString uno::Reference< embed::XStorage > xStorage = ::comphelper::OStorageHelper::GetStorageFromURL( rURL, embed::ElementModes::READWRITE); - uno::Sequence<beans::PropertyValue> medium(2); - medium[0].Name = "DocumentBaseURL"; - medium[0].Value <<= rURL; - medium[1].Name = "URL"; - medium[1].Value <<= rURL; + uno::Sequence<beans::PropertyValue> medium( comphelper::InitPropertySequence({ + { "DocumentBaseURL", Any(rURL) }, + { "URL", Any(rURL) } + })); m_xDocProps->storeToStorage(xStorage, medium); return true; diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index c3cbdb3712ca..db889ac89788 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -3345,10 +3345,8 @@ void SfxBaseModel::getGrabBagItem(css::uno::Any& rVal) const { if (m_pData->m_xGrabBagItem.get()) m_pData->m_xGrabBagItem->QueryValue(rVal); - else { - uno::Sequence<beans::PropertyValue> aValue(0); - rVal <<= aValue; - } + else + rVal <<= uno::Sequence<beans::PropertyValue>(); } void SfxBaseModel::setGrabBagItem(const css::uno::Any& rVal) diff --git a/svl/source/numbers/numfmuno.cxx b/svl/source/numbers/numfmuno.cxx index ee05e50a581f..efb1555edcda 100644 --- a/svl/source/numbers/numfmuno.cxx +++ b/svl/source/numbers/numfmuno.cxx @@ -28,6 +28,7 @@ #include <com/sun/star/util/MalformedNumberFormatException.hpp> #include <com/sun/star/util/NotNumericException.hpp> #include <com/sun/star/beans/PropertyAttribute.hpp> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/supportsservice.hxx> #include "numfmuno.hxx" @@ -807,35 +808,21 @@ uno::Sequence<beans::PropertyValue> SAL_CALL SvNumberFormatObj::getPropertyValue pFormat->GetFormatSpecialInfo( bThousand, bRed, nDecimals, nLeading ); lang::Locale aLocale( LanguageTag( pFormat->GetLanguage()).getLocale()); - uno::Sequence<beans::PropertyValue> aSeq(13); - beans::PropertyValue* pArray = aSeq.getArray(); - - pArray[0].Name = PROPERTYNAME_FMTSTR; - pArray[0].Value <<= aFmtStr; - pArray[1].Name = PROPERTYNAME_LOCALE; - pArray[1].Value <<= aLocale; - pArray[2].Name = PROPERTYNAME_TYPE; - pArray[2].Value <<= (sal_Int16)( pFormat->GetType() ); - pArray[3].Name = PROPERTYNAME_COMMENT; - pArray[3].Value <<= aComment; - pArray[4].Name = PROPERTYNAME_STDFORM; - pArray[4].Value <<= bStandard; - pArray[5].Name = PROPERTYNAME_USERDEF; - pArray[5].Value <<= bUserDef; - pArray[6].Name = PROPERTYNAME_DECIMALS; - pArray[6].Value <<= (sal_Int16)( nDecimals ); - pArray[7].Name = PROPERTYNAME_LEADING; - pArray[7].Value <<= (sal_Int16)( nLeading ); - pArray[8].Name = PROPERTYNAME_NEGRED; - pArray[8].Value <<= bRed; - pArray[9].Name = PROPERTYNAME_THOUS; - pArray[9].Value <<= bThousand; - pArray[10].Name = PROPERTYNAME_CURRSYM; - pArray[10].Value <<= aSymbol; - pArray[11].Name = PROPERTYNAME_CURREXT; - pArray[11].Value <<= aExt; - pArray[12].Name = PROPERTYNAME_CURRABB; - pArray[12].Value <<= aAbb; + uno::Sequence<beans::PropertyValue> aSeq( comphelper::InitPropertySequence({ + { PROPERTYNAME_FMTSTR, uno::Any(aFmtStr) }, + { PROPERTYNAME_LOCALE, uno::Any(aLocale) }, + { PROPERTYNAME_TYPE, uno::Any(sal_Int16( pFormat->GetType() )) }, + { PROPERTYNAME_COMMENT, uno::Any(aComment) }, + { PROPERTYNAME_STDFORM, uno::Any(bStandard) }, + { PROPERTYNAME_USERDEF, uno::Any(bUserDef) }, + { PROPERTYNAME_DECIMALS, uno::Any(sal_Int16( nDecimals )) }, + { PROPERTYNAME_LEADING, uno::Any(sal_Int16( nLeading )) }, + { PROPERTYNAME_NEGRED, uno::Any(bRed) }, + { PROPERTYNAME_THOUS, uno::Any(bThousand) }, + { PROPERTYNAME_CURRSYM, uno::Any(aSymbol) }, + { PROPERTYNAME_CURREXT, uno::Any(aExt) }, + { PROPERTYNAME_CURRABB, uno::Any(aAbb) } + })); return aSeq; } diff --git a/svtools/source/misc/embedtransfer.cxx b/svtools/source/misc/embedtransfer.cxx index 3994929b69b0..6bf862dc1080 100644 --- a/svtools/source/misc/embedtransfer.cxx +++ b/svtools/source/misc/embedtransfer.cxx @@ -28,6 +28,7 @@ #include <svtools/embedtransfer.hxx> #include <tools/mapunit.hxx> #include <vcl/outdev.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/storagehelper.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotools/streamwrap.hxx> @@ -112,11 +113,10 @@ bool SvEmbedTransferHelper::GetData( const css::datatransfer::DataFlavor& rFlavo SvStream* pStream = nullptr; bool bDeleteStream = false; uno::Sequence < beans::PropertyValue > aEmpty; - uno::Sequence<beans::PropertyValue> aObjArgs(2); - aObjArgs[0].Name = "SourceShellID"; - aObjArgs[0].Value <<= maParentShellID; - aObjArgs[1].Name = "DestinationShellID"; - aObjArgs[1].Value <<= rDestDoc; + uno::Sequence<beans::PropertyValue> aObjArgs( comphelper::InitPropertySequence({ + { "SourceShellID", uno::Any(maParentShellID) }, + { "DestinationShellID", uno::Any(rDestDoc) } + })); xPers->storeToEntry(xStg, aName, aEmpty, aObjArgs); if ( xStg->isStreamElement( aName ) ) { diff --git a/svx/source/svdraw/svdobj.cxx b/svx/source/svdraw/svdobj.cxx index d48f8de48a4b..bcbeb9f2e2ce 100644 --- a/svx/source/svdraw/svdobj.cxx +++ b/svx/source/svdraw/svdobj.cxx @@ -787,10 +787,8 @@ void SdrObject::GetGrabBagItem(css::uno::Any& rVal) const { if (pGrabBagItem != nullptr) pGrabBagItem->QueryValue(rVal); - else { - uno::Sequence<beans::PropertyValue> aValue(0); - rVal <<= aValue; - } + else + rVal <<= uno::Sequence<beans::PropertyValue>(); } void SdrObject::SetGrabBagItem(const css::uno::Any& rVal) diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 59f39cbbb702..541b340dc26d 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -29,6 +29,7 @@ #include <svx/svdomedia.hxx> #include <svx/svdpool.hxx> #include <comphelper/classids.hxx> +#include <comphelper/propertysequence.hxx> #include <sfx2/frmdescr.hxx> #include <vcl/svapp.hxx> #include <osl/mutex.hxx> @@ -395,9 +396,9 @@ bool SvxOle2Shape::createObject( const SvGlobalName &aClassName ) if( SvxShape::getPropertyValue( UNO_NAME_OLE2_PERSISTNAME ) >>= aTmpStr ) aPersistName = aTmpStr; - uno::Sequence<beans::PropertyValue> objArgs(1); - objArgs[0].Name = "DefaultParentBaseURL"; - objArgs[0].Value <<= pPersist->getDocumentBaseURL(); + uno::Sequence<beans::PropertyValue> objArgs( comphelper::InitPropertySequence({ + { "DefaultParentBaseURL", Any(pPersist->getDocumentBaseURL()) } + })); //TODO/LATER: how to cope with creation failure?! uno::Reference<embed::XEmbeddedObject> xObj( pPersist->getEmbeddedObjectContainer().CreateEmbeddedObject( diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index fa27beca817d..7ee048ad4b70 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -46,6 +46,7 @@ #include <sfx2/sfxmodelfactory.hxx> #include <svl/intitem.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/scopeguard.hxx> #include <basic/sbxdef.hxx> @@ -410,9 +411,9 @@ void SwMacrosTest::testFdo68983() utl::TempFile aTempFile; aTempFile.EnableKillingFile(); - Sequence<beans::PropertyValue> desc(1); - desc[0].Name = "FilterName"; - desc[0].Value <<= OUString("writer8"); + Sequence<beans::PropertyValue> desc( comphelper::InitPropertySequence({ + { "FilterName", Any(OUString("writer8")) } + })); xDocStorable->storeAsURL(aTempFile.GetURL(), desc); Reference<util::XCloseable>(xComponent, UNO_QUERY_THROW)->close(false); @@ -443,9 +444,9 @@ void SwMacrosTest::testFdo87530() utl::TempFile aTempFile; aTempFile.EnableKillingFile(); - Sequence<beans::PropertyValue> desc(1); - desc[0].Name = "FilterName"; - desc[0].Value <<= OUString("writer8"); + Sequence<beans::PropertyValue> desc( comphelper::InitPropertySequence({ + { "FilterName", Any(OUString("writer8")) } + })); { // insert initial password protected library diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 0fcc0a48e2a2..cc152f422c2f 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -13,6 +13,7 @@ #include <com/sun/star/graphic/XGraphic.hpp> #include <officecfg/Office/Common.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <unotxdoc.hxx> #include <docsh.hxx> #include <IDocumentRedlineAccess.hxx> @@ -767,11 +768,9 @@ void Test::testSkipImages() if (bSkipImages) { // FilterOptions parameter - uno::Sequence<beans::PropertyValue> args(1); - args[0].Name = "FilterOptions"; - args[0].Handle = -1; - args[0].Value <<= OUString::createFromAscii(aFilterNames[nFilter][1]); - args[0].State = beans::PropertyState_DIRECT_VALUE; + uno::Sequence<beans::PropertyValue> args( comphelper::InitPropertySequence({ + { "FilterOptions", uno::Any(OUString::createFromAscii(aFilterNames[nFilter][1])) } + })); mxComponent = loadFromDesktop(m_directories.getURLFromSrc(aFilterNames[nFilter][0]), "com.sun.star.text.TextDocument", args); sFailedMessage = sFailedMessage + " - " + aFilterNames[nFilter][1]; } else diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 2d4804e937af..4f76f5f321cb 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -101,11 +101,9 @@ public: CPPUNIT_ASSERT_MESSAGE("no desktop", mxDesktop.is()); uno::Reference<frame::XComponentLoader> xLoader(mxDesktop, uno::UNO_QUERY); CPPUNIT_ASSERT_MESSAGE("no loader", xLoader.is()); - uno::Sequence<beans::PropertyValue> args(1); - args[0].Name = "DocumentService"; - args[0].Handle = -1; - args[0].Value <<= OUString("com.sun.star.text.TextDocument"); - args[0].State = beans::PropertyState_DIRECT_VALUE; + uno::Sequence<beans::PropertyValue> args( comphelper::InitPropertySequence({ + { "DocumentService", uno::Any(OUString("com.sun.star.text.TextDocument")) } + })); uno::Reference<lang::XComponent> xComponent = xLoader->loadComponentFromURL(aURL, "_default", 0, args); OUString sMessage = "loading succeeded: " + aURL; @@ -1243,11 +1241,10 @@ DECLARE_OOXMLIMPORT_TEST(testTdf100072, "tdf100072.docx") SvMemoryStream aStream; uno::Reference<io::XOutputStream> xOutputStream(new utl::OStreamWrapper(aStream)); - uno::Sequence<beans::PropertyValue> aDescriptor = - { - beans::PropertyValue("OutputStream", sal_Int32(0), uno::makeAny(xOutputStream), beans::PropertyState_DIRECT_VALUE), - beans::PropertyValue("FilterName", sal_Int32(0), uno::makeAny(OUString("SVM")), beans::PropertyState_DIRECT_VALUE) - }; + uno::Sequence<beans::PropertyValue> aDescriptor( comphelper::InitPropertySequence({ + { "OutputStream", uno::Any(xOutputStream) }, + { "FilterName", uno::Any(OUString("SVM")) } + })); xGraphicExporter->filter(aDescriptor); aStream.Seek(STREAM_SEEK_TO_BEGIN); diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index 3239e1b2184d..7ef2dabaf0d4 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -1374,11 +1374,10 @@ void SwUiWriterTest::testFdo87448() SvMemoryStream aStream; uno::Reference<io::XOutputStream> xOutputStream(new utl::OStreamWrapper(aStream)); - uno::Sequence<beans::PropertyValue> aDescriptor = - { - beans::PropertyValue("OutputStream", sal_Int32(0), uno::makeAny(xOutputStream), beans::PropertyState_DIRECT_VALUE), - beans::PropertyValue("FilterName", sal_Int32(0), uno::makeAny(OUString("SVM")), beans::PropertyState_DIRECT_VALUE) - }; + uno::Sequence<beans::PropertyValue> aDescriptor( comphelper::InitPropertySequence({ + { "OutputStream", uno::makeAny(xOutputStream) }, + { "FilterName", uno::makeAny(OUString("SVM")) } + })); xGraphicExporter->filter(aDescriptor); aStream.Seek(STREAM_SEEK_TO_BEGIN); @@ -1626,10 +1625,9 @@ void SwUiWriterTest::testXFlatParagraph() uno::Reference<text::XFlatParagraph> xFlatPara4(xFPIterator->getParaBefore(xFlatPara3)); CPPUNIT_ASSERT_EQUAL(xFlatPara2->getText(), xFlatPara4->getText()); //changing the attributes of last para - uno::Sequence<beans::PropertyValue> aDescriptor = - { - beans::PropertyValue("CharWeight", sal_Int32(0), uno::makeAny(float(css::awt::FontWeight::BOLD)), beans::PropertyState_DIRECT_VALUE) - }; + uno::Sequence<beans::PropertyValue> aDescriptor( comphelper::InitPropertySequence({ + { "CharWeight", uno::Any(float(css::awt::FontWeight::BOLD)) } + })); xFlatPara3->changeAttributes(sal_Int32(0), sal_Int32(5), aDescriptor); //checking Language Portions uno::Sequence<::sal_Int32> aLangPortions(xFlatPara4->getLanguagePortions()); @@ -1680,16 +1678,14 @@ void SwUiWriterTest::testTdf81995() void SwUiWriterTest::testExportToPicture() { createDoc(); - uno::Sequence<beans::PropertyValue> aFilterData = - { - beans::PropertyValue("PixelWidth", sal_Int32(0), uno::makeAny(sal_Int32(610)), beans::PropertyState_DIRECT_VALUE), - beans::PropertyValue("PixelHeight", sal_Int32(0), uno::makeAny(sal_Int32(610)), beans::PropertyState_DIRECT_VALUE) - }; - uno::Sequence<beans::PropertyValue> aDescriptor = - { - beans::PropertyValue("FilterName", sal_Int32(0), uno::makeAny(OUString("writer_png_Export")), beans::PropertyState_DIRECT_VALUE), - beans::PropertyValue("FilterData", sal_Int32(0), uno::makeAny(aFilterData), beans::PropertyState_DIRECT_VALUE) - }; + uno::Sequence<beans::PropertyValue> aFilterData( comphelper::InitPropertySequence({ + { "PixelWidth", uno::Any(sal_Int32(610)) }, + { "PixelHeight", uno::Any(sal_Int32(610)) } + })); + uno::Sequence<beans::PropertyValue> aDescriptor( comphelper::InitPropertySequence({ + { "FilterName", uno::Any(OUString("writer_png_Export")) }, + { "FilterData", uno::Any(aFilterData) } + })); utl::TempFile aTempFile; uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), aDescriptor); @@ -1821,10 +1817,9 @@ void SwUiWriterTest::testTextSearch() uno::Reference<util::XSearchDescriptor> xSearchDes(xSearch->createSearchDescriptor(), uno::UNO_QUERY); uno::Reference<util::XPropertyReplace> xProp(xSearchDes, uno::UNO_QUERY); //setting some properties - uno::Sequence<beans::PropertyValue> aDescriptor = - { - beans::PropertyValue("CharWeight", sal_Int32(0), uno::makeAny(float(css::awt::FontWeight::BOLD)), beans::PropertyState_DIRECT_VALUE) - }; + uno::Sequence<beans::PropertyValue> aDescriptor( comphelper::InitPropertySequence({ + { "CharWeight", uno::Any(float(css::awt::FontWeight::BOLD)) } + })); xProp->setSearchAttributes(aDescriptor); //receiving the defined properties and asserting them with expected values, covering UNO uno::Sequence<beans::PropertyValue> aPropVal2(xProp->getSearchAttributes()); @@ -4589,10 +4584,9 @@ void SwUiWriterTest::testLandscape() { // Set page orientation to landscape. SwDoc* pDoc = createDoc(); - uno::Sequence<beans::PropertyValue> aPropertyValues = - { - comphelper::makePropertyValue("AttributePage.Landscape", true), - }; + uno::Sequence<beans::PropertyValue> aPropertyValues( comphelper::InitPropertySequence({ + { "AttributePage.Landscape", uno::Any(true) } + })); lcl_dispatchCommand(mxComponent, ".uno:AttributePage", aPropertyValues); Scheduler::ProcessEventsToIdle(); diff --git a/sw/source/core/access/accnotextframe.cxx b/sw/source/core/access/accnotextframe.cxx index 3a7cf745ccb9..906c68c81ce8 100644 --- a/sw/source/core/access/accnotextframe.cxx +++ b/sw/source/core/access/accnotextframe.cxx @@ -255,8 +255,7 @@ sal_Bool SAL_CALL SwAccessibleNoTextFrame::setCaretPosition( sal_Int32 ){return sal_Unicode SAL_CALL SwAccessibleNoTextFrame::getCharacter( sal_Int32 ){return 0;} css::uno::Sequence< css::beans::PropertyValue > SAL_CALL SwAccessibleNoTextFrame::getCharacterAttributes( sal_Int32 , const css::uno::Sequence< OUString >& ) { - uno::Sequence<beans::PropertyValue> aValues(0); - return aValues; + return uno::Sequence<beans::PropertyValue>(); } css::awt::Rectangle SAL_CALL SwAccessibleNoTextFrame::getCharacterBounds( sal_Int32 ) { diff --git a/sw/source/core/attr/format.cxx b/sw/source/core/attr/format.cxx index 7addf5ff6528..ca951a3e159a 100644 --- a/sw/source/core/attr/format.cxx +++ b/sw/source/core/attr/format.cxx @@ -781,10 +781,7 @@ void SwFormat::GetGrabBagItem(uno::Any& rVal) const if (m_pGrabBagItem.get()) m_pGrabBagItem->QueryValue(rVal); else - { - uno::Sequence<beans::PropertyValue> aValue(0); - rVal <<= aValue; - } + rVal <<= uno::Sequence<beans::PropertyValue>(); } void SwFormat::SetGrabBagItem(const uno::Any& rVal) diff --git a/sw/source/core/doc/number.cxx b/sw/source/core/doc/number.cxx index eabe4cc731ee..c08c8b4f23cd 100644 --- a/sw/source/core/doc/number.cxx +++ b/sw/source/core/doc/number.cxx @@ -1025,10 +1025,7 @@ void SwNumRule::GetGrabBagItem(uno::Any& rVal) const if (mpGrabBagItem.get()) mpGrabBagItem->QueryValue(rVal); else - { - uno::Sequence<beans::PropertyValue> aValue(0); - rVal <<= aValue; - } + rVal <<= uno::Sequence<beans::PropertyValue>(); } void SwNumRule::SetGrabBagItem(const uno::Any& rVal) diff --git a/sw/source/filter/docx/swdocxreader.cxx b/sw/source/filter/docx/swdocxreader.cxx index bba7dd1ff723..3f2bb22b4d26 100644 --- a/sw/source/filter/docx/swdocxreader.cxx +++ b/sw/source/filter/docx/swdocxreader.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/xml/dom/XNodeList.hpp> #include <comphelper/processfactory.hxx> #include <comphelper/propertyvalue.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/sequenceashashmap.hxx> #include <docsh.hxx> #include <IDocumentStylePoolAccess.hxx> @@ -83,11 +84,10 @@ bool SwDOCXReader::ReadGlossaries( SwTextBlocks& rBlocks, bool /* bSaveRelFiles uno::Reference<io::XStream> xStream( new utl::OStreamWrapper( *pMedium->GetInStream() ) ); - uno::Sequence<beans::PropertyValue> aDescriptor( 2 ); - aDescriptor[0].Name = "InputStream"; - aDescriptor[0].Value <<= xStream; - aDescriptor[1].Name = "ReadGlossaries"; - aDescriptor[1].Value <<= true; + uno::Sequence<beans::PropertyValue> aDescriptor( comphelper::InitPropertySequence({ + { "InputStream", uno::Any(xStream) }, + { "ReadGlossaries", uno::Any(true) } + })); if( xFilter->filter( aDescriptor ) ) return MakeEntries( static_cast<SwDocShell*>( &xDocSh )->GetDoc(), rBlocks ); diff --git a/sw/source/filter/rtf/swparrtf.cxx b/sw/source/filter/rtf/swparrtf.cxx index d1186a7f9755..4f8ff64906f5 100644 --- a/sw/source/filter/rtf/swparrtf.cxx +++ b/sw/source/filter/rtf/swparrtf.cxx @@ -30,6 +30,7 @@ #include <unotools/streamwrap.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <com/sun/star/document/XFilter.hpp> #include <com/sun/star/document/XImporter.hpp> @@ -79,14 +80,11 @@ sal_uLong SwRTFReader::Read(SwDoc& rDoc, const OUString& /*rBaseURL*/, SwPaM& rP SwXTextRange::CreateXTextRange(rDoc, *rPam.GetPoint(), nullptr); uno::Reference<document::XFilter> xFilter(xInterface, uno::UNO_QUERY_THROW); - uno::Sequence<beans::PropertyValue> aDescriptor(3); - aDescriptor[0].Name = "InputStream"; - uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(*pStrm)); - aDescriptor[0].Value <<= xStream; - aDescriptor[1].Name = "InsertMode"; - aDescriptor[1].Value <<= true; - aDescriptor[2].Name = "TextInsertModeRange"; - aDescriptor[2].Value <<= xInsertTextRange; + uno::Sequence<beans::PropertyValue> aDescriptor( comphelper::InitPropertySequence({ + { "InputStream", uno::Any(uno::Reference<io::XStream>(new utl::OStreamWrapper(*pStrm))) }, + { "InsertMode", uno::Any(true) }, + { "TextInsertModeRange", uno::Any(xInsertTextRange) } + })); sal_uLong ret(0); try { @@ -173,10 +171,9 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool SAL_CALL TestImportRTF(SvStream& rStream) xImporter->setTargetDocument(xDstDoc); uno::Reference<document::XFilter> xFilter(xInterface, uno::UNO_QUERY_THROW); - uno::Sequence<beans::PropertyValue> aDescriptor(1); - aDescriptor[0].Name = "InputStream"; - uno::Reference<io::XStream> xStream(new utl::OStreamWrapper(rStream)); - aDescriptor[0].Value <<= xStream; + uno::Sequence<beans::PropertyValue> aDescriptor( comphelper::InitPropertySequence({ + { "InputStream", uno::Any(uno::Reference<io::XStream>(new utl::OStreamWrapper(rStream))) } + })); bool bRet = true; try { diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index bb25687723d2..530a199cee5b 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -38,6 +38,7 @@ #include <unotools/tempfile.hxx> #include <comphelper/docpasswordrequest.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/string.hxx> #include <editeng/brushitem.hxx> @@ -1837,19 +1838,19 @@ void SwWW8ImplReader::ImportDop() // Import zoom factor if (m_pWDop->wScaleSaved) { - uno::Sequence<beans::PropertyValue> aViewProps(3); - aViewProps[0].Name = "ZoomFactor"; - aViewProps[0].Value <<= sal_Int16(m_pWDop->wScaleSaved); - aViewProps[1].Name = "VisibleBottom"; - aViewProps[1].Value <<= sal_Int32(0); - aViewProps[2].Name = "ZoomType"; //Import zoom type + sal_Int16 nZoomType; switch (m_pWDop->zkSaved) { - case 1: aViewProps[2].Value <<= sal_Int16(SvxZoomType::WHOLEPAGE); break; - case 2: aViewProps[2].Value <<= sal_Int16(SvxZoomType::PAGEWIDTH); break; - case 3: aViewProps[2].Value <<= sal_Int16(SvxZoomType::OPTIMAL); break; - default: aViewProps[2].Value <<= sal_Int16(SvxZoomType::PERCENT); break; - } + case 1: nZoomType = sal_Int16(SvxZoomType::WHOLEPAGE); break; + case 2: nZoomType = sal_Int16(SvxZoomType::PAGEWIDTH); break; + case 3: nZoomType = sal_Int16(SvxZoomType::OPTIMAL); break; + default: nZoomType = sal_Int16(SvxZoomType::PERCENT); break; + } + uno::Sequence<beans::PropertyValue> aViewProps( comphelper::InitPropertySequence({ + { "ZoomFactor", uno::Any(sal_Int16(m_pWDop->wScaleSaved)) }, + { "VisibleBottom", uno::Any(sal_Int32(0)) }, + { "ZoomType", uno::Any(nZoomType) } + })); uno::Reference< uno::XComponentContext > xComponentContext(comphelper::getProcessComponentContext()); uno::Reference<container::XIndexContainer> xBox = document::IndexedPropertyValues::create(xComponentContext); diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index 45a1ea42e847..410122a478c4 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -19,6 +19,7 @@ #include <comphelper/storagehelper.hxx> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <com/sun/star/embed/EmbeddedObjectCreator.hpp> #include <com/sun/star/embed/OOoEmbeddedObjectFactory.hpp> #include <com/sun/star/embed/XEmbeddedObject.hpp> @@ -273,9 +274,9 @@ uno::Reference< XPropertySet > SwXMLTextImportHelper::createAndInsertOLEObject( OUString aName("DummyName"); uno::Sequence < sal_Int8 > aClass( aClassName.GetByteSequence() ); uno::Reference < embed::XEmbeddedObjectCreator > xFactory = embed::EmbeddedObjectCreator::create( ::comphelper::getProcessComponentContext() ); - uno::Sequence<beans::PropertyValue> aObjArgs(1); - aObjArgs[0].Name = "DefaultParentBaseURL"; - aObjArgs[0].Value <<= GetXMLImport().GetBaseURL(); + uno::Sequence<beans::PropertyValue> aObjArgs( comphelper::InitPropertySequence({ + { "DefaultParentBaseURL", Any(GetXMLImport().GetBaseURL()) } + })); uno::Reference < embed::XEmbeddedObject > xObj = uno::Reference < embed::XEmbeddedObject >( xFactory->createInstanceInitNew( aClass, OUString(), xStorage, aName, aObjArgs), uno::UNO_QUERY ); diff --git a/sw/source/uibase/uno/SwXFilterOptions.cxx b/sw/source/uibase/uno/SwXFilterOptions.cxx index b30874bd560b..c90eb671f852 100644 --- a/sw/source/uibase/uno/SwXFilterOptions.cxx +++ b/sw/source/uibase/uno/SwXFilterOptions.cxx @@ -26,6 +26,7 @@ #include <vcl/msgbox.hxx> #include <com/sun/star/lang/XUnoTunnel.hpp> #include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp> +#include <comphelper/propertysequence.hxx> #include <cppuhelper/supportsservice.hxx> #include <unotools/ucbstreamhelper.hxx> #include <unotxdoc.hxx> @@ -52,13 +53,9 @@ SwXFilterOptions::~SwXFilterOptions() uno::Sequence< beans::PropertyValue > SwXFilterOptions::getPropertyValues() { - uno::Sequence<beans::PropertyValue> aRet(1); - beans::PropertyValue* pArray = aRet.getArray(); - - pArray[0].Name = FILTER_OPTIONS_NAME; - pArray[0].Value <<= sFilterOptions; - - return aRet; + return comphelper::InitPropertySequence({ + { FILTER_OPTIONS_NAME, uno::Any(sFilterOptions) } + }); } void SwXFilterOptions::setPropertyValues( const uno::Sequence<beans::PropertyValue >& aProps ) diff --git a/sw/source/uibase/utlui/unotools.cxx b/sw/source/uibase/utlui/unotools.cxx index 186085a3c617..25cd0d249e0a 100644 --- a/sw/source/uibase/utlui/unotools.cxx +++ b/sw/source/uibase/utlui/unotools.cxx @@ -41,6 +41,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/frame/XLayoutManager.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <sfx2/dispatch.hxx> #include <svl/stritem.hxx> #include <shellio.hxx> @@ -135,14 +136,11 @@ void SwOneExampleFrame::CreateControl() sTempURL = m_sArgumentURL; aURL <<= sTempURL; - uno::Sequence<beans::PropertyValue> aSeq(3); - beans::PropertyValue* pValues = aSeq.getArray(); - pValues[0].Name = "OpenFlags"; - pValues[0].Value <<= OUString("-RB"); - pValues[1].Name = "Referer"; - pValues[1].Value <<= OUString("private:user"); - pValues[2].Name = "ReadOnly"; - pValues[2].Value <<= (sTempURL != cFactory); + uno::Sequence<beans::PropertyValue> aSeq( comphelper::InitPropertySequence({ + { "OpenFlags", uno::Any(OUString("-RB")) }, + { "Referer", uno::Any(OUString("private:user")) }, + { "ReadOnly", uno::Any(sTempURL != cFactory) } + })); uno::Any aArgs(aSeq); xPrSet->setPropertyValue( "LoaderArguments", aArgs ); diff --git a/vcl/qa/cppunit/pdfexport/pdfexport.cxx b/vcl/qa/cppunit/pdfexport/pdfexport.cxx index 2b3db2584ea5..fe3e60fe65f9 100644 --- a/vcl/qa/cppunit/pdfexport/pdfexport.cxx +++ b/vcl/qa/cppunit/pdfexport/pdfexport.cxx @@ -152,10 +152,9 @@ void PdfExportTest::testTdf106059() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer_pdf_Export"); // Explicitly enable the usage of the reference XObject markup. - uno::Sequence<beans::PropertyValue> aFilterData = - { - comphelper::makePropertyValue("UseReferenceXObject", true) - }; + uno::Sequence<beans::PropertyValue> aFilterData( comphelper::InitPropertySequence({ + {"UseReferenceXObject", uno::Any(true) } + })); aMediaDescriptor["FilterData"] <<= aFilterData; xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); diff --git a/vcl/unx/gtk/salprn-gtk.cxx b/vcl/unx/gtk/salprn-gtk.cxx index 5dd511b4046b..310af20af8d3 100644 --- a/vcl/unx/gtk/salprn-gtk.cxx +++ b/vcl/unx/gtk/salprn-gtk.cxx @@ -912,11 +912,10 @@ void GtkPrintDialog::ExportAsPDF(const OUString &rFileURL, GtkPrintSettings *pSe uno::Reference< XExporter > xExport(xFilter, UNO_QUERY); xExport->setSourceDocument(xDoc); - uno::Sequence<beans::PropertyValue> aFilterData(2); - aFilterData[0].Name = "PageLayout"; - aFilterData[0].Value <<= sal_Int32(0); - aFilterData[1].Name = "FirstPageOnLeft"; - aFilterData[1].Value <<= sal_False; + uno::Sequence<beans::PropertyValue> aFilterData( comphelper::InitPropertySequence({ + { "PageLayout", Any(sal_Int32(0)) }, + { "FirstPageOnLeft", Any(false) } + })); const gchar *pStr = gtk_print_settings_get(pSettings, GTK_PRINT_SETTINGS_PRINT_PAGES); if (pStr && !strcmp(pStr, "ranges")) @@ -1006,11 +1005,10 @@ void GtkPrintDialog::ExportAsPDF(const OUString &rFileURL, GtkPrintSettings *pSe aFilterData[aFilterData.getLength()-1].Value <<= aSelection; } } - uno::Sequence<beans::PropertyValue> aArgs(2); - aArgs[0].Name = "FilterData"; - aArgs[0].Value <<= aFilterData; - aArgs[1].Name = "OutputStream"; - aArgs[1].Value <<= xOStm; + uno::Sequence<beans::PropertyValue> aArgs( comphelper::InitPropertySequence({ + { "FilterData", Any(aFilterData) }, + { "OutputStream", Any(xOStm) } + })); xFilter->filter(aArgs); } } diff --git a/writerfilter/source/dmapper/CellMarginHandler.cxx b/writerfilter/source/dmapper/CellMarginHandler.cxx index bc00c84999de..5fbd99f363dd 100644 --- a/writerfilter/source/dmapper/CellMarginHandler.cxx +++ b/writerfilter/source/dmapper/CellMarginHandler.cxx @@ -20,6 +20,7 @@ #include <PropertyMap.hxx> #include <ConversionHelper.hxx> #include <ooxml/resourceids.hxx> +#include <comphelper/propertysequence.hxx> #include <comphelper/sequence.hxx> namespace writerfilter { @@ -76,17 +77,18 @@ void CellMarginHandler::createGrabBag(const OUString& aName) beans::PropertyValue aRet; aRet.Name = aName; - uno::Sequence<beans::PropertyValue> aSeq(2); - aSeq[0].Name = "w"; - aSeq[0].Value <<= m_nWidth; - aSeq[1].Name = "type"; + OUString sType; switch (m_nType) { - case NS_ooxml::LN_Value_ST_TblWidth_nil: aSeq[1].Value <<= OUString("nil"); break; - case NS_ooxml::LN_Value_ST_TblWidth_pct: aSeq[1].Value <<= OUString("pct"); break; - case NS_ooxml::LN_Value_ST_TblWidth_dxa: aSeq[1].Value <<= OUString("dxa"); break; - case NS_ooxml::LN_Value_ST_TblWidth_auto: aSeq[1].Value <<= OUString("auto"); break; + case NS_ooxml::LN_Value_ST_TblWidth_nil: sType = "nil"; break; + case NS_ooxml::LN_Value_ST_TblWidth_pct: sType = "pct"; break; + case NS_ooxml::LN_Value_ST_TblWidth_dxa: sType = "dxa"; break; + case NS_ooxml::LN_Value_ST_TblWidth_auto: sType = "auto"; break; } + uno::Sequence<beans::PropertyValue> aSeq( comphelper::InitPropertySequence({ + { "w", uno::Any(m_nWidth) }, + { "type", uno::Any(sType) } + })); aRet.Value <<= aSeq; m_aInteropGrabBag.push_back(aRet); diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index b1f4a45f0e22..e8f381ed9b0e 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -84,6 +84,7 @@ #include <filter/msfilter/util.hxx> #include <comphelper/sequence.hxx> #include <comphelper/propertyvalue.hxx> +#include <comphelper/propertysequence.hxx> #include <unotools/mediadescriptor.hxx> using namespace ::com::sun::star; @@ -951,11 +952,9 @@ void DomainMapper_Impl::CheckUnregisteredFrameConversion( ) // will be ignored. aFrameProperties.push_back(comphelper::makePropertyValue(getPropertyName(PROP_BACK_COLOR_TRANSPARENCY), sal_Int32(100))); - beans::PropertyValue aRet; - uno::Sequence<beans::PropertyValue> aGrabBag(1); - aRet.Name = "ParaFrameProperties"; - aRet.Value <<= rAppendContext.pLastParagraphProperties->IsFrameMode(); - aGrabBag[0] = aRet; + uno::Sequence<beans::PropertyValue> aGrabBag( comphelper::InitPropertySequence({ + { "ParaFrameProperties", uno::Any(rAppendContext.pLastParagraphProperties->IsFrameMode()) } + })); aFrameProperties.push_back(comphelper::makePropertyValue("FrameInteropGrabBag", aGrabBag)); lcl_MoveBorderPropertiesToFrame(aFrameProperties, @@ -2066,11 +2065,9 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape xPropSetInfo = xShapePropertySet->getPropertySetInfo(); if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("InteropGrabBag")) { - uno::Sequence<beans::PropertyValue> aShapeGrabBag(1); - beans::PropertyValue aRet; - aRet.Name = "SdtEndBefore"; - aRet.Value <<= true; - aShapeGrabBag[0] = aRet; + uno::Sequence<beans::PropertyValue> aShapeGrabBag( comphelper::InitPropertySequence({ + { "SdtEndBefore", uno::Any(true) } + })); xShapePropertySet->setPropertyValue("InteropGrabBag",uno::makeAny(aShapeGrabBag)); } } @@ -4314,13 +4311,10 @@ void DomainMapper_Impl::CloseFieldCommand() uno::UNO_QUERY_THROW); OUString sCmd(pContext->GetCommand());//sCmd is the entire instrText inclusing the index e.g. CITATION Kra06 \l 1033 if( !sCmd.isEmpty()){ - uno::Sequence<beans::PropertyValue> aValues(1); - beans::PropertyValue propertyVal; - propertyVal.Name = "Identifier"; - propertyVal.Value <<= sCmd; - aValues[0] = propertyVal; - xTC->setPropertyValue("Fields", - uno::makeAny(aValues)); + uno::Sequence<beans::PropertyValue> aValues( comphelper::InitPropertySequence({ + { "Identifier", uno::Any(sCmd) } + })); + xTC->setPropertyValue("Fields", uno::makeAny(aValues)); } uno::Reference< text::XTextContent > xToInsert( xTC, uno::UNO_QUERY ); @@ -4931,11 +4925,9 @@ void DomainMapper_Impl::ImportGraphic(const writerfilter::Reference< Properties { if (bHasGrabBag) { - uno::Sequence<beans::PropertyValue> aFrameGrabBag(1); - beans::PropertyValue aRet; - aRet.Name = "SdtEndBefore"; - aRet.Value <<= true; - aFrameGrabBag[0] = aRet; + uno::Sequence<beans::PropertyValue> aFrameGrabBag( comphelper::InitPropertySequence({ + { "SdtEndBefore", uno::Any(true) } + })); xPropertySet->setPropertyValue("FrameInteropGrabBag",uno::makeAny(aFrameGrabBag)); } } diff --git a/xmlsecurity/qa/unit/signing/signing.cxx b/xmlsecurity/qa/unit/signing/signing.cxx index f8fe7b55123d..c0389fe40a3c 100644 --- a/xmlsecurity/qa/unit/signing/signing.cxx +++ b/xmlsecurity/qa/unit/signing/signing.cxx @@ -27,6 +27,7 @@ #include <com/sun/star/packages/manifest/ManifestReader.hpp> #include <comphelper/processfactory.hxx> +#include <comphelper/propertysequence.hxx> #include <sax/tools/converter.hxx> #include <unotools/mediadescriptor.hxx> #include <unotools/tempfile.hxx> @@ -491,11 +492,10 @@ void SigningTest::test96097Calc() // Save a copy utl::TempFile aTempFileSaveCopy; aTempFileSaveCopy.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> descSaveACopy(2); - descSaveACopy[0].Name = "SaveACopy"; - descSaveACopy[0].Value <<= true; - descSaveACopy[1].Name = "FilterName"; - descSaveACopy[1].Value <<= OUString("calc8"); + uno::Sequence<beans::PropertyValue> descSaveACopy( comphelper::InitPropertySequence({ + { "SaveACopy", uno::Any(true) }, + { "FilterName", uno::Any(OUString("calc8")) } + })); xDocStorable->storeToURL(aTempFileSaveCopy.GetURL(), descSaveACopy); try @@ -503,9 +503,9 @@ void SigningTest::test96097Calc() // Save As utl::TempFile aTempFileSaveAs; aTempFileSaveAs.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> descSaveAs(1); - descSaveAs[0].Name = "FilterName"; - descSaveAs[0].Value <<= OUString("calc8"); + uno::Sequence<beans::PropertyValue> descSaveAs( comphelper::InitPropertySequence({ + { "FilterName", uno::Any(OUString("calc8")) } + })); xDocStorable->storeAsURL(aTempFileSaveAs.GetURL(), descSaveAs); } catch (...) @@ -539,11 +539,10 @@ void SigningTest::test96097Doc() // Save a copy utl::TempFile aTempFileSaveCopy; aTempFileSaveCopy.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> descSaveACopy(2); - descSaveACopy[0].Name = "SaveACopy"; - descSaveACopy[0].Value <<= true; - descSaveACopy[1].Name = "FilterName"; - descSaveACopy[1].Value <<= OUString("writer8"); + uno::Sequence<beans::PropertyValue> descSaveACopy( comphelper::InitPropertySequence({ + { "SaveACopy", uno::Any(true) }, + { "FilterName", uno::Any(OUString("writer8")) } + })); xDocStorable->storeToURL(aTempFileSaveCopy.GetURL(), descSaveACopy); try @@ -551,9 +550,9 @@ void SigningTest::test96097Doc() // Save As utl::TempFile aTempFileSaveAs; aTempFileSaveAs.EnableKillingFile(); - uno::Sequence<beans::PropertyValue> descSaveAs(1); - descSaveAs[0].Name = "FilterName"; - descSaveAs[0].Value <<= OUString("writer8"); + uno::Sequence<beans::PropertyValue> descSaveAs( comphelper::InitPropertySequence({ + { "FilterName", uno::Any(OUString("writer8")) } + })); xDocStorable->storeAsURL(aTempFileSaveAs.GetURL(), descSaveAs); } catch (...) |