[Libreoffice-commits] core.git: xmlsecurity/inc xmlsecurity/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Dec 1 09:42:32 UTC 2016
xmlsecurity/inc/framework/saxeventkeeperimpl.hxx | 322 ++++++++++++++++++++
xmlsecurity/source/framework/saxeventkeeperimpl.cxx | 5
xmlsecurity/source/framework/saxeventkeeperimpl.hxx | 321 -------------------
xmlsecurity/source/framework/xsec_framework.cxx | 2
xmlsecurity/source/helper/xsecctl.cxx | 29 -
5 files changed, 333 insertions(+), 346 deletions(-)
New commits:
commit 7920ba294b7785accc9785c284b46ce28e5a0b05
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Dec 1 08:36:41 2016 +0100
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 at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/xmlsecurity/source/framework/saxeventkeeperimpl.hxx b/xmlsecurity/inc/framework/saxeventkeeperimpl.hxx
similarity index 97%
rename from xmlsecurity/source/framework/saxeventkeeperimpl.hxx
rename to xmlsecurity/inc/framework/saxeventkeeperimpl.hxx
index 214575d..73615a3 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 ebe6823..e14bc1f 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 f05b95e..bfe132e 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 bc9adbe..641de5e 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();
More information about the Libreoffice-commits
mailing list