summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-06-09 13:43:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-06-09 14:24:00 +0200
commit027b25ecd54ac97ea2471ca73e3ba89ce052fe76 (patch)
treefe8923a13998a96a865027c897273d0edb4d7c62 /sw
parentf59e802478e35e7b6f561f24806bca47b604529b (diff)
use comphelper::InitPropertySequence in more places
Change-Id: I72d7b13a23ce306b752b39187a0e9fbb7028643a Reviewed-on: https://gerrit.libreoffice.org/38606 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/core/macros-test.cxx13
-rw-r--r--sw/qa/extras/globalfilter/globalfilter.cxx9
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx17
-rw-r--r--sw/qa/extras/uiwriter/uiwriter.cxx48
-rw-r--r--sw/source/core/access/accnotextframe.cxx3
-rw-r--r--sw/source/core/attr/format.cxx5
-rw-r--r--sw/source/core/doc/number.cxx5
-rw-r--r--sw/source/filter/docx/swdocxreader.cxx10
-rw-r--r--sw/source/filter/rtf/swparrtf.cxx21
-rw-r--r--sw/source/filter/ww8/ww8par.cxx23
-rw-r--r--sw/source/filter/xml/xmltexti.cxx7
-rw-r--r--sw/source/uibase/uno/SwXFilterOptions.cxx11
-rw-r--r--sw/source/uibase/utlui/unotools.cxx14
13 files changed, 82 insertions, 104 deletions
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 );