Kaydet (Commit) a7c35729 authored tarafından Miklos Vajna's avatar Miklos Vajna

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/32030Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
Tested-by: 's avatarJenkins <ci@libreoffice.org>
üst 5c73299c
......@@ -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 \
......
......@@ -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))
......
......@@ -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"
......
......@@ -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
......
......@@ -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
......
/* -*- 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: */
......@@ -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>
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -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"
......
......@@ -20,7 +20,7 @@
#include <rtl/ustring.hxx>
#include "saxhelper.hxx"
#include "xmlsec/saxhelper.hxx"
#include "libxml/parserInternals.h"
#ifndef XMLSEC_NO_XSLT
......
......@@ -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"
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment