33using namespace css::uno;
34using namespace css::xml::dom;
35using namespace css::xml::dom::events;
39 class WeakEventListener :
public ::cppu::WeakImplHelper<css::xml::dom::events::XEventListener>
42 css::uno::WeakReference<css::xml::dom::events::XEventListener> mxOwner;
45 explicit WeakEventListener(
const css::uno::Reference<css::xml::dom::events::XEventListener>& rOwner)
50 virtual void SAL_CALL handleEvent(
const css::uno::Reference<css::xml::dom::events::XEvent>& rEvent)
override
52 css::uno::Reference<css::xml::dom::events::XEventListener> xOwner(mxOwner.get(),
55 xOwner->handleEvent(rEvent);
67 xmlChar *
const pRet =
new xmlChar[os.getLength() + 1];
68 strcpy(
reinterpret_cast<char*
>(pRet), os.getStr());
73 ::osl::Mutex & rMutex,
74 std::u16string_view rName, OUString
const*
const pURI)
78 m_xImpl->registerListener(*pElement);
83 ::osl::Mutex & rMutex,
84 std::u16string_view rName, OUString
const*
const pURI)
85 : m_pElement(
std::move(pElement))
108 Reference< XEventTarget >
const xTarget(
109 static_cast<XElement*
>(& rElement), UNO_QUERY_THROW);
130 while (pNode !=
nullptr )
132 if (pNode->type == XML_ELEMENT_NODE &&
133 (strcmp(
reinterpret_cast<char const *
>(pNode->name),
reinterpret_cast<char*
>(
m_pName.get())) == 0))
138 if (pNode->ns !=
nullptr && (0 ==
139 strcmp(
reinterpret_cast<char const *
>(pNode->ns->href),
reinterpret_cast<char*
>(
m_pURI.get()))))
145 if (pNode->children !=
nullptr)
buildlist(pNode->children,
false);
147 if (!
start) pNode = pNode->next;
157 ::osl::MutexGuard
const g(
m_rMutex);
172 ::osl::MutexGuard
const g(
m_rMutex);
186 ::osl::MutexGuard
const g(
m_rMutex);
virtual css::uno::Reference< css::xml::dom::XNode > SAL_CALL item(sal_Int32 index) override
Returns the indexth item in the collection.
::rtl::Reference< CElement > const m_pElement
css::uno::Reference< css::xml::dom::events::XEventListener > m_xEventListener
proxy weak binding to forward Events to ourself without an ownership cycle
virtual void SAL_CALL handleEvent(const css::uno::Reference< css::xml::dom::events::XEvent > &evt) override
::std::unique_ptr< xmlChar[]> const m_pURI
virtual sal_Int32 SAL_CALL getLength() override
The number of nodes in the list.
virtual ~CElementListImpl() override
::std::unique_ptr< xmlChar[]> const m_pName
void buildlist(xmlNodePtr pNode, bool start=true)
CElementListImpl(::rtl::Reference< CElement > pElement, ::osl::Mutex &rMutex, std::u16string_view rName, OUString const *const pURI)
std::vector< xmlNodePtr > m_nodevector
void registerListener(CElement &rElement)
rtl::Reference< CElementListImpl > m_xImpl
CElementList(::rtl::Reference< CElement > const &pElement, ::osl::Mutex &rMutex, std::u16string_view rName, OUString const *const pURI=nullptr)
#define TOOLS_WARN_EXCEPTION(area, stream)
Reference< XInterface > xTarget
static xmlChar * lcl_initXmlString(std::u16string_view rString)
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)