Kaydet (Commit) b1534edf authored tarafından Swachhand Lokhande's avatar Swachhand Lokhande Kaydeden (comit) Miklos Vajna

tdf#89592 Using initializer_lists to populate Sequence<PropertyValue>

Change-Id: Idef9dd55eb1719eaf592bc4a86440cbd5aa4fb32
Reviewed-on: https://gerrit.libreoffice.org/14781Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst bb2728fd
...@@ -26,6 +26,8 @@ ...@@ -26,6 +26,8 @@
#include <sfx2/dispatch.hxx> #include <sfx2/dispatch.hxx>
#include <sfx2/sfxsids.hrc> #include <sfx2/sfxsids.hrc>
#include <comphelper/propertysequence.hxx>
using namespace ::com::sun::star; using namespace ::com::sun::star;
namespace avmedia namespace avmedia
...@@ -146,13 +148,13 @@ void MediaToolBoxControl::implUpdateMediaControl() ...@@ -146,13 +148,13 @@ void MediaToolBoxControl::implUpdateMediaControl()
void MediaToolBoxControl::implExecuteMediaControl( const MediaItem& rItem ) void MediaToolBoxControl::implExecuteMediaControl( const MediaItem& rItem )
{ {
MediaItem aExecItem( SID_AVMEDIA_TOOLBOX ); MediaItem aExecItem( SID_AVMEDIA_TOOLBOX );
uno::Sequence< beans::PropertyValue > aArgs( 1 );
uno::Any aAny; uno::Any aAny;
auto aArgs(::comphelper::InitPropertySequence({
{ "AVMediaToolBox", makeAny(aAny) }
}));
aExecItem.merge( rItem ); aExecItem.merge( rItem );
aExecItem.QueryValue( aAny ); aExecItem.QueryValue( aAny );
aArgs[ 0 ].Name = "AVMediaToolBox" ;
aArgs[ 0 ].Value = aAny;
Dispatch( ".uno:AVMediaToolBox" , aArgs ); Dispatch( ".uno:AVMediaToolBox" , aArgs );
} }
......
...@@ -25,6 +25,8 @@ ...@@ -25,6 +25,8 @@
#include <tools/multisel.hxx> #include <tools/multisel.hxx>
#include <tools/resary.hxx> #include <tools/resary.hxx>
#include <comphelper/propertysequence.hxx>
namespace basctl namespace basctl
{ {
...@@ -136,12 +138,12 @@ Sequence<beans::PropertyValue> SAL_CALL Renderable::getRenderer ( ...@@ -136,12 +138,12 @@ Sequence<beans::PropertyValue> SAL_CALL Renderable::getRenderer (
{ {
Size aPageSize( pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) ); Size aPageSize( pPrinter->PixelToLogic( pPrinter->GetPaperSizePixel(), MapMode( MAP_100TH_MM ) ) );
aVals.realloc( 1 );
aVals[0].Name = "PageSize" ;
awt::Size aSize; awt::Size aSize;
aSize.Width = aPageSize.Width(); aSize.Width = aPageSize.Width();
aSize.Height = aPageSize.Height(); aSize.Height = aPageSize.Height();
aVals[0].Value <<= aSize; aVals = ::comphelper::InitPropertySequence({
{ "PageSize", makeAny(aSize) }
});
} }
appendPrintUIOptions( aVals ); appendPrintUIOptions( aVals );
......
...@@ -52,6 +52,7 @@ ...@@ -52,6 +52,7 @@
#include <com/sun/star/util/VetoException.hpp> #include <com/sun/star/util/VetoException.hpp>
#include <com/sun/star/script/ModuleSizeExceededRequest.hpp> #include <com/sun/star/script/ModuleSizeExceededRequest.hpp>
#include <comphelper/propertysequence.hxx>
namespace basctl namespace basctl
...@@ -1220,14 +1221,12 @@ void LibPage::ExportAsPackage( const OUString& aLibName ) ...@@ -1220,14 +1221,12 @@ void LibPage::ExportAsPackage( const OUString& aLibName )
const OUString strFullPath = "FullPath" ; const OUString strFullPath = "FullPath" ;
const OUString strBasicMediaType = "application/vnd.sun.star.basic-library" ; 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; OUString fullPath = aLibName;
fullPath += "/" ; fullPath += "/" ;
pattribs[ 0 ].Value <<= fullPath; auto attribs(::comphelper::InitPropertySequence({
pattribs[ 1 ].Name = strMediaType; { strFullPath, makeAny(fullPath) },
pattribs[ 1 ].Value <<= strBasicMediaType; { strMediaType, makeAny(strBasicMediaType) }
}));
manifest.push_back( attribs ); manifest.push_back( attribs );
// write into pipe: // write into pipe:
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
#include <comphelper/documentinfo.hxx> #include <comphelper/documentinfo.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
#include <osl/file.hxx> #include <osl/file.hxx>
#include <rtl/uri.hxx> #include <rtl/uri.hxx>
...@@ -815,9 +816,9 @@ namespace basctl ...@@ -815,9 +816,9 @@ namespace basctl
Sequence< PropertyValue > aArgs; Sequence< PropertyValue > aArgs;
if ( _rxStatusIndicator.is() ) if ( _rxStatusIndicator.is() )
{ {
aArgs.realloc(1); aArgs = ::comphelper::InitPropertySequence({
aArgs[0].Name = "StatusIndicator" ; { "StatusIndicator", makeAny(_rxStatusIndicator) }
aArgs[0].Value <<= _rxStatusIndicator; });
} }
try try
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include <test/bootstrapfixture.hxx> #include <test/bootstrapfixture.hxx>
#include <unotest/macros_test.hxx> #include <unotest/macros_test.hxx>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
#include <comphelper/propertysequence.hxx>
#include <com/sun/star/lang/XComponent.hpp> #include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/frame/Desktop.hpp> #include <com/sun/star/frame/Desktop.hpp>
...@@ -120,9 +121,9 @@ void ChartTest::load( const OUString& aDir, const OUString& aName ) ...@@ -120,9 +121,9 @@ void ChartTest::load( const OUString& aDir, const OUString& aName )
boost::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName) boost::shared_ptr<utl::TempFile> ChartTest::reload(const OUString& rFilterName)
{ {
uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY);
uno::Sequence<beans::PropertyValue> aArgs(1); auto aArgs(::comphelper::InitPropertySequence({
aArgs[0].Name = "FilterName"; { "FilterName", makeAny(rFilterName) }
aArgs[0].Value <<= rFilterName; }));
boost::shared_ptr<utl::TempFile> pTempFile = boost::make_shared<utl::TempFile>(); boost::shared_ptr<utl::TempFile> pTempFile = boost::make_shared<utl::TempFile>();
pTempFile->EnableKillingFile(); pTempFile->EnableKillingFile();
xStorable->storeToURL(pTempFile->GetURL(), aArgs); xStorable->storeToURL(pTempFile->GetURL(), aArgs);
......
...@@ -55,6 +55,7 @@ ...@@ -55,6 +55,7 @@
#include <com/sun/star/frame/FrameSearchFlag.hpp> #include <com/sun/star/frame/FrameSearchFlag.hpp>
#include <com/sun/star/util/XUpdatable.hpp> #include <com/sun/star/util/XUpdatable.hpp>
#include <comphelper/InlineContainer.hxx> #include <comphelper/InlineContainer.hxx>
#include <comphelper/propertysequence.hxx>
#include <svtools/contextmenuhelper.hxx> #include <svtools/contextmenuhelper.hxx>
#include <toolkit/awt/vclxmenu.hxx> #include <toolkit/awt/vclxmenu.hxx>
...@@ -253,15 +254,12 @@ void SAL_CALL ChartController::setPosSize( ...@@ -253,15 +254,12 @@ void SAL_CALL ChartController::setPosSize(
uno::Reference< beans::XPropertySet > xProp( m_xChartView, uno::UNO_QUERY ); uno::Reference< beans::XPropertySet > xProp( m_xChartView, uno::UNO_QUERY );
if( xProp.is() ) if( xProp.is() )
{ {
uno::Sequence< beans::PropertyValue > aZoomFactors(4); auto aZoomFactors(::comphelper::InitPropertySequence({
aZoomFactors[0].Name = "ScaleXNumerator"; { "ScaleXNumerator", uno::makeAny( nScaleXNumerator ) },
aZoomFactors[0].Value = uno::makeAny( nScaleXNumerator ); { "ScaleXDenominator", uno::makeAny( nScaleXDenominator ) },
aZoomFactors[1].Name = "ScaleXDenominator"; { "ScaleYNumerator", uno::makeAny( nScaleYNumerator ) },
aZoomFactors[1].Value = uno::makeAny( nScaleXDenominator ); { "ScaleYDenominator", uno::makeAny( nScaleYDenominator ) }
aZoomFactors[2].Name = "ScaleYNumerator"; }));
aZoomFactors[2].Value = uno::makeAny( nScaleYNumerator );
aZoomFactors[3].Name = "ScaleYDenominator";
aZoomFactors[3].Value = uno::makeAny( nScaleYDenominator );
xProp->setPropertyValue( "ZoomFactors", uno::makeAny( aZoomFactors )); xProp->setPropertyValue( "ZoomFactors", uno::makeAny( aZoomFactors ));
} }
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <toolkit/helper/vclunohelper.hxx> #include <toolkit/helper/vclunohelper.hxx>
#include <svx/svxids.hrc> #include <svx/svxids.hrc>
#include <svx/tbxcustomshapes.hxx> #include <svx/tbxcustomshapes.hxx>
#include <comphelper/propertysequence.hxx>
using namespace com::sun::star; using namespace com::sun::star;
...@@ -233,9 +234,9 @@ Reference< awt::XWindow > ShapeToolbarController::createPopupWindow() throw (uno ...@@ -233,9 +234,9 @@ Reference< awt::XWindow > ShapeToolbarController::createPopupWindow() throw (uno
void ShapeToolbarController::execute( sal_Int16 KeyModifier ) throw (uno::RuntimeException, std::exception) void ShapeToolbarController::execute( sal_Int16 KeyModifier ) throw (uno::RuntimeException, std::exception)
{ {
uno::Sequence< beans::PropertyValue > aArgs( 1 ); auto aArgs(::comphelper::InitPropertySequence({
aArgs[0].Name = "KeyModifier"; { "KeyModifier", uno::makeAny(KeyModifier) }
aArgs[0].Value <<= KeyModifier; }));
dispatchCommand( m_aCommandURL, aArgs ); dispatchCommand( m_aCommandURL, aArgs );
} }
......
...@@ -40,6 +40,7 @@ ...@@ -40,6 +40,7 @@
#include <comphelper/storagehelper.hxx> #include <comphelper/storagehelper.hxx>
#include <comphelper/embeddedobjectcontainer.hxx> #include <comphelper/embeddedobjectcontainer.hxx>
#include <comphelper/sequence.hxx> #include <comphelper/sequence.hxx>
#include <comphelper/propertysequence.hxx>
#include <cppuhelper/weakref.hxx> #include <cppuhelper/weakref.hxx>
#include <algorithm> #include <algorithm>
#include <unordered_map> #include <unordered_map>
...@@ -492,11 +493,10 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject( ...@@ -492,11 +493,10 @@ bool EmbeddedObjectContainer::StoreEmbeddedObject(
uno::Sequence < beans::PropertyValue > aSeq; uno::Sequence < beans::PropertyValue > aSeq;
if ( bCopy ) if ( bCopy )
{ {
uno::Sequence<beans::PropertyValue> aObjArgs(2); auto aObjArgs(::comphelper::InitPropertySequence({
aObjArgs[0].Name = "SourceShellID"; { "SourceShellID", uno::makeAny(rSrcShellID) },
aObjArgs[0].Value <<= rSrcShellID; { "DestinationShellID", uno::makeAny(rDestShellID) }
aObjArgs[1].Name = "DestinationShellID"; }));
aObjArgs[1].Value <<= rDestShellID;
xPersist->storeToEntry(pImpl->mxStorage, rName, aSeq, aObjArgs); xPersist->storeToEntry(pImpl->mxStorage, rName, aSeq, aObjArgs);
} }
else else
......
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