xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx                |    4 +--
 xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx |    6 +----
 xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx         |    6 +----
 xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx    |    3 --
 xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx     |   12 
----------
 xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx     |    7 -----
 6 files changed, 7 insertions(+), 31 deletions(-)

New commits:
commit 6f812b7ac60c1c4fbc8ccba234c19ccf3871dee4
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Fri Jan 13 08:27:41 2023 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sat Jan 14 09:31:29 2023 +0000

    XUnoTunnel->dynamic_cast in XMLElementWrapper_XmlSecImpl
    
    Change-Id: Ie0654c8ba6367b575c289b63ac02668ae38066c5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/145495
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx 
b/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx
index 1afcd3c88a57..ee28084b1bcb 100644
--- a/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx
+++ b/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx
@@ -78,7 +78,7 @@ SAL_CALL XMLSignature_GpgImpl::generate(
     }
 
     XMLElementWrapper_XmlSecImpl* pElement =
-        comphelper::getFromUnoTunnel<XMLElementWrapper_XmlSecImpl>(xElement);
+        dynamic_cast<XMLElementWrapper_XmlSecImpl*>(xElement.get());
     if( pElement == nullptr ) {
         throw RuntimeException() ;
     }
@@ -282,7 +282,7 @@ SAL_CALL XMLSignature_GpgImpl::validate(
         throw RuntimeException() ;
 
     XMLElementWrapper_XmlSecImpl* pElement =
-        comphelper::getFromUnoTunnel<XMLElementWrapper_XmlSecImpl>(xElement);
+        dynamic_cast<XMLElementWrapper_XmlSecImpl*>(xElement.get());
     if( pElement == nullptr )
         throw RuntimeException() ;
 
diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx 
b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
index 23833e71106b..d20aa649efdb 100644
--- a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
+++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx
@@ -112,8 +112,7 @@ SAL_CALL XMLSignature_MSCryptImpl::generate(
         throw RuntimeException() ;
     }
 
-    Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY_THROW ) ;
-    XMLElementWrapper_XmlSecImpl* pElement = 
comphelper::getFromUnoTunnel<XMLElementWrapper_XmlSecImpl>(xNodTunnel);
+    XMLElementWrapper_XmlSecImpl* pElement = 
dynamic_cast<XMLElementWrapper_XmlSecImpl*>(xElement.get());
     if( pElement == nullptr ) {
         throw RuntimeException() ;
     }
@@ -199,8 +198,7 @@ SAL_CALL XMLSignature_MSCryptImpl::validate(
     if( !xElement.is() )
         throw RuntimeException() ;
 
-    Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY_THROW ) ;
-    XMLElementWrapper_XmlSecImpl* pElement = 
comphelper::getFromUnoTunnel<XMLElementWrapper_XmlSecImpl>(xNodTunnel);
+    XMLElementWrapper_XmlSecImpl* pElement = 
dynamic_cast<XMLElementWrapper_XmlSecImpl*>(xElement.get());
     if( pElement == nullptr )
         throw RuntimeException() ;
 
diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx 
b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
index 9b79b79b245b..4c5cc4b418d8 100644
--- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
+++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
@@ -110,9 +110,8 @@ SAL_CALL XMLSignature_NssImpl::generate(
         throw RuntimeException() ;
     }
 
-    Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY_THROW ) ;
     XMLElementWrapper_XmlSecImpl* pElement
-        = 
comphelper::getFromUnoTunnel<XMLElementWrapper_XmlSecImpl>(xNodTunnel);
+        = dynamic_cast<XMLElementWrapper_XmlSecImpl*>(xElement.get());
     if( pElement == nullptr ) {
         throw RuntimeException() ;
     }
@@ -192,9 +191,8 @@ SAL_CALL XMLSignature_NssImpl::validate(
     if( !xElement.is() )
         throw RuntimeException() ;
 
-    Reference< XUnoTunnel > xNodTunnel( xElement , UNO_QUERY_THROW ) ;
     XMLElementWrapper_XmlSecImpl* pElement
-        = 
comphelper::getFromUnoTunnel<XMLElementWrapper_XmlSecImpl>(xNodTunnel);
+        = dynamic_cast<XMLElementWrapper_XmlSecImpl*>(xElement.get());
     if( pElement == nullptr )
         throw RuntimeException() ;
 
diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx 
b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
index 1694e30c86a2..ccc3eb98f4e9 100644
--- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx
@@ -370,9 +370,8 @@ xmlNodePtr XMLDocumentWrapper_XmlSecImpl::checkElement( 
const uno::Reference< cs
 
     if (xXMLElement.is())
     {
-        uno::Reference< css::lang::XUnoTunnel > xNodTunnel( xXMLElement, 
uno::UNO_QUERY_THROW ) ;
         XMLElementWrapper_XmlSecImpl* pElement
-            = 
comphelper::getFromUnoTunnel<XMLElementWrapper_XmlSecImpl>(xNodTunnel);
+            = dynamic_cast<XMLElementWrapper_XmlSecImpl*>(xXMLElement.get());
 
         if( pElement == nullptr ) {
             throw uno::RuntimeException() ;
diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx 
b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
index 9104966185ea..ccc4f03dd964 100644
--- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
+++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.cxx
@@ -32,18 +32,6 @@ 
XMLElementWrapper_XmlSecImpl::XMLElementWrapper_XmlSecImpl(const xmlNodePtr pNod
 {
 }
 
-/* XUnoTunnel */
-const uno::Sequence< sal_Int8 > & 
XMLElementWrapper_XmlSecImpl::getUnoTunnelId()
-{
-    static const comphelper::UnoIdInit implId;
-    return implId.getSeq();
-}
-
-sal_Int64 SAL_CALL XMLElementWrapper_XmlSecImpl::getSomething( const 
uno::Sequence< sal_Int8 >& aIdentifier )
-{
-    return comphelper::getSomethingImpl(aIdentifier, this);
-}
-
 /* XServiceInfo */
 OUString SAL_CALL XMLElementWrapper_XmlSecImpl::getImplementationName(  )
 {
diff --git a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx 
b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx
index de833d25a139..93ce721f0b3f 100644
--- a/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx
+++ b/xmlsecurity/source/xmlsec/xmlelementwrapper_xmlsecimpl.hxx
@@ -20,7 +20,6 @@
 #pragma once
 
 #include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp>
-#include <com/sun/star/lang/XUnoTunnel.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <cppuhelper/implbase.hxx>
 
@@ -30,7 +29,6 @@
 class XMLElementWrapper_XmlSecImpl : public cppu::WeakImplHelper
 <
     css::xml::wrapper::XXMLElementWrapper,
-    css::lang::XUnoTunnel,
     css::lang::XServiceInfo
 >
 /****** XMLElementWrapper_XmlSecImpl.hxx/CLASS XMLElementWrapper_XmlSecImpl ***
@@ -52,11 +50,6 @@ public:
 
     /* XXMLElementWrapper */
 
-    /* css::lang::XUnoTunnel */
-    virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< 
sal_Int8 >& aIdentifier ) override;
-    /// @throws css::uno::RuntimeException
-    static const css::uno::Sequence < sal_Int8 > & getUnoTunnelId();
-
     /* css::lang::XServiceInfo */
     virtual OUString SAL_CALL getImplementationName(  ) override;
     virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) 
override;

Reply via email to