xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

New commits:
commit 652202f0ee2fe2891f09ac9a1c6a87e944e7bb22
Author:     Stephan Bergmann <sberg...@redhat.com>
AuthorDate: Tue Dec 13 08:35:54 2022 +0100
Commit:     Stephan Bergmann <sberg...@redhat.com>
CommitDate: Mon Dec 19 19:52:48 2022 +0000

    Use XUnoTunnel instead of dynamic_cast here too
    
    ...like in other code accessing XMLElementWrapper_XmlSecImpl. (See the 
upcoming
    commit introducing loplugin:unocast on why such dynamic_casts from UNO 
types are
    dangerous.)
    
    Change-Id: Ib67332dd2d6a1aa31f5515940fdd6f4a9f638bbb
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/144508
    Tested-by: Jenkins
    Reviewed-by: Stephan Bergmann <sberg...@redhat.com>

diff --git a/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx 
b/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx
index dd7a4a14873f..ebe113c73175 100644
--- a/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx
+++ b/xmlsecurity/source/gpg/xmlsignature_gpgimpl.cxx
@@ -20,6 +20,7 @@
 #include <sal/config.h>
 #include <sal/log.hxx>
 #include <xmlsec-wrapper.h>
+#include <comphelper/servicehelper.hxx>
 #include <cppuhelper/supportsservice.hxx>
 #include <gpg/xmlsignature_gpgimpl.hxx>
 
@@ -77,7 +78,7 @@ SAL_CALL XMLSignature_GpgImpl::generate(
     }
 
     XMLElementWrapper_XmlSecImpl* pElement =
-        dynamic_cast<XMLElementWrapper_XmlSecImpl*>(xElement.get());
+        comphelper::getFromUnoTunnel<XMLElementWrapper_XmlSecImpl>(xElement);
     if( pElement == nullptr ) {
         throw RuntimeException() ;
     }
@@ -281,7 +282,7 @@ SAL_CALL XMLSignature_GpgImpl::validate(
         throw RuntimeException() ;
 
     XMLElementWrapper_XmlSecImpl* pElement =
-        dynamic_cast<XMLElementWrapper_XmlSecImpl*>(xElement.get());
+        comphelper::getFromUnoTunnel<XMLElementWrapper_XmlSecImpl>(xElement);
     if( pElement == nullptr )
         throw RuntimeException() ;
 

Reply via email to