diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-12-15 09:09:35 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2016-12-15 09:15:38 +0000 |
commit | a7c35729e00f18f79156b3f8f57472506f786074 (patch) | |
tree | 6f4de6099aa3560790938afa9152f1771cab74ec /xmlsecurity | |
parent | 5c73299cdb5f3f2c87c0c87a826e27211e7338ee (diff) |
xmlsecurity: hold XMLDocumentWrapper by rtl::Reference in XSecController
Going via UNO for a class in the same module is an overkill.
Change-Id: Idf706782e5844fd2e553c44966e1dd1104dce8e7
Reviewed-on: https://gerrit.libreoffice.org/32030
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins <ci@libreoffice.org>
Diffstat (limited to 'xmlsecurity')
-rw-r--r-- | xmlsecurity/Library_xmlsecurity.mk | 4 | ||||
-rw-r--r-- | xmlsecurity/Library_xsec_xmlsec.mk | 1 | ||||
-rw-r--r-- | xmlsecurity/inc/xmlsec/saxhelper.hxx (renamed from xmlsecurity/source/xmlsec/saxhelper.hxx) | 4 | ||||
-rw-r--r-- | xmlsecurity/inc/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx (renamed from xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx) | 12 | ||||
-rw-r--r-- | xmlsecurity/inc/xsecctl.hxx | 4 | ||||
-rw-r--r-- | xmlsecurity/inc/xsecxmlsecdllapi.h | 23 | ||||
-rw-r--r-- | xmlsecurity/source/helper/xsecctl.cxx | 9 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/saxhelper.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx | 2 | ||||
-rw-r--r-- | xmlsecurity/source/xmlsec/xsec_xmlsec.cxx | 2 |
14 files changed, 49 insertions, 22 deletions
diff --git a/xmlsecurity/Library_xmlsecurity.mk b/xmlsecurity/Library_xmlsecurity.mk index aee3bcb34994..868c3f809e6c 100644 --- a/xmlsecurity/Library_xmlsecurity.mk +++ b/xmlsecurity/Library_xmlsecurity.mk @@ -42,6 +42,7 @@ $(eval $(call gb_Library_use_libraries,xmlsecurity,\ xo \ i18nlangtag \ xsec_fw \ + xsec_xmlsec \ $(gb_UWINAPI) \ )) @@ -68,6 +69,9 @@ $(eval $(call gb_Library_add_exception_objects,xmlsecurity,\ xmlsecurity/source/pdfio/pdfdocument \ )) +$(eval $(call gb_Library_use_externals,xmlsecurity,\ + libxml2 \ +)) ifeq ($(OS)-$(COM),WNT-MSC) $(eval $(call gb_Library_add_defs,xmlsecurity,\ -DXMLSEC_CRYPTO_MSCRYPTO \ diff --git a/xmlsecurity/Library_xsec_xmlsec.mk b/xmlsecurity/Library_xsec_xmlsec.mk index 978f7ad26a6d..af7bca214a76 100644 --- a/xmlsecurity/Library_xsec_xmlsec.mk +++ b/xmlsecurity/Library_xsec_xmlsec.mk @@ -30,6 +30,7 @@ $(eval $(call gb_Library_use_sdk_api,xsec_xmlsec)) $(eval $(call gb_Library_add_defs,xsec_xmlsec,\ -DXMLSEC_NO_XSLT \ + -DXSECXMLSEC_DLLIMPLEMENTATION \ )) $(eval $(call gb_Library_set_precompiled_header,xsec_xmlsec,$(SRCDIR)/xmlsecurity/inc/pch/precompiled_xsec_xmlsec)) diff --git a/xmlsecurity/source/xmlsec/saxhelper.hxx b/xmlsecurity/inc/xmlsec/saxhelper.hxx index 58b2cb3553ee..8068d8bf35d7 100644 --- a/xmlsecurity/source/xmlsec/saxhelper.hxx +++ b/xmlsecurity/inc/xmlsec/saxhelper.hxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_XMLSECURITY_SOURCE_XMLSEC_SAXHELPER_HXX -#define INCLUDED_XMLSECURITY_SOURCE_XMLSEC_SAXHELPER_HXX +#ifndef INCLUDED_XMLSECURITY_INC_XMLSEC_SAXHELPER_HXX +#define INCLUDED_XMLSECURITY_INC_XMLSEC_SAXHELPER_HXX #include "libxml/tree.h" diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx b/xmlsecurity/inc/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx index a48278b30703..bc8471ec6f3c 100644 --- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx +++ b/xmlsecurity/inc/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx @@ -17,8 +17,8 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -#ifndef INCLUDED_XMLSECURITY_SOURCE_XMLSEC_XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX -#define INCLUDED_XMLSECURITY_SOURCE_XMLSEC_XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX +#ifndef INCLUDED_XMLSECURITY_INC_XMLSEC_XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX +#define INCLUDED_XMLSECURITY_INC_XMLSEC_XMLDOCUMENTWRAPPER_XMLSECIMPL_HXX #include <com/sun/star/xml/wrapper/XXMLDocumentWrapper.hpp> #include <com/sun/star/xml/csax/XCompressedDocumentHandler.hpp> @@ -26,7 +26,8 @@ #include <com/sun/star/lang/XServiceInfo.hpp> #include <cppuhelper/implbase.hxx> -#include "saxhelper.hxx" +#include "xmlsec/saxhelper.hxx" +#include "xsecxmlsecdllapi.h" #define NODEPOSITION_NORMAL 1 #define NODEPOSITION_STARTELEMENT 2 @@ -38,15 +39,14 @@ namespace com { namespace sun { namespace star { namespace uno { class XComponentContext; } } } } -class XMLDocumentWrapper_XmlSecImpl : public cppu::WeakImplHelper +class XSECXMLSEC_DLLPUBLIC XMLDocumentWrapper_XmlSecImpl : public cppu::WeakImplHelper < css::xml::wrapper::XXMLDocumentWrapper, css::xml::sax::XDocumentHandler, css::xml::csax::XCompressedDocumentHandler, css::lang::XServiceInfo > -/****** XMLDocumentWrapper_XmlSecImpl.hxx/CLASS XMLDocumentWrapper_XmlSecImpl * - * +/** * NAME * XMLDocumentWrapper_XmlSecImpl -- Class to manipulate a libxml2 * document diff --git a/xmlsecurity/inc/xsecctl.hxx b/xmlsecurity/inc/xsecctl.hxx index 8f9f1db5e259..8e1fc1b0e066 100644 --- a/xmlsecurity/inc/xsecctl.hxx +++ b/xmlsecurity/inc/xsecctl.hxx @@ -41,6 +41,7 @@ #include <com/sun/star/embed/XStorage.hpp> #include <rtl/ustrbuf.hxx> +#include <rtl/ref.hxx> #include <cppuhelper/implbase.hxx> @@ -59,6 +60,7 @@ #define ALGO_RELATIONSHIP "http://schemas.openxmlformats.org/package/2006/RelationshipTransform" class XSecParser; +class XMLDocumentWrapper_XmlSecImpl; class InternalSignatureInformation { @@ -111,7 +113,7 @@ private: /* * used to buffer SAX events */ - css::uno::Reference< css::xml::wrapper::XXMLDocumentWrapper > m_xXMLDocumentWrapper; + rtl::Reference<XMLDocumentWrapper_XmlSecImpl> m_xXMLDocumentWrapper; /* * the SAX events keeper diff --git a/xmlsecurity/inc/xsecxmlsecdllapi.h b/xmlsecurity/inc/xsecxmlsecdllapi.h new file mode 100644 index 000000000000..2f1d8d7c3af4 --- /dev/null +++ b/xmlsecurity/inc/xsecxmlsecdllapi.h @@ -0,0 +1,23 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef INCLUDED_XMLSECURITY_INC_XSECXMLSECDLLAPI_H +#define INCLUDED_XMLSECURITY_INC_XSECXMLSECDLLAPI_H + +#include <sal/types.h> + +#if defined(XSECXMLSEC_DLLIMPLEMENTATION) +#define XSECXMLSEC_DLLPUBLIC SAL_DLLPUBLIC_EXPORT +#else +#define XSECXMLSEC_DLLPUBLIC SAL_DLLPUBLIC_IMPORT +#endif + +#endif // INCLUDED_XMLSECURITY_INC_XSECXMLSECDLLAPI_H + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/helper/xsecctl.cxx b/xmlsecurity/source/helper/xsecctl.cxx index d6ac50656f20..ffd2f1531066 100644 --- a/xmlsecurity/source/helper/xsecctl.cxx +++ b/xmlsecurity/source/helper/xsecctl.cxx @@ -21,6 +21,7 @@ #include "xsecctl.hxx" #include "documentsignaturehelper.hxx" #include "framework/saxeventkeeperimpl.hxx" +#include "xmlsec/xmldocumentwrapper_xmlsecimpl.hxx" #include <com/sun/star/xml/crypto/sax/ElementMarkPriority.hpp> #include <com/sun/star/xml/crypto/sax/XReferenceResolvedBroadcaster.hpp> @@ -133,11 +134,7 @@ void XSecController::createXSecComponent( ) /* * XMLSignature created successfully. */ - { - m_xXMLDocumentWrapper.set( - xMCF->createInstanceWithContext("com.sun.star.xml.wrapper.XMLDocumentWrapper", mxCtx), - cssu::UNO_QUERY ); - } + m_xXMLDocumentWrapper = new XMLDocumentWrapper_XmlSecImpl(); bSuccess &= m_xXMLDocumentWrapper.is(); if ( bSuccess ) @@ -153,7 +150,7 @@ void XSecController::createXSecComponent( ) cssu::Reference< cssl::XInitialization > xInitialization(m_xSAXEventKeeper, cssu::UNO_QUERY); cssu::Sequence <cssu::Any> arg(1); - arg[0] = cssu::makeAny(m_xXMLDocumentWrapper); + arg[0] = cssu::makeAny(uno::Reference<xml::wrapper::XXMLDocumentWrapper>(m_xXMLDocumentWrapper.get())); xInitialization->initialize(arg); cssu::Reference<cssxc::sax::XSAXEventKeeperStatusChangeBroadcaster> diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx index 2e54951eee84..86cab56052bf 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx @@ -21,7 +21,7 @@ #include <rtl/uuid.h> #include "xmlencryption_mscryptimpl.hxx" -#include "xmldocumentwrapper_xmlsecimpl.hxx" +#include "xmlsec/xmldocumentwrapper_xmlsecimpl.hxx" #include "xmlelementwrapper_xmlsecimpl.hxx" diff --git a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx index cfc701fa96e2..abf01ac7f155 100644 --- a/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx +++ b/xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx @@ -22,7 +22,7 @@ #include <com/sun/star/xml/crypto/SecurityOperationStatus.hpp> #include "xmlsignature_mscryptimpl.hxx" -#include "xmldocumentwrapper_xmlsecimpl.hxx" +#include "xmlsec/xmldocumentwrapper_xmlsecimpl.hxx" #include "xmlelementwrapper_xmlsecimpl.hxx" #include "securityenvironment_mscryptimpl.hxx" #include "xmlstreamio.hxx" diff --git a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx index 8aa9e014d3bd..5f65cc37aaee 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx @@ -21,7 +21,7 @@ #include <rtl/uuid.h> #include "xmlencryption_nssimpl.hxx" -#include "xmldocumentwrapper_xmlsecimpl.hxx" +#include "xmlsec/xmldocumentwrapper_xmlsecimpl.hxx" #include "xmlelementwrapper_xmlsecimpl.hxx" diff --git a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx index 1cdd52066a4f..1a3fe0c95f47 100644 --- a/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx +++ b/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx @@ -21,7 +21,7 @@ #include <rtl/uuid.h> #include "xmlsignature_nssimpl.hxx" -#include "xmldocumentwrapper_xmlsecimpl.hxx" +#include "xmlsec/xmldocumentwrapper_xmlsecimpl.hxx" #include "xmlelementwrapper_xmlsecimpl.hxx" diff --git a/xmlsecurity/source/xmlsec/saxhelper.cxx b/xmlsecurity/source/xmlsec/saxhelper.cxx index 336d5637d5c6..3a6a499eb94b 100644 --- a/xmlsecurity/source/xmlsec/saxhelper.cxx +++ b/xmlsecurity/source/xmlsec/saxhelper.cxx @@ -20,7 +20,7 @@ #include <rtl/ustring.hxx> -#include "saxhelper.hxx" +#include "xmlsec/saxhelper.hxx" #include "libxml/parserInternals.h" #ifndef XMLSEC_NO_XSLT diff --git a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx index b86d5b89009f..8945a421a3b6 100644 --- a/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx +++ b/xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx @@ -22,7 +22,7 @@ #include <osl/diagnose.h> #include <com/sun/star/uno/XComponentContext.hpp> #include <cppuhelper/supportsservice.hxx> -#include "xmldocumentwrapper_xmlsecimpl.hxx" +#include "xmlsec/xmldocumentwrapper_xmlsecimpl.hxx" #include <xmloff/attrlist.hxx> #include "xmlelementwrapper_xmlsecimpl.hxx" diff --git a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx index 7b71312be167..93d3e7c834bb 100644 --- a/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx +++ b/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx @@ -24,7 +24,7 @@ #include "serialnumberadapter.hxx" #include "xmlelementwrapper_xmlsecimpl.hxx" -#include "xmldocumentwrapper_xmlsecimpl.hxx" +#include "xmlsec/xmldocumentwrapper_xmlsecimpl.hxx" #include "xsec_xmlsec.hxx" using namespace ::cppu; |