[Libreoffice-commits] core.git: xmlsecurity/inc xmlsecurity/source
Miklos Vajna
vmiklos at collabora.co.uk
Wed Dec 21 08:07:05 UTC 2016
xmlsecurity/inc/framework/signaturecreatorimpl.hxx | 114 ++++++++++++++++++
xmlsecurity/source/framework/signaturecreatorimpl.cxx | 2
xmlsecurity/source/framework/signaturecreatorimpl.hxx | 114 ------------------
xmlsecurity/source/framework/xsec_framework.cxx | 2
xmlsecurity/source/helper/xsecsign.cxx | 14 --
5 files changed, 118 insertions(+), 128 deletions(-)
New commits:
commit 517994c640ac83d48b9e5f238bc4d219ebd6abbd
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Wed Dec 21 08:06:10 2016 +0100
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 at collabora.co.uk>
Tested-by: Jenkins <ci at libreoffice.org>
diff --git a/xmlsecurity/source/framework/signaturecreatorimpl.hxx b/xmlsecurity/inc/framework/signaturecreatorimpl.hxx
similarity index 95%
rename from xmlsecurity/source/framework/signaturecreatorimpl.hxx
rename to xmlsecurity/inc/framework/signaturecreatorimpl.hxx
index 81a8fc3..ce5e01f 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 905db95..e9269c2 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 bfe132e..2afd010 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 40d1fd0..eabae47 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);
More information about the Libreoffice-commits
mailing list