summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-07-04 11:10:17 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-07-04 10:55:08 +0000
commit20b9cbd0e586fe89f8e1bdd942135445a256af7b (patch)
tree061d5276c6363be1d6b9db734e00676eec71f513
parent64acc9d576be9166c2da6edc6f8478e2cf31f606 (diff)
merge toolkit::NameContainer_Impl with toolkit::ScriptEventContainer
Change-Id: I14e9401056e31ee9d4ad5945a73ca31969430b4c Reviewed-on: https://gerrit.libreoffice.org/26891 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r--compilerplugins/clang/mergeclasses.results1
-rw-r--r--include/toolkit/controls/eventcontainer.hxx24
-rw-r--r--toolkit/source/controls/eventcontainer.cxx25
3 files changed, 18 insertions, 32 deletions
diff --git a/compilerplugins/clang/mergeclasses.results b/compilerplugins/clang/mergeclasses.results
index 42bbffd456f0..9464dd547363 100644
--- a/compilerplugins/clang/mergeclasses.results
+++ b/compilerplugins/clang/mergeclasses.results
@@ -388,7 +388,6 @@ merge sw::mark::ICheckboxFieldmark with sw::mark::CheckboxFieldmark
merge sw::sidebarwindows::SwSidebarWin with sw::annotation::SwAnnotationWin
merge sw::util::WrtRedlineAuthor with WW8_WrtRedlineAuthor
merge tdoc_ucp::OfficeDocumentsEventListener with tdoc_ucp::ContentProvider
-merge toolkit::NameContainer_Impl with toolkit::ScriptEventContainer
merge toolkit::ScrollableInterface with toolkit::ScrollableWrapper
merge unographic::GraphicTransformer with unographic::Graphic
merge vcl::DeletionNotifier with SalFrame
diff --git a/include/toolkit/controls/eventcontainer.hxx b/include/toolkit/controls/eventcontainer.hxx
index acc74cb65167..e41aaa02d78f 100644
--- a/include/toolkit/controls/eventcontainer.hxx
+++ b/include/toolkit/controls/eventcontainer.hxx
@@ -26,13 +26,9 @@
#include <toolkit/helper/listenermultiplexer.hxx>
-#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase.hxx>
#include <unordered_map>
-typedef ::cppu::WeakImplHelper2< css::container::XNameContainer,
- css::container::XContainer > NameContainerHelper;
-
-
namespace toolkit
{
@@ -46,7 +42,9 @@ typedef std::unordered_map
NameContainerNameMap;
-class NameContainer_Impl : public NameContainerHelper
+class ScriptEventContainer : public ::cppu::WeakImplHelper<
+ css::container::XNameContainer,
+ css::container::XContainer >
{
NameContainerNameMap mHashMap;
css::uno::Sequence< OUString > mNames;
@@ -57,12 +55,7 @@ class NameContainer_Impl : public NameContainerHelper
ContainerListenerMultiplexer maContainerListeners;
public:
- NameContainer_Impl( css::uno::Type const & aType )
- : mnElementCount( 0 ),
- mType( aType ),
- maContainerListeners( *this )
- {
- }
+ ScriptEventContainer();
// Methods XElementAccess
virtual css::uno::Type SAL_CALL getElementType( )
@@ -105,13 +98,6 @@ public:
throw(css::uno::RuntimeException, std::exception) override;
};
-class ScriptEventContainer : public NameContainer_Impl
-{
-public:
- ScriptEventContainer();
-};
-
-
} // namespace toolkit_namecontainer
#endif // INCLUDED_TOOLKIT_CONTROLS_EVENTCONTAINER_HXX
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<ScriptEventDescriptor>::get())
+ : mnElementCount( 0 ),
+ mType( cppu::UnoType<ScriptEventDescriptor>::get() ),
+ maContainerListeners( *this )
{
}