[Libreoffice-commits] core.git: avmedia/source basctl/source chart2/qa chart2/source comphelper/source

Swachhand Lokhande swachhandl95 at gmail.com
Tue Mar 10 03:27:52 PDT 2015


 avmedia/source/framework/mediatoolbox.cxx                |    8 ++++---
 basctl/source/basicide/basicrenderable.cxx               |    8 ++++---
 basctl/source/basicide/moduldl2.cxx                      |   11 ++++------
 basctl/source/basicide/scriptdocument.cxx                |    7 +++---
 chart2/qa/extras/charttest.hxx                           |    7 +++---
 chart2/source/controller/main/ChartController_Window.cxx |   16 ++++++---------
 chart2/source/controller/main/ShapeToolbarController.cxx |    7 +++---
 comphelper/source/container/embeddedobjectcontainer.cxx  |   10 ++++-----
 8 files changed, 39 insertions(+), 35 deletions(-)

New commits:
commit b1534edf523a405b91ad04c5351735e745ceb7ee
Author: Swachhand Lokhande <swachhandl95 at gmail.com>
Date:   Sat Mar 7 18:58:49 2015 +0530

    tdf#89592 Using initializer_lists to populate Sequence<PropertyValue>
    
    Change-Id: Idef9dd55eb1719eaf592bc4a86440cbd5aa4fb32
    Reviewed-on: https://gerrit.libreoffice.org/14781
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/avmedia/source/framework/mediatoolbox.cxx b/avmedia/source/framework/mediatoolbox.cxx
index 22e5a50..d33cd93 100644
--- a/avmedia/source/framework/mediatoolbox.cxx
+++ b/avmedia/source/framework/mediatoolbox.cxx
@@ -26,6 +26,8 @@
 #include <sfx2/dispatch.hxx>
 #include <sfx2/sfxsids.hrc>
 
+#include <comphelper/propertysequence.hxx>
+
 using namespace ::com::sun::star;
 
 namespace avmedia
@@ -146,13 +148,13 @@ void MediaToolBoxControl::implUpdateMediaControl()
 void MediaToolBoxControl::implExecuteMediaControl( const MediaItem& rItem )
 {
     MediaItem                               aExecItem( SID_AVMEDIA_TOOLBOX );
-    uno::Sequence< beans::PropertyValue >   aArgs( 1 );
     uno::Any                                aAny;
+    auto aArgs(::comphelper::InitPropertySequence({
+        { "AVMediaToolBox", makeAny(aAny) }
+    }));
 
     aExecItem.merge( rItem );
     aExecItem.QueryValue( aAny );
-    aArgs[ 0 ].Name = "AVMediaToolBox" ;
-    aArgs[ 0 ].Value = aAny;
 
     Dispatch( ".uno:AVMediaToolBox" , aArgs );
 }
diff --git a/basctl/source/basicide/basicrenderable.cxx b/basctl/source/basicide/basicrenderable.cxx
index 013807e..ee5ed4b 100644
--- a/basctl/source/basicide/basicrenderable.cxx
+++ b/basctl/source/basicide/basicrenderable.cxx
@@ -25,6 +25,8 @@
 #include <tools/multisel.hxx>
 #include <tools/resary.hxx>
 
