diff options
author | Arkadiy Illarionov <qarkai@gmail.com> | 2019-06-18 00:10:57 +0300 |
---|---|---|
committer | Michael Stahl <Michael.Stahl@cib.de> | 2019-06-18 12:50:43 +0200 |
commit | cc0dc723c7d8354b5203310ef1381bbf54258eba (patch) | |
tree | 787bd46d15e67f6a57c16b880354ea99068589df /unoxml/source/dom | |
parent | f362a3d8cc164bad7a61c9fd2191e3a80d5fd030 (diff) |
tdf#39593 Remove DOM::CNode::GetImplementation
Replace with comphelper::getUnoTunnelImplementation.
Change-Id: If98801fd85bf0967c54e1924a04b6de371868942
Reviewed-on: https://gerrit.libreoffice.org/74234
Tested-by: Jenkins
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'unoxml/source/dom')
-rw-r--r-- | unoxml/source/dom/element.cxx | 5 | ||||
-rw-r--r-- | unoxml/source/dom/node.cxx | 24 |
2 files changed, 12 insertions, 17 deletions
diff --git a/unoxml/source/dom/element.cxx b/unoxml/source/dom/element.cxx index f7cae19fdbdc..6ed9ba1ebd1e 100644 --- a/unoxml/source/dom/element.cxx +++ b/unoxml/source/dom/element.cxx @@ -29,6 +29,7 @@ #include <com/sun/star/xml/sax/FastToken.hpp> #include <comphelper/attributelist.hxx> +#include <comphelper/servicehelper.hxx> #include <node.hxx> #include "attr.hxx" @@ -472,7 +473,7 @@ namespace DOM } ::rtl::Reference<CNode> const pCNode( - CNode::GetImplementation(Reference<XNode>(oldAttr.get()))); + comphelper::getUnoTunnelImplementation<CNode>(Reference<XNode>(oldAttr.get()))); if (!pCNode.is()) { throw RuntimeException(); } xmlNodePtr const pNode = pCNode->GetNodePtr(); @@ -532,7 +533,7 @@ namespace DOM // get the implementation CAttr *const pCAttr = dynamic_cast<CAttr*>( - CNode::GetImplementation(xNewAttr)); + comphelper::getUnoTunnelImplementation<CNode>(xNewAttr)); if (!pCAttr) { throw RuntimeException(); } xmlAttrPtr const pAttr = reinterpret_cast<xmlAttrPtr>(pCAttr->GetNodePtr()); diff --git a/unoxml/source/dom/node.cxx b/unoxml/source/dom/node.cxx index f486182eca83..7171e6c2f791 100644 --- a/unoxml/source/dom/node.cxx +++ b/unoxml/source/dom/node.cxx @@ -168,15 +168,9 @@ namespace DOM } } - CNode * - CNode::GetImplementation(uno::Reference<uno::XInterface> const& xNode) + const css::uno::Sequence< sal_Int8 > & CNode::getUnoTunnelId() throw() { - uno::Reference<lang::XUnoTunnel> const xUnoTunnel(xNode, UNO_QUERY); - if (!xUnoTunnel.is()) { return nullptr; } - CNode *const pCNode( reinterpret_cast< CNode* >( - ::sal::static_int_cast< sal_IntPtr >( - xUnoTunnel->getSomething(theCNodeUnoTunnelId::get().getSeq())))); - return pCNode; + return theCNodeUnoTunnelId::get().getSeq(); } CDocument & CNode::GetOwnerDocument() @@ -290,7 +284,7 @@ namespace DOM if (nullptr == m_aNodePtr) { return nullptr; } - CNode *const pNewChild(CNode::GetImplementation(xNewChild)); + CNode *const pNewChild(comphelper::getUnoTunnelImplementation<CNode>(xNewChild)); if (!pNewChild) { throw RuntimeException(); } xmlNodePtr const cur = pNewChild->GetNodePtr(); if (!cur) { throw RuntimeException(); } @@ -645,8 +639,8 @@ namespace DOM ::osl::ClearableMutexGuard guard(m_rMutex); - CNode *const pNewNode(CNode::GetImplementation(newChild)); - CNode *const pRefNode(CNode::GetImplementation(refChild)); + CNode *const pNewNode(comphelper::getUnoTunnelImplementation<CNode>(newChild)); + CNode *const pRefNode(comphelper::getUnoTunnelImplementation<CNode>(refChild)); if (!pNewNode || !pRefNode) { throw RuntimeException(); } xmlNodePtr const pNewChild(pNewNode->GetNodePtr()); xmlNodePtr const pRefChild(pRefNode->GetNodePtr()); @@ -753,7 +747,7 @@ namespace DOM Reference<XNode> xReturn( xOldChild ); - ::rtl::Reference<CNode> const pOld(CNode::GetImplementation(xOldChild)); + ::rtl::Reference<CNode> const pOld(comphelper::getUnoTunnelImplementation<CNode>(xOldChild)); if (!pOld.is()) { throw RuntimeException(); } xmlNodePtr const old = pOld->GetNodePtr(); if (!old) { throw RuntimeException(); } @@ -825,9 +819,9 @@ namespace DOM ::osl::ClearableMutexGuard guard(m_rMutex); ::rtl::Reference<CNode> const pOldNode( - CNode::GetImplementation(xOldChild)); + comphelper::getUnoTunnelImplementation<CNode>(xOldChild)); ::rtl::Reference<CNode> const pNewNode( - CNode::GetImplementation(xNewChild)); + comphelper::getUnoTunnelImplementation<CNode>(xNewChild)); if (!pOldNode.is() || !pNewNode.is()) { throw RuntimeException(); } xmlNodePtr const pOld = pOldNode->GetNodePtr(); xmlNodePtr const pNew = pNewNode->GetNodePtr(); @@ -1000,7 +994,7 @@ namespace DOM CNode::getSomething(Sequence< ::sal_Int8 > const& rId) { if ((rId.getLength() == 16) && - (0 == memcmp(theCNodeUnoTunnelId::get().getSeq().getConstArray(), + (0 == memcmp(getUnoTunnelId().getConstArray(), rId.getConstArray(), 16))) { return ::sal::static_int_cast< sal_Int64 >( |