summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-12-01 08:36:41 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-12-01 09:42:07 +0000
commit7920ba294b7785accc9785c284b46ce28e5a0b05 (patch)
tree7e3839fd6388d75bd2664e1de0261499758f3bdf /xmlsecurity
parent6c436ba09cb35235ce6f4065cf74c9a6ff14a4bd (diff)
xmlsecurity: instantiate SAXEventKeeperImpl directly in XSecController
Going via UNO for a class in the same module is an overkill. Change-Id: I577660513022fde1576df19b412fcdb1ee2ad041 Reviewed-on: https://gerrit.libreoffice.org/31461 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/inc/framework/saxeventkeeperimpl.hxx (renamed from xmlsecurity/source/framework/saxeventkeeperimpl.hxx)13
-rw-r--r--xmlsecurity/source/framework/saxeventkeeperimpl.cxx5
-rw-r--r--xmlsecurity/source/framework/xsec_framework.cxx2
-rw-r--r--xmlsecurity/source/helper/xsecctl.cxx29
4 files changed, 18 insertions, 31 deletions
diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.hxx b/xmlsecurity/inc/framework/saxeventkeeperimpl.hxx
index 214575d2757e..73615a37dcf5 100644
--- a/xmlsecurity/source/framework/saxeventkeeperimpl.hxx
+++ b/xmlsecurity/inc/framework/saxeventkeeperimpl.hxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_SAXEVENTKEEPERIMPL_HXX
-#define INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_SAXEVENTKEEPERIMPL_HXX
+#ifndef INCLUDED_XMLSECURITY_INC_FRAMEWORK_SAXEVENTKEEPERIMPL_HXX
+#define INCLUDED_XMLSECURITY_INC_FRAMEWORK_SAXEVENTKEEPERIMPL_HXX
#include <com/sun/star/xml/crypto/sax/XSecuritySAXEventKeeper.hpp>
#include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp>
@@ -30,15 +30,16 @@
#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include "xsecfwdllapi.h"
#include <cppuhelper/implbase.hxx>
-#include "buffernode.hxx"
-#include "elementmark.hxx"
-#include "elementcollector.hxx"
+class BufferNode;
+class ElementMark;
+class ElementCollector;
#include <vector>
-class SAXEventKeeperImpl : public cppu::WeakImplHelper
+class XSECFW_DLLPUBLIC SAXEventKeeperImpl : public cppu::WeakImplHelper
<
css::xml::crypto::sax::XSecuritySAXEventKeeper,
css::xml::crypto::sax::XReferenceResolvedBroadcaster,
diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
index ebe6823c30f1..e14bc1fa7830 100644
--- a/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
+++ b/xmlsecurity/source/framework/saxeventkeeperimpl.cxx
@@ -18,7 +18,10 @@
*/
-#include "saxeventkeeperimpl.hxx"
+#include "framework/saxeventkeeperimpl.hxx"
+#include "buffernode.hxx"
+#include "elementmark.hxx"
+#include "elementcollector.hxx"
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/xml/sax/XDocumentHandler.hpp>
#include <com/sun/star/xml/crypto/sax/ConstOfSecurityId.hpp>
diff --git a/xmlsecurity/source/framework/xsec_framework.cxx b/xmlsecurity/source/framework/xsec_framework.cxx
index f05b95eb2b96..bfe132efce32 100644
--- a/xmlsecurity/source/framework/xsec_framework.cxx
+++ b/xmlsecurity/source/framework/xsec_framework.cxx
@@ -26,7 +26,7 @@
#include "encryptorimpl.hxx"
#include "signaturecreatorimpl.hxx"
#include "framework/signatureverifierimpl.hxx"
-#include "saxeventkeeperimpl.hxx"
+#include "framework/saxeventkeeperimpl.hxx"
#include "xmlencryptiontemplateimpl.hxx"
#include "xmlsignaturetemplateimpl.hxx"
diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx
index bc9adbe2248d..641de5ebc53b 100644
--- a/xmlsecurity/source/helper/xsecctl.cxx
+++ b/xmlsecurity/source/helper/xsecctl.cxx
@@ -20,6 +20,7 @@
#include "xsecctl.hxx"
#include "documentsignaturehelper.hxx"
+#include "framework/saxeventkeeperimpl.hxx"
#include <algorithm>
#include <initializer_list>
@@ -47,13 +48,6 @@ namespace cssxc = com::sun::star::xml::crypto;
namespace cssxs = com::sun::star::xml::sax;
using namespace com::sun::star;
-/* bridge component names */
-#define XMLSIGNATURE_COMPONENT "com.sun.star.xml.crypto.XMLSignature"
-#define XMLDOCUMENTWRAPPER_COMPONENT "com.sun.star.xml.wrapper.XMLDocumentWrapper"
-
-/* xml security framework components */
-#define SAXEVENTKEEPER_COMPONENT "com.sun.star.xml.crypto.sax.SAXEventKeeper"
-
XSecController::XSecController( const cssu::Reference<cssu::XComponentContext>& rxCtx )
: mxCtx(rxCtx)
, m_nNextSecurityId(1)
@@ -117,15 +111,11 @@ void XSecController::createXSecComponent( )
*
* FUNCTION
* Creates xml security components, including:
- * 1. an xml signature bridge component ( Java based or C based)
- * 2. an XMLDocumentWrapper component ( Java based or C based)
+ * 1. an xml signature bridge component
+ * 2. an XMLDocumentWrapper component
* 3. a SAXEventKeeper component
******************************************************************************/
{
- OUString sSAXEventKeeper( SAXEVENTKEEPER_COMPONENT );
- OUString sXMLSignature( XMLSIGNATURE_COMPONENT );
- OUString sXMLDocument( XMLDOCUMENTWRAPPER_COMPONENT );
-
/*
* marks all security components are not available.
*/
@@ -137,7 +127,7 @@ void XSecController::createXSecComponent( )
cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
m_xXMLSignature.set(
- xMCF->createInstanceWithContext( sXMLSignature, mxCtx ),
+ xMCF->createInstanceWithContext("com.sun.star.xml.crypto.XMLSignature", mxCtx ),
cssu::UNO_QUERY );
bool bSuccess = m_xXMLSignature.is();
@@ -147,20 +137,13 @@ void XSecController::createXSecComponent( )
*/
{
m_xXMLDocumentWrapper.set(
- xMCF->createInstanceWithContext( sXMLDocument, mxCtx ),
+ xMCF->createInstanceWithContext("com.sun.star.xml.wrapper.XMLDocumentWrapper", mxCtx),
cssu::UNO_QUERY );
}
bSuccess &= m_xXMLDocumentWrapper.is();
if ( bSuccess )
- /*
- * XMLDocumentWrapper created successfully.
- */
- {
- m_xSAXEventKeeper.set(
- xMCF->createInstanceWithContext( sSAXEventKeeper, mxCtx ),
- cssu::UNO_QUERY );
- }
+ m_xSAXEventKeeper = new SAXEventKeeperImpl();
bSuccess &= m_xSAXEventKeeper.is();