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 /sc/source/filter | |
parent | Add unit test for SUMIFS in array context (diff) | |
download | core-027b25ecd54ac97ea2471ca73e3ba89ce052fe76.tar.gz core-027b25ecd54ac97ea2471ca73e3ba89ce052fe76.zip |
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 'sc/source/filter')
-rw-r--r-- | sc/source/filter/xml/XMLStylesExportHelper.cxx | 15 | ||||
-rw-r--r-- | sc/source/filter/xml/xmlwrap.cxx | 8 |
2 files changed, 10 insertions, 13 deletions
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[] = |