+#include <comphelper/propertysequence.hxx>
+
 namespace basctl
 {
 
@@ -136,12 +138,12 @@ Sequence<beans::PropertyValue> SAL_CALL Renderable::getRenderer (
     {
         Size aPageSize( pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
 
-        aVals.realloc( 1 );
-        aVals[0].Name = "PageSize" ;
         awt::Size aSize;
         aSize.Width  = aPageSize.Width();
         aSize.Height = aPageSize.Height();
-        aVals[0].Value <<= aSize;
+        aVals = ::comphelper::InitPropertySequence({
+            { "PageSize", makeAny(aSize) }
+        });
     }
 
     appendPrintUIOptions( aVals );
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 812c9ec..786574e 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -52,6 +52,7 @@
 #include <com/sun/star/util/VetoException.hpp>
 #include <com/sun/star/script/ModuleSizeExceededRequest.hpp>
 
+#include <comphelper/propertysequence.hxx>
 
 
 namespace basctl
@@ -1220,14 +1221,12 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
         const OUString strFullPath = "FullPath" ;
         const OUString strBasicMediaType = "application/vnd.sun.star.basic-library" ;
 
-        Sequence<beans::PropertyValue> attribs( 2 );
-        beans::PropertyValue * pattribs = attribs.getArray();
-        pattribs[ 0 ].Name = strFullPath;
         OUString fullPath = aLibName;
         fullPath += "/" ;
-        pattribs[ 0 ].Value <<= fullPath;
-        pattribs[ 1 ].Name = strMediaType;
-        pattribs[ 1 ].Value <<= strBasicMediaType;
+        auto attribs(::comphelper::InitPropertySequence({
+            { strFullPath, makeAny(fullPath) },
+            { strMediaType, makeAny(strBasicMediaType) }
+        }));
         manifest.push_back( attribs );
 
         // write into pipe:
diff --git a/basctl/source/basicide/scriptdocument.cxx b/basctl/source/basicide/scriptdocument.cxx
index 4a96cc7..f137d7a 100644
--- a/basctl/source/basicide/scriptdocument.cxx
+++ b/basctl/source/basicide/scriptdocument.cxx
@@ -54,6 +54,7 @@
 
 #include <comphelper/documentinfo.hxx>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
 
 #include <osl/file.hxx>
 #include <rtl/uri.hxx>
@@ -815,9 +816,9 @@ namespace basctl
         Sequence< PropertyValue > aArgs;
         if ( _rxStatusIndicator.is() )
         {
-            aArgs.realloc(1);
-            aArgs[0].Name = "StatusIndicator" ;
-            aArgs[0].Value <<= _rxStatusIndicator;
+            aArgs = ::comphelper::InitPropertySequence({
+                { "StatusIndicator", makeAny(_rxStatusIndicator) }
+            });
         }
 
         try
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index ad2cd55..e640118 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -13,6 +13,7 @@
 #include <test/bootstrapfixture.hxx>
 #include <unotest/macros_test.hxx>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/propertysequence.hxx>
 
 #include <com/sun/star/lang/XComponent.hpp>
 #include <com/sun/star/frame/Desktop.hpp>
@@ -120,9 +121,9 @@ void ChartTest::load( const OUString& aDir, const OUString& aName )
 boost::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
 {
     uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
-    uno::Sequence<beans::PropertyValue> aArgs(1);
-    aArgs[0].Name = "FilterName";
-    aArgs[0].Value <<= rFilterName;
+    auto aArgs(::comphelper::InitPropertySequence({
+        { "FilterName", makeAny(rFilterName) }
+    }));
     boost::shared_ptr<utl::TempFile> pTempFile = boost::make_shared<utl::TempFile>();
     pTempFile->EnableKillingFile();
     xStorable->storeToURL(pTempFile->GetURL(), aArgs);
diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx
index b7a677b..23724f428 100644
--- a/chart2/source/controller/main/ChartController_Window.cxx
+++ b/chart2/source/controller/main/ChartController_Window.cxx
@@ -55,6 +55,7 @@
 #include <com/sun/star/frame/FrameSearchFlag.hpp>
 #include <com/sun/star/util/XUpdatable.hpp>
 #include <comphelper/InlineContainer.hxx>
+#include <comphelper/propertysequence.hxx>
 
 #include <svtools/contextmenuhelper.hxx>
 #include <toolkit/awt/vclxmenu.hxx>
@@ -253,15 +254,12 @@ void SAL_CALL ChartController::setPosSize(
         uno::Reference< beans::XPropertySet > xProp( m_xChartView, uno::UNO_QUERY );
         if( xProp.is() )
         {
-            uno::Sequence< beans::PropertyValue > aZoomFactors(4);
-            aZoomFactors[0].Name = "ScaleXNumerator";
-            aZoomFactors[0].Value = uno::makeAny( nScaleXNumerator );
-            aZoomFactors[1].Name = "ScaleXDenominator";
-            aZoomFactors[1].Value = uno::makeAny( nScaleXDenominator );
-            aZoomFactors[2].Name = "ScaleYNumerator";
-            aZoomFactors[2].Value = uno::makeAny( nScaleYNumerator );
-            aZoomFactors[3].Name = "ScaleYDenominator";
-            aZoomFactors[3].Value = uno::makeAny( nScaleYDenominator );
+            auto aZoomFactors(::comphelper::InitPropertySequence({
+                { "ScaleXNumerator", uno::makeAny( nScaleXNumerator ) },
+                { "ScaleXDenominator", uno::makeAny( nScaleXDenominator ) },
+                { "ScaleYNumerator", uno::makeAny( nScaleYNumerator ) },
+                { "ScaleYDenominator", uno::makeAny( nScaleYDenominator ) }
+            }));
             xProp->setPropertyValue( "ZoomFactors", uno::makeAny( aZoomFactors ));
         }
 
diff --git a/chart2/source/controller/main/ShapeToolbarController.cxx b/chart2/source/controller/main/ShapeToolbarController.cxx
index ec0df94..63231e9 100644
--- a/chart2/source/controller/main/ShapeToolbarController.cxx
+++ b/chart2/source/controller/main/ShapeToolbarController.cxx
@@ -26,6 +26,7 @@
 #include <toolkit/helper/vclunohelper.hxx>
 #include <svx/svxids.hrc>
 #include <svx/tbxcustomshapes.hxx>
+#include <comphelper/propertysequence.hxx>
 
 using namespace com::sun::star;
 
@@ -233,9 +234,9 @@ Reference< awt::XWindow > ShapeToolbarController::createPopupWindow() throw (uno
 
 void ShapeToolbarController::execute( sal_Int16 KeyModifier ) throw (uno::RuntimeException, std::exception)
 {
-    uno::Sequence< beans::PropertyValue > aArgs( 1 );
-    aArgs[0].Name = "KeyModifier";
-    aArgs[0].Value <<= KeyModifier;
+    auto aArgs(::comphelper::InitPropertySequence({
+        { "KeyModifier", uno::makeAny(KeyModifier) }
+    }));
     dispatchCommand( m_aCommandURL, aArgs );
 }
 
diff --git a/comphelper/source/container/embeddedobjectcontainer.cxx b/comphelper/source/container/embeddedobjectcontainer.cxx
index 99a9686..1f3f61b 100644
--- a/comphelper/source/container/embeddedobjectcontainer.cxx
+++ b/comphelper/source/container/embeddedobjectcontainer.cxx
@@ -40,6 +40,7 @@
 #include <comphelper/storagehelper.hxx>
 #include <comphelper/embeddedobjectcontainer.hxx>
 #include <comphelper/sequence.hxx>
+#include <comphelper/propertysequence.hxx>
 #include <cppuhelper/weakref.hxx>
 #include <algorithm>
 #include <unordered_map>
@@ -492,11 +493,10 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject(
             uno::Sequence < beans::PropertyValue > aSeq;
             if ( bCopy )
             {
-                uno::Sequence<beans::PropertyValue> aObjArgs(2);
-                aObjArgs[0].Name = "SourceShellID";
-                aObjArgs[0].Value <<= rSrcShellID;
-                aObjArgs[1].Name = "DestinationShellID";
-                aObjArgs[1].Value <<= rDestShellID;
+                auto aObjArgs(::comphelper::InitPropertySequence({
+                    { "SourceShellID", uno::makeAny(rSrcShellID) },
+                    { "DestinationShellID", uno::makeAny(rDestShellID) }
+                }));
                 xPersist->storeToEntry(pImpl->mxStorage, rName, aSeq, aObjArgs);
             }
             else


More information about the Libreoffice-commits mailing list