[Libreoffice-commits] core.git: include/comphelper oox/source sd/source

Jan Holesovsky kendy at collabora.com
Fri Jul 21 17:51:51 UTC 2017


 include/comphelper/propertysequence.hxx                  |    7 +---
 oox/source/ppt/pptimport.cxx                             |    2 -
 sd/source/core/CustomAnimationPreset.cxx                 |   10 +++---
 sd/source/ui/func/fuhhconv.cxx                           |   11 +++---
 sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx |   23 ++++----------
 sd/source/ui/tools/ConfigurationAccess.cxx               |   24 +++++----------
 6 files changed, 29 insertions(+), 48 deletions(-)

New commits:
commit c23cc5d7551a0ed0e3dad2d33dd00b38643456a1
Author: Jan Holesovsky <kendy at collabora.com>
Date:   Fri Jul 21 15:11:02 2017 +0200

    Rename InitAnySequence -> InitAnyPropertySequence, and convert some callers.
    
    Change-Id: I410fef49679360f3308ec0f00bb032a2de0d7931
    Reviewed-on: https://gerrit.libreoffice.org/40282
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/include/comphelper/propertysequence.hxx b/include/comphelper/propertysequence.hxx
index 6af3bb389929..c384edb2848d 100644
--- a/include/comphelper/propertysequence.hxx
+++ b/include/comphelper/propertysequence.hxx
@@ -14,7 +14,6 @@
 #include <initializer_list>
 #include <com/sun/star/uno/Any.hxx>
 #include <com/sun/star/uno/Sequence.hxx>
-#include <com/sun/star/beans/NamedValue.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
 
 namespace comphelper
@@ -36,18 +35,18 @@ namespace comphelper
         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
     /// 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)
     {
         css::uno::Sequence<css::uno::Any> vResult{static_cast<sal_Int32>(vInit.size())};
         size_t nCount{0};
         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;
         }
         return vResult;
