diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-09 13:43:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-06-09 14:24:00 +0200 |
commit | 027b25ecd54ac97ea2471ca73e3ba89ce052fe76 (patch) | |
tree | fe8923a13998a96a865027c897273d0edb4d7c62 /sw/source/filter | |
parent | f59e802478e35e7b6f561f24806bca47b604529b (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/source/filter')
-rw-r--r-- | sw/source/filter/docx/swdocxreader.cxx | 10 | ||||
-rw-r--r-- | sw/source/filter/rtf/swparrtf.cxx | 21 | ||||
-rw-r--r-- | sw/source/filter/ww8/ww8par.cxx | 23 | ||||
-rw-r--r-- | sw/source/filter/xml/xmltexti.cxx | 7 |
4 files changed, 30 insertions, 31 deletions
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 ); |