summaryrefslogtreecommitdiff
path: root/xmlsecurity
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-12-21 08:06:10 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-12-21 08:06:26 +0000
commit517994c640ac83d48b9e5f238bc4d219ebd6abbd (patch)
treec12b4458cc255643b6b888bd23ce3e4a0f321e04 /xmlsecurity
parentb55c205460fe7e7b133e179cd567764df7ac3508 (diff)
xmlsecurity: instantiate SignatureCreatorImpl directly in XSecController
Going via UNO for a class in the same module is an overkill. Change-Id: I3a24bc770e40be5b0a6fc34206e92f968de060ae Reviewed-on: https://gerrit.libreoffice.org/32271 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'xmlsecurity')
-rw-r--r--xmlsecurity/inc/framework/signaturecreatorimpl.hxx (renamed from xmlsecurity/source/framework/signaturecreatorimpl.hxx)6
-rw-r--r--xmlsecurity/source/framework/signaturecreatorimpl.cxx2
-rw-r--r--xmlsecurity/source/framework/xsec_framework.cxx2
-rw-r--r--xmlsecurity/source/helper/xsecsign.cxx14
4 files changed, 7 insertions, 17 deletions
diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.hxx b/xmlsecurity/inc/framework/signaturecreatorimpl.hxx
index 81a8fc3f2731..ce5e01f08eb7 100644
--- a/xmlsecurity/source/framework/signaturecreatorimpl.hxx
+++ b/xmlsecurity/inc/framework/signaturecreatorimpl.hxx
@@ -17,8 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#ifndef INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_SIGNATURECREATORIMPL_HXX
-#define INCLUDED_XMLSECURITY_SOURCE_FRAMEWORK_SIGNATURECREATORIMPL_HXX
+#ifndef INCLUDED_XMLSECURITY_INC_FRAMEWORK_SIGNATURECREATORIMPL_HXX
+#define INCLUDED_XMLSECURITY_INC_FRAMEWORK_SIGNATURECREATORIMPL_HXX
#include <com/sun/star/xml/crypto/sax/XBlockerMonitor.hpp>
#include <com/sun/star/xml/crypto/sax/XSignatureCreationResultListener.hpp>
@@ -40,7 +40,7 @@ typedef cppu::ImplInheritanceHelper
css::lang::XServiceInfo
> SignatureCreatorImpl_Base;
-class SignatureCreatorImpl : public SignatureCreatorImpl_Base
+class XSECFW_DLLPUBLIC SignatureCreatorImpl : public SignatureCreatorImpl_Base
/****** SignatureCreatorImpl.hxx/CLASS SignatureCreatorImpl *******************
*
* NAME
diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.cxx b/xmlsecurity/source/framework/signaturecreatorimpl.cxx
index 905db95a6787..e9269c267c20 100644
--- a/xmlsecurity/source/framework/signaturecreatorimpl.cxx
+++ b/xmlsecurity/source/framework/signaturecreatorimpl.cxx
@@ -18,7 +18,7 @@
*/
-#include "signaturecreatorimpl.hxx"
+#include "framework/signaturecreatorimpl.hxx"
#include <com/sun/star/xml/crypto/XXMLSignatureTemplate.hpp>
#include <com/sun/star/xml/wrapper/XXMLElementWrapper.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
diff --git a/xmlsecurity/source/framework/xsec_framework.cxx b/xmlsecurity/source/framework/xsec_framework.cxx
index bfe132efce32..2afd010fee56 100644
--- a/xmlsecurity/source/framework/xsec_framework.cxx
+++ b/xmlsecurity/source/framework/xsec_framework.cxx
@@ -24,7 +24,7 @@
#include "decryptorimpl.hxx"
#include "encryptorimpl.hxx"
-#include "signaturecreatorimpl.hxx"
+#include "framework/signaturecreatorimpl.hxx"
#include "framework/signatureverifierimpl.hxx"
#include "framework/saxeventkeeperimpl.hxx"
#include "xmlencryptiontemplateimpl.hxx"
diff --git a/xmlsecurity/source/helper/xsecsign.cxx b/xmlsecurity/source/helper/xsecsign.cxx
index 40d1fd0e3848..eabae475bb02 100644
--- a/xmlsecurity/source/helper/xsecsign.cxx
+++ b/xmlsecurity/source/helper/xsecsign.cxx
@@ -30,7 +30,7 @@
#include <com/sun/star/embed/StorageFormats.hpp>
#include <rtl/uuid.h>
-#include <stdio.h>
+#include "framework/signaturecreatorimpl.hxx"
using namespace com::sun::star;
namespace cssu = com::sun::star::uno;
@@ -38,9 +38,6 @@ namespace cssl = com::sun::star::lang;
namespace cssxc = com::sun::star::xml::crypto;
namespace cssxs = com::sun::star::xml::sax;
-/* xml security framework components */
-#define SIGNATURECREATOR_COMPONENT "com.sun.star.xml.crypto.sax.SignatureCreator"
-
/* protected: for signature generation */
OUString XSecController::createId()
{
@@ -66,20 +63,13 @@ cssu::Reference< cssxc::sax::XReferenceResolvedListener > XSecController::prepar
SignatureReferenceInformations& vReferenceInfors = internalSignatureInfor.signatureInfor.vSignatureReferenceInfors;
sal_Int32 nIdOfSignatureElementCollector;
- cssu::Reference< cssxc::sax::XReferenceResolvedListener > xReferenceResolvedListener;
nIdOfSignatureElementCollector =
m_xSAXEventKeeper->addSecurityElementCollector( cssxc::sax::ElementMarkPriority_AFTERMODIFY, true );
m_xSAXEventKeeper->setSecurityId(nIdOfSignatureElementCollector, nSecurityId);
- /*
- * create a SignatureCreator
- */
- cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
- xReferenceResolvedListener.set(
- xMCF->createInstanceWithContext(SIGNATURECREATOR_COMPONENT, mxCtx),
- cssu::UNO_QUERY);
+ uno::Reference<xml::crypto::sax::XReferenceResolvedListener> xReferenceResolvedListener(new SignatureCreatorImpl(mxCtx));
cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY);