1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #ifndef INCLUDED_COMPHELPER_PROPERTYSEQUENCE_HXX
11 #define INCLUDED_COMPHELPER_PROPERTYSEQUENCE_HXX
14 #include <initializer_list>
15 #include <com/sun/star/uno/Any.hxx>
16 #include <com/sun/star/uno/Sequence.hxx>
17 #include <com/sun/star/beans/PropertyValue.hpp>
21 inline css::uno::Sequence
< css::beans::PropertyValue
> InitPropertySequence(
22 ::std::initializer_list
< ::std::pair
< OUString
, css::uno::Any
> > vInit
)
24 css::uno::Sequence
< css::beans::PropertyValue
> vResult
{static_cast<sal_Int32
>(vInit
.size())};
26 for(const auto& aEntry
: vInit
)
28 vResult
[nCount
].Name
= aEntry
.first
;
29 vResult
[nCount
].Handle
= -1;
30 vResult
[nCount
].Value
= aEntry
.second
;
31 // State is default-initialized to DIRECT_VALUE
36 } // namespace comphelper
39 #endif // INCLUDED_COMPHELPER_PROPERTYSEQUENCE_HXX
41 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */