diff options
author | Julien Nabet <serval2412@yahoo.fr> | 2022-02-06 21:47:14 +0100 |
---|---|---|
committer | Julien Nabet <serval2412@yahoo.fr> | 2022-02-07 07:56:16 +0100 |
commit | 6dcd73f505eca7d0ea31555564855dd4cd0813b4 (patch) | |
tree | c84de910f5dd0c7aeece25d517ffcfcc497a8105 /forms | |
parent | ed652a6af731c5cd024c245013923717b7764a60 (diff) |
Simplify sequence of PropertyValue in forms
Change-Id: Iab1af5c8d8d824ef2a4be471395f174cadabfc1e
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129583
Tested-by: Jenkins
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/component/DatabaseForm.cxx | 29 | ||||
-rw-r--r-- | forms/source/component/clickableimage.cxx | 5 |
2 files changed, 14 insertions, 20 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx index 6ba5a380ee9c..e22acf270fb5 100644 --- a/forms/source/component/DatabaseForm.cxx +++ b/forms/source/component/DatabaseForm.cxx @@ -29,6 +29,7 @@ #include "GroupManager.hxx" #include <property.hxx> #include <services.hxx> +#include <comphelper/propertyvalue.hxx> #include <com/sun/star/awt/XControlContainer.hpp> #include <com/sun/star/awt/XTextComponent.hpp> @@ -2103,9 +2104,6 @@ static void lcl_dispatch(const Reference< XFrame >& xFrame,const Reference<XURLT if (!xDisp.is()) return; - Sequence<PropertyValue> aArgs(2); - aArgs.getArray()[0].Name = "Referer"; - aArgs.getArray()[0].Value <<= aReferer; // build a sequence from the to-be-submitted string OString a8BitData(OUStringToOString(aData, _eEncoding)); @@ -2113,8 +2111,11 @@ static void lcl_dispatch(const Reference< XFrame >& xFrame,const Reference<XURLT Sequence< sal_Int8 > aPostData(reinterpret_cast<const sal_Int8*>(a8BitData.getStr()), a8BitData.getLength()); Reference< XInputStream > xPostData = new SequenceInputStream(aPostData); - aArgs.getArray()[1].Name = "PostData"; - aArgs.getArray()[1].Value <<= xPostData; + Sequence<PropertyValue> aArgs + { + comphelper::makePropertyValue("Referer", aReferer), + comphelper::makePropertyValue("PostData", xPostData) + }; xDisp->dispatch(aURL, aArgs); } @@ -2193,9 +2194,7 @@ void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const css::a if (xDisp.is()) { - Sequence<PropertyValue> aArgs(1); - aArgs.getArray()->Name = "Referer"; - aArgs.getArray()->Value <<= aReferer; + Sequence<PropertyValue> aArgs { comphelper::makePropertyValue("Referer", aReferer) }; xDisp->dispatch(aURL, aArgs); } } @@ -2226,17 +2225,15 @@ void ODatabaseForm::submit_impl(const Reference<XControl>& Control, const css::a if (!aData.hasElements()) return; - Sequence<PropertyValue> aArgs(3); - aArgs.getArray()[0].Name = "Referer"; - aArgs.getArray()[0].Value <<= aReferer; - aArgs.getArray()[1].Name = "ContentType"; - aArgs.getArray()[1].Value <<= aContentType; - // build a sequence from the to-be-submitted string Reference< XInputStream > xPostData = new SequenceInputStream(aData); - aArgs.getArray()[2].Name = "PostData"; - aArgs.getArray()[2].Value <<= xPostData; + Sequence<PropertyValue> aArgs + { + comphelper::makePropertyValue("Referer", aReferer), + comphelper::makePropertyValue("ContentType", aContentType), + comphelper::makePropertyValue("PostData", xPostData) + }; xDisp->dispatch(aURL, aArgs); } diff --git a/forms/source/component/clickableimage.cxx b/forms/source/component/clickableimage.cxx index c84ba34cfb95..6a1ec1120192 100644 --- a/forms/source/component/clickableimage.cxx +++ b/forms/source/component/clickableimage.cxx @@ -301,10 +301,7 @@ namespace frm FrameSearchFlag::SELF | FrameSearchFlag::PARENT | FrameSearchFlag::SIBLINGS | FrameSearchFlag::CREATE ); - Sequence<PropertyValue> aArgs(1); - PropertyValue& rProp = aArgs.getArray()[0]; - rProp.Name = "Referer"; - rProp.Value <<= xModel->getURL(); + Sequence<PropertyValue> aArgs { comphelper::makePropertyValue("Referer", xModel->getURL()) }; if (xDisp.is()) xDisp->dispatch( aURL, aArgs ); |