toolkit/inc/controls/eventcontainer.hxx | 1 - toolkit/source/controls/eventcontainer.cxx | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-)
New commits: commit 59a5fdd32727447239ee91cea00f943609540507 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Wed May 13 15:53:27 2020 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed May 13 18:58:38 2020 +0200 fix ScriptEventContainer::isEmpty which was relying on the nElementCount field, which was not being updated. Just delete it and check the map. Change-Id: If543abcc7c1778a27675a1df69a54325024234b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/94133 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/toolkit/inc/controls/eventcontainer.hxx b/toolkit/inc/controls/eventcontainer.hxx index beca65e3e38f..79a434a39849 100644 --- a/toolkit/inc/controls/eventcontainer.hxx +++ b/toolkit/inc/controls/eventcontainer.hxx @@ -49,7 +49,6 @@ class ScriptEventContainer final : public ::cppu::WeakImplHelper< NameContainerNameMap mHashMap; css::uno::Sequence< OUString > mNames; std::vector< css::uno::Any > mValues; - sal_Int32 mnElementCount; css::uno::Type mType; ContainerListenerMultiplexer maContainerListeners; diff --git a/toolkit/source/controls/eventcontainer.cxx b/toolkit/source/controls/eventcontainer.cxx index 165c91296cb9..04aeaf2bfc42 100644 --- a/toolkit/source/controls/eventcontainer.cxx +++ b/toolkit/source/controls/eventcontainer.cxx @@ -43,8 +43,7 @@ Type ScriptEventContainer::getElementType() sal_Bool ScriptEventContainer::hasElements() { - bool bRet = (mnElementCount > 0); - return bRet; + return !mHashMap.empty(); } // Methods XNameAccess @@ -171,8 +170,7 @@ void ScriptEventContainer::removeContainerListener( const css::uno::Reference< c ScriptEventContainer::ScriptEventContainer() - : mnElementCount( 0 ), - mType( cppu::UnoType<ScriptEventDescriptor>::get() ), + : mType( cppu::UnoType<ScriptEventDescriptor>::get() ), maContainerListeners( *this ) { } _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits