[Libreoffice-commits] core.git: xmlsecurity/inc xmlsecurity/Library_xmlsecurity.mk xmlsecurity/Library_xsec_xmlsec.mk xmlsecurity/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Dec 15 09:16:18 UTC 2016


 xmlsecurity/Library_xmlsecurity.mk                              |    4 
 xmlsecurity/Library_xsec_xmlsec.mk                              |    1 
 xmlsecurity/inc/xmlsec/saxhelper.hxx                            |   78 +++
 xmlsecurity/inc/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx        |  258 ++++++++++
 xmlsecurity/inc/xsecctl.hxx                                     |    4 
 xmlsecurity/inc/xsecxmlsecdllapi.h                              |   23 
 xmlsecurity/source/helper/xsecctl.cxx                           |    9 
 xmlsecurity/source/xmlsec/mscrypt/xmlencryption_mscryptimpl.cxx |    2 
 xmlsecurity/source/xmlsec/mscrypt/xmlsignature_mscryptimpl.cxx  |    2 
 xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx         |    2 
 xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx          |    2 
 xmlsecurity/source/xmlsec/saxhelper.cxx                         |    2 
 xmlsecurity/source/xmlsec/saxhelper.hxx                         |   78 ---
 xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.cxx     |    2 
 xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx     |  258 ----------
 xmlsecurity/source/xmlsec/xsec_xmlsec.cxx                       |    2 
 16 files changed, 377 insertions(+), 350 deletions(-)

New commits:
commit a7c35729e00f18f79156b3f8f57472506f786074
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Dec 15 09:09:35 2016 +0100

    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 at collabora.co.uk>
    Tested-by: Jenkins <ci at libreoffice.org>

diff --git a/xmlsecurity/Library_xmlsecurity.mk b/xmlsecurity/Library_xmlsecurity.mk
index aee3bcb..868c3f8 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 978f7ad..af7bca2 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
similarity index 96%
rename from xmlsecurity/source/xmlsec/saxhelper.hxx
rename to xmlsecurity/inc/xmlsec/saxhelper.hxx
index 58b2cb3..8068d8b 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
similarity index 97%
rename from xmlsecurity/source/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx
rename to xmlsecurity/inc/xmlsec/xmldocumentwrapper_xmlsecimpl.hxx
index a48278b..bc8471e 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 8f9f1db..8e1fc1b 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 0000000..2f1d8d7
--- /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 d6ac506..ffd2f15 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 2e54951..86cab56 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 cfc701f..abf01ac 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 8aa9e01..5f65cc3 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 1cdd520..1a3fe0c 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 336d563..3a6a499 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 b86d5b8..8945a42 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 7b71312..93d3e7c 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;


More information about the Libreoffice-commits mailing list