Kaydet (Commit) c23cc5d7 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

Rename InitAnySequence -> InitAnyPropertySequence, and convert some callers.

Change-Id: I410fef49679360f3308ec0f00bb032a2de0d7931
Reviewed-on: https://gerrit.libreoffice.org/40282Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarJan Holesovsky <kendy@collabora.com>
üst 71ab0b8b
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include <initializer_list> #include <initializer_list>
#include <com/sun/star/uno/Any.hxx> #include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx> #include <com/sun/star/uno/Sequence.hxx>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp>
namespace comphelper namespace comphelper
...@@ -36,18 +35,18 @@ namespace comphelper ...@@ -36,18 +35,18 @@ namespace comphelper
return vResult; return vResult;
} }
/// Init list for property sequences that wrap the NamedValues in Anys. /// Init list for property sequences that wrap the PropertyValues in Anys.
/// ///
/// This is particularly useful for creation of sequences that are later /// This is particularly useful for creation of sequences that are later
/// unwrapped using comphelper::SequenceAsHashMap. /// unwrapped using comphelper::SequenceAsHashMap.
inline css::uno::Sequence< css::uno::Any > InitAnySequence( inline css::uno::Sequence< css::uno::Any > InitAnyPropertySequence(
::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit) ::std::initializer_list< ::std::pair< OUString, css::uno::Any > > vInit)
{ {
css::uno::Sequence<css::uno::Any> vResult{static_cast<sal_Int32>(vInit.size())}; css::uno::Sequence<css::uno::Any> vResult{static_cast<sal_Int32>(vInit.size())};
size_t nCount{0}; size_t nCount{0};
for(const auto& aEntry : vInit) for(const auto& aEntry : vInit)
{ {
vResult[nCount] <<= css::beans::NamedValue(aEntry.first, aEntry.second); vResult[nCount] <<= css::beans::PropertyValue(aEntry.first, -1, aEntry.second, css::beans::PropertyState_DIRECT_VALUE);
++nCount; ++nCount;
} }
return vResult; return vResult;
......
...@@ -219,7 +219,7 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe ...@@ -219,7 +219,7 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe
if (isExportFilter()) if (isExportFilter())
{ {
uno::Sequence<uno::Any> aArguments(comphelper::InitAnySequence( uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence(
{ {
{"IsPPTM", uno::makeAny(exportVBA())}, {"IsPPTM", uno::makeAny(exportVBA())},
})); }));
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <unotools/streamwrap.hxx> #include <unotools/streamwrap.hxx>
#include <comphelper/getexpandeduri.hxx> #include <comphelper/getexpandeduri.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
#include <comphelper/random.hxx> #include <comphelper/random.hxx>
#include <unotools/pathoptions.hxx> #include <unotools/pathoptions.hxx>
#include <tools/stream.hxx> #include <tools/stream.hxx>
...@@ -67,11 +68,10 @@ static Reference< XNameAccess > getNodeAccess( const Reference< XMultiServiceFac ...@@ -67,11 +68,10 @@ static Reference< XNameAccess > getNodeAccess( const Reference< XMultiServiceFac
try try
{ {
Sequence< Any > aArgs( 1 ); Sequence<Any> aArgs(comphelper::InitAnyPropertySequence(
PropertyValue aPropValue; {
aPropValue.Name = "nodepath"; {"nodepath", uno::Any(rNodePath)}
aPropValue.Value <<= rNodePath; }));
aArgs[0] <<= aPropValue;
xConfigAccess.set( xConfigAccess.set(
xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aArgs ), xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aArgs ),
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/beans/PropertyValue.hpp> #include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#include <comphelper/propertysequence.hxx>
#include <cppuhelper/bootstrap.hxx> #include <cppuhelper/bootstrap.hxx>
#include <vcl/msgbox.hxx> #include <vcl/msgbox.hxx>
#include <svl/style.hxx> #include <svl/style.hxx>
...@@ -203,12 +204,10 @@ void FuHangulHanjaConversion::StartChineseConversion() ...@@ -203,12 +204,10 @@ void FuHangulHanjaConversion::StartChineseConversion()
{ {
// initialize dialog // initialize dialog
Reference< awt::XWindow > xDialogParentWindow(nullptr); Reference< awt::XWindow > xDialogParentWindow(nullptr);
Sequence<Any> aSeq(1); Sequence<Any> aSeq(comphelper::InitAnyPropertySequence(
Any* pArray = aSeq.getArray(); {
PropertyValue aParam; {"ParentWindow", uno::Any(xDialogParentWindow)}
aParam.Name = "ParentWindow"; }));
aParam.Value <<= xDialogParentWindow;
pArray[0] <<= aParam;
xInit->initialize( aSeq ); xInit->initialize( aSeq );
//execute dialog //execute dialog
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <vcl/svapp.hxx> #include <vcl/svapp.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
#include <com/sun/star/lang/XMultiServiceFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp> #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp>
...@@ -80,22 +81,12 @@ CacheConfiguration::CacheConfiguration() ...@@ -80,22 +81,12 @@ CacheConfiguration::CacheConfiguration()
configuration::theDefaultProvider::get( ::comphelper::getProcessComponentContext() ); configuration::theDefaultProvider::get( ::comphelper::getProcessComponentContext() );
// Obtain access to Impress configuration. // Obtain access to Impress configuration.
Sequence<Any> aCreationArguments(3); Sequence<Any> aCreationArguments(comphelper::InitAnyPropertySequence(
aCreationArguments[0] <<= beans::PropertyValue( {
"nodepath", {"nodepath", makeAny(sPathToImpressConfigurationRoot)},
0, {"depth", makeAny((sal_Int32)-1)},
makeAny(sPathToImpressConfigurationRoot), {"lazywrite", makeAny(true)}
beans::PropertyState_DIRECT_VALUE); }));
aCreationArguments[1] <<= beans::PropertyValue(
"depth",
0,
makeAny((sal_Int32)-1),
beans::PropertyState_DIRECT_VALUE);
aCreationArguments[2] <<= beans::PropertyValue(
"lazywrite",
0,
makeAny(true),
beans::PropertyState_DIRECT_VALUE);
Reference<XInterface> xRoot (xProvider->createInstanceWithArguments( Reference<XInterface> xRoot (xProvider->createInstanceWithArguments(
"com.sun.star.configuration.ConfigurationAccess", "com.sun.star.configuration.ConfigurationAccess",
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <com/sun/star/configuration/theDefaultProvider.hpp> #include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/util/XChangesBatch.hpp> #include <com/sun/star/util/XChangesBatch.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
#include <tools/diagnose_ex.h> #include <tools/diagnose_ex.h>
using namespace ::com::sun::star; using namespace ::com::sun::star;
...@@ -59,22 +60,13 @@ void ConfigurationAccess::Initialize ( ...@@ -59,22 +60,13 @@ void ConfigurationAccess::Initialize (
{ {
try try
{ {
Sequence<Any> aCreationArguments(3); Sequence<Any> aCreationArguments(comphelper::InitAnyPropertySequence(
aCreationArguments[0] <<= beans::PropertyValue( {
"nodepath", {"nodepath", makeAny(rsRootName)},
0, {"depth", makeAny((sal_Int32)-1)},
makeAny(rsRootName), {"lazywrite", makeAny(true)}
beans::PropertyState_DIRECT_VALUE); }));
aCreationArguments[1] <<= beans::PropertyValue(
"depth",
0,
makeAny((sal_Int32)-1),
beans::PropertyState_DIRECT_VALUE);
aCreationArguments[2] <<= beans::PropertyValue(
"lazywrite",
0,
makeAny(true),
beans::PropertyState_DIRECT_VALUE);
OUString sAccessService; OUString sAccessService;
if (eMode == READ_ONLY) if (eMode == READ_ONLY)
sAccessService = "com.sun.star.configuration.ConfigurationAccess"; sAccessService = "com.sun.star.configuration.ConfigurationAccess";
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment