From 20b9cbd0e586fe89f8e1bdd942135445a256af7b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 4 Jul 2016 11:10:17 +0200 Subject: merge toolkit::NameContainer_Impl with toolkit::ScriptEventContainer Change-Id: I14e9401056e31ee9d4ad5945a73ca31969430b4c Reviewed-on: https://gerrit.libreoffice.org/26891 Tested-by: Jenkins Reviewed-by: Noel Grandin --- toolkit/source/controls/eventcontainer.cxx | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'toolkit') diff --git a/toolkit/source/controls/eventcontainer.cxx b/toolkit/source/controls/eventcontainer.cxx index 418e3370431f..2e5b6fb4fec8 100644 --- a/toolkit/source/controls/eventcontainer.cxx +++ b/toolkit/source/controls/eventcontainer.cxx @@ -41,13 +41,13 @@ namespace toolkit { // Methods XElementAccess -Type NameContainer_Impl::getElementType() +Type ScriptEventContainer::getElementType() throw(RuntimeException, std::exception) { return mType; } -sal_Bool NameContainer_Impl::hasElements() +sal_Bool ScriptEventContainer::hasElements() throw(RuntimeException, std::exception) { bool bRet = (mnElementCount > 0); @@ -55,7 +55,7 @@ sal_Bool NameContainer_Impl::hasElements() } // Methods XNameAccess -Any NameContainer_Impl::getByName( const OUString& aName ) +Any ScriptEventContainer::getByName( const OUString& aName ) throw(NoSuchElementException, WrappedTargetException, RuntimeException, std::exception) { NameContainerNameMap::iterator aIt = mHashMap.find( aName ); @@ -68,13 +68,13 @@ Any NameContainer_Impl::getByName( const OUString& aName ) return aRetAny; } -Sequence< OUString > NameContainer_Impl::getElementNames() +Sequence< OUString > ScriptEventContainer::getElementNames() throw(RuntimeException, std::exception) { return mNames; } -sal_Bool NameContainer_Impl::hasByName( const OUString& aName ) +sal_Bool ScriptEventContainer::hasByName( const OUString& aName ) throw(RuntimeException, std::exception) { NameContainerNameMap::iterator aIt = mHashMap.find( aName ); @@ -84,7 +84,7 @@ sal_Bool NameContainer_Impl::hasByName( const OUString& aName ) // Methods XNameReplace -void NameContainer_Impl::replaceByName( const OUString& aName, const Any& aElement ) +void ScriptEventContainer::replaceByName( const OUString& aName, const Any& aElement ) throw(IllegalArgumentException, NoSuchElementException, WrappedTargetException, RuntimeException, std::exception) { const Type& aAnyType = aElement.getValueType(); @@ -111,7 +111,7 @@ void NameContainer_Impl::replaceByName( const OUString& aName, const Any& aEleme // Methods XNameContainer -void NameContainer_Impl::insertByName( const OUString& aName, const Any& aElement ) +void ScriptEventContainer::insertByName( const OUString& aName, const Any& aElement ) throw(IllegalArgumentException, ElementExistException, WrappedTargetException, RuntimeException, std::exception) { const Type& aAnyType = aElement.getValueType(); @@ -139,7 +139,7 @@ void NameContainer_Impl::insertByName( const OUString& aName, const Any& aElemen maContainerListeners.elementInserted( aEvent ); } -void NameContainer_Impl::removeByName( const OUString& Name ) +void ScriptEventContainer::removeByName( const OUString& Name ) throw(NoSuchElementException, WrappedTargetException, RuntimeException, std::exception) { NameContainerNameMap::iterator aIt = mHashMap.find( Name ); @@ -172,20 +172,21 @@ void NameContainer_Impl::removeByName( const OUString& Name ) } // Methods XContainer -void NameContainer_Impl::addContainerListener( const css::uno::Reference< css::container::XContainerListener >& l ) throw(css::uno::RuntimeException, std::exception) +void ScriptEventContainer::addContainerListener( const css::uno::Reference< css::container::XContainerListener >& l ) throw(css::uno::RuntimeException, std::exception) { maContainerListeners.addInterface( l ); } -void NameContainer_Impl::removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& l ) throw(css::uno::RuntimeException, std::exception) +void ScriptEventContainer::removeContainerListener( const css::uno::Reference< css::container::XContainerListener >& l ) throw(css::uno::RuntimeException, std::exception) { maContainerListeners.removeInterface( l ); } -// Ctor ScriptEventContainer::ScriptEventContainer() - : NameContainer_Impl( cppu::UnoType::get()) + : mnElementCount( 0 ), + mType( cppu::UnoType::get() ), + maContainerListeners( *this ) { } -- cgit