diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-24 20:54:49 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-05-25 19:01:03 +0200 |
commit | b4bf19321ed9ce2d0e49341193690fef0c7085ea (patch) | |
tree | 1ada5626ee19de2217f3178e2888282cd1aaf9f2 /comphelper | |
parent | 18321eb3f447c9e6519e1691673677fc8a2c8117 (diff) |
directly instantiate IndexedPropertyValuesContainer
without the overhead of the UNO service engine
Change-Id: I4a02fda2b3c92a897634374bf72cfffee4f531f8
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/134923
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'comphelper')
-rw-r--r-- | comphelper/source/container/IndexedPropertyValuesContainer.cxx | 45 |
1 files changed, 5 insertions, 40 deletions
diff --git a/comphelper/source/container/IndexedPropertyValuesContainer.cxx b/comphelper/source/container/IndexedPropertyValuesContainer.cxx index 08b46518bebf..f5b7358d64c4 100644 --- a/comphelper/source/container/IndexedPropertyValuesContainer.cxx +++ b/comphelper/source/container/IndexedPropertyValuesContainer.cxx @@ -17,56 +17,19 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#include <com/sun/star/container/XIndexContainer.hpp> -#include <com/sun/star/uno/Sequence.h> -#include <com/sun/star/beans/PropertyValue.hpp> -#include <cppuhelper/implbase.hxx> #include <com/sun/star/lang/IllegalArgumentException.hpp> #include <com/sun/star/lang/IndexOutOfBoundsException.hpp> -#include <com/sun/star/lang/XServiceInfo.hpp> +#include <comphelper/indexedpropertyvalues.hxx> #include <cppuhelper/supportsservice.hxx> #include <o3tl/safeint.hxx> -#include <vector> - namespace com::sun::star::uno { class XComponentContext; } using namespace com::sun::star; -typedef std::vector < uno::Sequence< beans::PropertyValue > > IndexedPropertyValues; - -namespace { - -class IndexedPropertyValuesContainer : public cppu::WeakImplHelper< container::XIndexContainer, lang::XServiceInfo > -{ -public: - IndexedPropertyValuesContainer() noexcept; - - // XIndexContainer - virtual void SAL_CALL insertByIndex( sal_Int32 nIndex, const css::uno::Any& aElement ) override; - virtual void SAL_CALL removeByIndex( sal_Int32 nIndex ) override; - - // XIndexReplace - virtual void SAL_CALL replaceByIndex( sal_Int32 nIndex, const css::uno::Any& aElement ) override; - // XIndexAccess - virtual sal_Int32 SAL_CALL getCount( ) override; - virtual css::uno::Any SAL_CALL getByIndex( sal_Int32 nIndex ) override; +namespace comphelper { - // XElementAccess - virtual css::uno::Type SAL_CALL getElementType( ) override; - virtual sal_Bool SAL_CALL hasElements( ) override; - - //XServiceInfo - virtual OUString SAL_CALL getImplementationName( ) override; - virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override; - virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames( ) override; - -private: - IndexedPropertyValues maProperties; -}; - -} IndexedPropertyValuesContainer::IndexedPropertyValuesContainer() noexcept { @@ -151,12 +114,14 @@ css::uno::Sequence< OUString > SAL_CALL IndexedPropertyValuesContainer::getSuppo return { "com.sun.star.document.IndexedPropertyValues" }; } +} // namespace comphelper + extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * IndexedPropertyValuesContainer_get_implementation( css::uno::XComponentContext *, css::uno::Sequence<css::uno::Any> const &) { - return cppu::acquire(new IndexedPropertyValuesContainer()); + return cppu::acquire(new comphelper::IndexedPropertyValuesContainer()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |