unoxml/source/dom/document.cxx | 12 +++++------- unoxml/source/dom/document.hxx | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-)
New commits: commit 31ed7f6615bbe2deee5351960412c4ceb0eab345 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Sat Sep 14 08:54:38 2024 +0200 Commit: Caolán McNamara <caolan.mcnam...@collabora.com> CommitDate: Mon Feb 24 13:02:43 2025 +0100 use more concrete UNO type in CDocument Change-Id: Ifd7306ab7219d940c55b3cc1054f65f64141616e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/173352 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Jenkins (cherry picked from commit df87686917376179de937c824396d236a02eba7a) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/182084 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Caolán McNamara <caolan.mcnam...@collabora.com> diff --git a/unoxml/source/dom/document.cxx b/unoxml/source/dom/document.cxx index 0825fc2cd7ed..f3d091100456 100644 --- a/unoxml/source/dom/document.cxx +++ b/unoxml/source/dom/document.cxx @@ -99,7 +99,7 @@ namespace DOM xDoc->m_NodeMap.emplace( reinterpret_cast<xmlNodePtr>(pDoc), ::std::make_pair( - WeakReference<XNode>(static_cast<XDocument*>(xDoc.get())), + xDoc.get(), xDoc.get())); return xDoc; } @@ -111,7 +111,7 @@ namespace DOM // node map must be empty now, otherwise CDocument must not die! for (const auto& rEntry : m_NodeMap) { - Reference<XNode> const xNode(rEntry.second.first); + rtl::Reference<CNode> const xNode(rEntry.second.first); OSL_ENSURE(!xNode.is(), "CDocument::~CDocument(): ERROR: live node in document node map!"); } @@ -168,12 +168,10 @@ namespace DOM nodemap_t::const_iterator const i = m_NodeMap.find(pNode); if (i != m_NodeMap.end()) { // #i113681# check that the CNode is still alive - uno::Reference<XNode> const xNode(i->second.first); + rtl::Reference<CNode> const xNode(i->second.first); if (xNode.is()) { - ::rtl::Reference<CNode> ret(i->second.second); - OSL_ASSERT(ret.is()); - return ret; + return xNode; } } @@ -249,7 +247,7 @@ namespace DOM if (pCNode != nullptr) { bool const bInserted = m_NodeMap.emplace( pNode, - ::std::make_pair(WeakReference<XNode>(pCNode), pCNode.get()) + ::std::make_pair(pCNode.get(), pCNode.get()) ).second; OSL_ASSERT(bInserted); if (!bInserted) { diff --git a/unoxml/source/dom/document.hxx b/unoxml/source/dom/document.hxx index 450b9200f86f..6ebf71192411 100644 --- a/unoxml/source/dom/document.hxx +++ b/unoxml/source/dom/document.hxx @@ -27,7 +27,7 @@ #include <sal/types.h> #include <cppuhelper/implbase.hxx> -#include <cppuhelper/weakref.hxx> +#include <unotools/weakref.hxx> #include <com/sun/star/uno/Reference.h> #include <com/sun/star/beans/StringPair.hpp> @@ -81,7 +81,7 @@ namespace DOM css::uno::Reference< css::io::XOutputStream > m_rOutputStream; typedef std::unordered_map< xmlNodePtr, - ::std::pair< css::uno::WeakReference<css::xml::dom::XNode>, CNode* > > nodemap_t; + ::std::pair< unotools::WeakReference<CNode>, CNode* > > nodemap_t; nodemap_t m_NodeMap; ::std::unique_ptr<events::CEventDispatcher> const m_pEventDispatcher;