diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-05-16 11:12:48 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-06-29 07:25:22 +0000 |
commit | e57314f61f67b093510c5a8a8f34a62126ba8734 (patch) | |
tree | 7991c3a6f20c93b752628528196022474c6b4a7f /include/cppuhelper | |
parent | drop yet another reimplementation of rtl::Reference (SotMutexHolderRef) (diff) | |
download | core-e57314f61f67b093510c5a8a8f34a62126ba8734.tar.gz core-e57314f61f67b093510c5a8a8f34a62126ba8734.zip |
return and use std::vector from OInterfaceContainerHelper
since most of the time we don’t need a heavyweight uno::Sequence.
Adds a new method getElementsAsVector().
Change-Id: I9e72bef0c0c723ffd0dd7d4152db5baec6784a7a
Reviewed-on: https://gerrit.libreoffice.org/15747
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'include/cppuhelper')
-rw-r--r-- | include/cppuhelper/interfacecontainer.h | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/include/cppuhelper/interfacecontainer.h b/include/cppuhelper/interfacecontainer.h index a29eba04e752..74338f6074fd 100644 --- a/include/cppuhelper/interfacecontainer.h +++ b/include/cppuhelper/interfacecontainer.h @@ -47,7 +47,7 @@ namespace detail { */ union element_alias { - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > *pAsSequence; + std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > *pAsVector; ::com::sun::star::uno::XInterface * pAsInterface; element_alias() : pAsInterface(0) {} }; @@ -155,10 +155,18 @@ public: */ sal_Int32 SAL_CALL getLength() const; +#ifdef LIBO_INTERNAL_ONLY /** Return all interfaces added to this container. + @since LibreOffice 5.1 + Not exposed because std::vector is problematic for an ABI **/ - ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > SAL_CALL getElements() const; + std::vector< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > SAL_CALL getElementsAsVector() const; +#endif + /** + Return all interfaces added to this container. + **/ + css::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > > SAL_CALL getElements() const; /** Inserts an element into the container. The position is not specified, thus it is not specified in which order events are fired. @@ -236,14 +244,14 @@ public: private: friend class OInterfaceIteratorHelper; /** - bIsList == TRUE -> aData.pAsSequence of type Sequence< XInterfaceSequence >, + bIsList == TRUE -> aData.pAsVector of type std::vector< XInterface >, otherwise aData.pAsInterface == of type (XEventListener *) */ detail::element_alias aData; ::osl::Mutex & rMutex; /** TRUE -> used by an iterator. */ sal_Bool bInUse; - /** TRUE -> aData.pAsSequence is of type Sequence< XInterfaceSequence >. */ + /** TRUE -> aData.pAsVector is of type std::vector< XInterface >. */ sal_Bool bIsList; OInterfaceContainerHelper( const OInterfaceContainerHelper & ) |