diff --git a/oox/source/ppt/pptimport.cxx b/oox/source/ppt/pptimport.cxx
index 446a054ffd91..4f7b4ea41e08 100644
--- a/oox/source/ppt/pptimport.cxx
+++ b/oox/source/ppt/pptimport.cxx
@@ -219,7 +219,7 @@ sal_Bool SAL_CALL PowerPointImport::filter( const Sequence< PropertyValue >& rDe
 
     if (isExportFilter())
     {
-        uno::Sequence<uno::Any> aArguments(comphelper::InitAnySequence(
+        uno::Sequence<uno::Any> aArguments(comphelper::InitAnyPropertySequence(
         {
             {"IsPPTM", uno::makeAny(exportVBA())},
         }));
diff --git a/sd/source/core/CustomAnimationPreset.cxx b/sd/source/core/CustomAnimationPreset.cxx
index 502ed08a6bb5..2163676af665 100644
--- a/sd/source/core/CustomAnimationPreset.cxx
+++ b/sd/source/core/CustomAnimationPreset.cxx
@@ -34,6 +34,7 @@
 #include <unotools/streamwrap.hxx>
 #include <comphelper/getexpandeduri.hxx>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
 #include <comphelper/random.hxx>
 #include <unotools/pathoptions.hxx>
 #include <tools/stream.hxx>
@@ -67,11 +68,10 @@ static Reference< XNameAccess > getNodeAccess( const Reference< XMultiServiceFac
 
     try
     {
-        Sequence< Any > aArgs( 1 );
-        PropertyValue   aPropValue;
-        aPropValue.Name  = "nodepath";
-        aPropValue.Value <<= rNodePath;
-        aArgs[0] <<= aPropValue;
+        Sequence<Any> aArgs(comphelper::InitAnyPropertySequence(
+        {
+            {"nodepath", uno::Any(rNodePath)}
+        }));
 
         xConfigAccess.set(
             xConfigProvider->createInstanceWithArguments( "com.sun.star.configuration.ConfigurationAccess", aArgs ),
diff --git a/sd/source/ui/func/fuhhconv.cxx b/sd/source/ui/func/fuhhconv.cxx
index bb471096812a..f3179f84bb69 100644
--- a/sd/source/ui/func/fuhhconv.cxx
+++ b/sd/source/ui/func/fuhhconv.cxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
+#include <comphelper/propertysequence.hxx>
 #include <cppuhelper/bootstrap.hxx>
 #include <vcl/msgbox.hxx>
 #include <svl/style.hxx>
@@ -203,12 +204,10 @@ void FuHangulHanjaConversion::StartChineseConversion()
             {
                 //  initialize dialog
                 Reference< awt::XWindow > xDialogParentWindow(nullptr);
-                Sequence<Any> aSeq(1);
-                Any* pArray = aSeq.getArray();
-                PropertyValue aParam;
-                aParam.Name = "ParentWindow";
-                aParam.Value <<= xDialogParentWindow;
-                pArray[0] <<= aParam;
+                Sequence<Any> aSeq(comphelper::InitAnyPropertySequence(
+                {
+                    {"ParentWindow", uno::Any(xDialogParentWindow)}
+                }));
                 xInit->initialize( aSeq );
 
                 //execute dialog
diff --git a/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx b/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx
index 1e8765830c6f..8bb01e4b7bbb 100644
--- a/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx
+++ b/sd/source/ui/slidesorter/cache/SlsCacheConfiguration.cxx
@@ -22,6 +22,7 @@
 #include <vcl/svapp.hxx>
 
 #include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
 #include <com/sun/star/container/XHierarchicalNameAccess.hpp>
 #include <com/sun/star/configuration/theDefaultProvider.hpp>
@@ -80,22 +81,12 @@ CacheConfiguration::CacheConfiguration()
             configuration::theDefaultProvider::get( ::comphelper::getProcessComponentContext() );
 
         // Obtain access to Impress configuration.
-        Sequence<Any> aCreationArguments(3);
-        aCreationArguments[0] <<= beans::PropertyValue(
-            "nodepath",
-            0,
-            makeAny(sPathToImpressConfigurationRoot),
-            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);
+        Sequence<Any> aCreationArguments(comphelper::InitAnyPropertySequence(
+        {
+            {"nodepath", makeAny(sPathToImpressConfigurationRoot)},
+            {"depth", makeAny((sal_Int32)-1)},
+            {"lazywrite", makeAny(true)}
+        }));
 
         Reference<XInterface> xRoot (xProvider->createInstanceWithArguments(
             "com.sun.star.configuration.ConfigurationAccess",
diff --git a/sd/source/ui/tools/ConfigurationAccess.cxx b/sd/source/ui/tools/ConfigurationAccess.cxx
index dd10efa08cd3..306c8f4016eb 100644
--- a/sd/source/ui/tools/ConfigurationAccess.cxx
+++ b/sd/source/ui/tools/ConfigurationAccess.cxx
@@ -24,6 +24,7 @@
 #include <com/sun/star/configuration/theDefaultProvider.hpp>
 #include <com/sun/star/util/XChangesBatch.hpp>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
 #include <tools/diagnose_ex.h>
 
 using namespace ::com::sun::star;
@@ -59,22 +60,13 @@ void ConfigurationAccess::Initialize (
 {
     try
     {
-        Sequence<Any> aCreationArguments(3);
-        aCreationArguments[0] <<= beans::PropertyValue(
-            "nodepath",
-            0,
-            makeAny(rsRootName),
-            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);
+        Sequence<Any> aCreationArguments(comphelper::InitAnyPropertySequence(
+        {
+            {"nodepath", makeAny(rsRootName)},
+            {"depth", makeAny((sal_Int32)-1)},
+            {"lazywrite", makeAny(true)}
+        }));
+
         OUString sAccessService;
         if (eMode == READ_ONLY)
             sAccessService = "com.sun.star.configuration.ConfigurationAccess";


More information about the Libreoffice-commits mailing list