From f74da1315a5b2ec232a66944e41ff90231b383be Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Tue, 25 Jul 2017 09:34:01 +0200 Subject: use more comphelper::InitAnyPropertySequence Found with: git grep -n -A10 'Sequence.*Any' -- *.cxx | grep -B5 -w PropertyValueProvider and: git grep -n 'Sequence.*Any.*( *&' Change-Id: Icb18c98bdd3f8352817e443ff78de5df042859ad Reviewed-on: https://gerrit.libreoffice.org/40389 Tested-by: Jenkins Reviewed-by: Noel Grandin --- .../source/ui/inspection/DataProviderHandler.cxx | 44 ++++++++-------------- 1 file changed, 15 insertions(+), 29 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/source/ui/inspection/DataProviderHandler.cxx b/reportdesign/source/ui/inspection/DataProviderHandler.cxx index 5a04e5e2b7dc..c9713e4b2235 100644 --- a/reportdesign/source/ui/inspection/DataProviderHandler.cxx +++ b/reportdesign/source/ui/inspection/DataProviderHandler.cxx @@ -21,6 +21,7 @@ #include #include #include +#include #include #include "strings.hxx" #include @@ -483,27 +484,15 @@ sal_Bool SAL_CALL DataProviderHandler::suspend(sal_Bool Suspend) } bool DataProviderHandler::impl_dialogLinkedFields_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const { - uno::Sequence aSeq(6); - beans::PropertyValue aParam; - aParam.Name = "ParentWindow"; - aParam.Value = m_xContext->getValueByName("DialogParentWindow"); - aSeq[0] <<= aParam; - aParam.Name = "Detail"; - aParam.Value <<= m_xDataProvider; - aSeq[1] <<= aParam; - aParam.Name = "Master"; - aParam.Value <<= m_xReportComponent->getSection()->getReportDefinition(); - aSeq[2] <<= aParam; - - aParam.Name = "Explanation"; - aParam.Value <<= RptResId(RID_STR_EXPLANATION); - aSeq[3] <<= aParam; - aParam.Name = "DetailLabel"; - aParam.Value <<= RptResId(RID_STR_DETAILLABEL); - aSeq[4] <<= aParam; - aParam.Name = "MasterLabel"; - aParam.Value <<= RptResId(RID_STR_MASTERLABEL); - aSeq[5] <<= aParam; + uno::Sequence aSeq(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", uno::Any(m_xContext->getValueByName("DialogParentWindow"))}, + {"Detail", uno::Any(m_xDataProvider)}, + {"Master", uno::Any(m_xReportComponent->getSection()->getReportDefinition())}, + {"Explanation", uno::Any(RptResId(RID_STR_EXPLANATION))}, + {"DetailLabel", uno::Any(RptResId(RID_STR_DETAILLABEL))}, + {"MasterLabel", uno::Any(RptResId(RID_STR_MASTERLABEL))}, + })); uno::Reference< ui::dialogs::XExecutableDialog > xDialog( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( @@ -516,14 +505,11 @@ bool DataProviderHandler::impl_dialogLinkedFields_nothrow( ::osl::ClearableMutex bool DataProviderHandler::impl_dialogChartType_nothrow( ::osl::ClearableMutexGuard& _rClearBeforeDialog ) const { - uno::Sequence aSeq(2); - beans::PropertyValue aParam; - aParam.Name = "ParentWindow"; - aParam.Value = m_xContext->getValueByName("DialogParentWindow"); - aSeq[0] <<= aParam; - aParam.Name = "ChartModel"; - aParam.Value <<= m_xChartModel; - aSeq[1] <<= aParam; + uno::Sequence aSeq(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", uno::Any(m_xContext->getValueByName("DialogParentWindow"))}, + {"ChartModel", uno::Any(m_xChartModel)} + })); uno::Reference< ui::dialogs::XExecutableDialog > xDialog( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext( -- cgit