23#include <osl/diagnose.h>
25#include <com/sun/star/lang/IndexOutOfBoundsException.hpp>
26#include <com/sun/star/lang/NoSupportException.hpp>
34using namespace ::
cppu;
43 ,m_aContainerListeners(_rMutex)
66 return "com.sun.star.comp.dba.OBookmarkContainer";
76 return {
"com.sun.star.sdb.DefinitionContainer" };
85 throw ElementExistException();
88 throw IllegalArgumentException();
92 if (!(aElement >>= sNewLink))
93 throw IllegalArgumentException();
107 OUString sOldBookmark;
112 if (_rName.isEmpty())
113 throw IllegalArgumentException();
116 throw NoSuchElementException();
136 ClearableMutexGuard aGuard(
m_rMutex);
139 if (_rName.isEmpty())
140 throw IllegalArgumentException();
144 throw NoSuchElementException();
148 if (!(aElement >>= sNewLink))
149 throw IllegalArgumentException();
161 ContainerEvent
aEvent(*
this,
Any(_rName),
Any(sNewLink),
Any(sOldLink));
169 if (_rxListener.is())
176 if (_rxListener.is())
183 return ::cppu::UnoType<OUString>::get();
196 return new ::comphelper::OEnumerationByIndex(
static_cast<XIndexAccess*
>(
this));
211 throw IndexOutOfBoundsException();
221 throw NoSuchElementException();
231 OUString* pNames = aNames.getArray();
235 *pNames = bookmarkIndexed->first;
254 MapString2String::const_iterator aMapPos =
m_aBookmarks.end();
256 [&_rName](
const MapString2String::iterator& rIter) { return rIter->first == _rName; });
265 OSL_FAIL(
"OBookmarkContainer::implRemove: inconsistence!");
284 OSL_ENSURE(
checkExistence(_rName),
"OBookmarkContainer::implReplace : invalid name !");
296 throw NoSupportException();
sal_Int32 addInterface(const css::uno::Reference< ListenerT > &rxIFace)
sal_Int32 getLength() const
sal_Int32 removeInterface(const css::uno::Reference< ListenerT > &rxIFace)
void notifyEach(void(SAL_CALL ListenerT::*NotificationMethod)(const EventT &), const EventT &Event)
virtual void SAL_CALL acquire() SAL_NOEXCEPT SAL_OVERRIDE
virtual void SAL_CALL release() SAL_NOEXCEPT SAL_OVERRIDE
virtual css::uno::Any SAL_CALL getByIndex(sal_Int32 _nIndex) override
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual sal_Bool SAL_CALL hasByName(const OUString &aName) override
virtual void SAL_CALL replaceByName(const OUString &_rName, const css::uno::Any &aElement) override
::cppu::OWeakObject & m_rParent
bool checkExistence(const OUString &_rName)
quickly checks if there already is an element with a given name.
void implAppend(const OUString &_rName, const OUString &_rDocumentLocation)
virtual sal_Bool SAL_CALL hasElements() override
::comphelper::OInterfaceContainerHelper3< css::container::XContainerListener > m_aContainerListeners
void implReplace(const OUString &_rName, const OUString &_rNewLink)
virtual void SAL_CALL removeByName(const OUString &_rName) override
MapIteratorVector m_aBookmarksIndexed
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames() override
virtual void SAL_CALL setParent(const css::uno::Reference< css::uno::XInterface > &Parent) override
virtual css::uno::Type SAL_CALL getElementType() override
virtual OUString SAL_CALL getImplementationName() override
MapString2String m_aBookmarks
virtual css::uno::Any SAL_CALL getByName(const OUString &aName) override
virtual void SAL_CALL release() noexcept override
virtual void SAL_CALL removeContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration() override
void implRemove(const OUString &_rName)
virtual void SAL_CALL addContainerListener(const css::uno::Reference< css::container::XContainerListener > &xListener) override
virtual void SAL_CALL acquire() noexcept override
virtual sal_Int32 SAL_CALL getCount() override
virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override
virtual void SAL_CALL insertByName(const OUString &_rName, const css::uno::Any &aElement) override
OBookmarkContainer(::cppu::OWeakObject &_rParent, ::osl::Mutex &_rMutex)
constructs the container.
virtual ~OBookmarkContainer() override
looks like the dtor ...
virtual css::uno::Reference< css::uno::XInterface > SAL_CALL getParent() override
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)