From dbfb82b6da0f4e6d7be9a0010eb4db8e1bf92ee0 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Wed, 13 Jan 2016 09:37:10 +0100 Subject: xmlsecurity: refactor to allow multiple signature parser implementations Change-Id: I1d1ae4a0bf41b89fe2f8db9b44d3b0b7a0dfd1cd --- xmlsecurity/source/helper/xsecctl.cxx | 1 - xmlsecurity/source/helper/xsecctl.hxx | 2 +- xmlsecurity/source/helper/xsecverify.cxx | 11 ++++++----- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'xmlsecurity') diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index 2cdfbb1b2994..cc6a2e14cd68 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -56,7 +56,6 @@ XSecController::XSecController( const cssu::Reference& , m_nStatusOfSecurityComponents(UNINITIALIZED) , m_bIsSAXEventKeeperSticky(false) , m_pErrorMessage(nullptr) - , m_pXSecParser(nullptr) , m_nReservedSignatureId(0) , m_bVerifyCurrentSignature(false) { diff --git a/xmlsecurity/source/helper/xsecctl.hxx b/xmlsecurity/source/helper/xsecctl.hxx index 916fb3cac3c2..734ecdb4b75a 100644 --- a/xmlsecurity/source/helper/xsecctl.hxx +++ b/xmlsecurity/source/helper/xsecctl.hxx @@ -310,7 +310,7 @@ private: /* * the XSecParser which is used to parse the signature stream */ - XSecParser *m_pXSecParser; + css::uno::Reference m_xSecParser; /* * the caller assigned signature id for the next signature in the diff --git a/xmlsecurity/source/helper/xsecverify.cxx b/xmlsecurity/source/helper/xsecverify.cxx index 6f09354a1e36..ba89bad64939 100644 --- a/xmlsecurity/source/helper/xsecverify.cxx +++ b/xmlsecurity/source/helper/xsecverify.cxx @@ -31,6 +31,7 @@ #include #include +using namespace com::sun::star; namespace cssu = com::sun::star::uno; namespace cssl = com::sun::star::lang; namespace cssxc = com::sun::star::xml::crypto; @@ -371,7 +372,7 @@ void XSecController::collectToVerify( const OUString& referenceId ) void XSecController::addSignature( sal_Int32 nSignatureId ) { - DBG_ASSERT( m_pXSecParser != nullptr, "No XSecParser initialized" ); + DBG_ASSERT( m_xSecParser.is(), "No XSecParser initialized" ); m_nReservedSignatureId = nSignatureId; m_bVerifyCurrentSignature = true; @@ -379,18 +380,18 @@ void XSecController::addSignature( sal_Int32 nSignatureId ) cssu::Reference< cssxs::XDocumentHandler > XSecController::createSignatureReader() { - m_pXSecParser = new XSecParser( this, nullptr ); - cssu::Reference< cssl::XInitialization > xInitialization = m_pXSecParser; + m_xSecParser = new XSecParser( this, nullptr ); + cssu::Reference< cssl::XInitialization > xInitialization(m_xSecParser, uno::UNO_QUERY); setSAXChainConnector(xInitialization, nullptr, nullptr); - return m_pXSecParser; + return m_xSecParser; } void XSecController::releaseSignatureReader() { clearSAXChainConnector( ); - m_pXSecParser = nullptr; + m_xSecParser.clear(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ -- cgit