Kaydet (Commit) 20b9cbd0 authored tarafından Noel Grandin's avatar Noel Grandin Kaydeden (comit) Noel Grandin

merge toolkit::NameContainer_Impl with toolkit::ScriptEventContainer

Change-Id: I14e9401056e31ee9d4ad5945a73ca31969430b4c
Reviewed-on: https://gerrit.libreoffice.org/26891Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noelgrandin@gmail.com>
üst 64acc9d5
......@@ -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
......
......@@ -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
......
......@@ -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 )
{
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment