rpms/openoffice.org/devel workspace.cmcfixes48.patch,1.5,1.6

Caolan McNamara caolanm at fedoraproject.org
Sun Nov 30 23:05:59 UTC 2008


Author: caolanm

Update of /cvs/pkgs/rpms/openoffice.org/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv8351

Modified Files:
	workspace.cmcfixes48.patch 
Log Message:
messy

workspace.cmcfixes48.patch:

Index: workspace.cmcfixes48.patch
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org/devel/workspace.cmcfixes48.patch,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- workspace.cmcfixes48.patch	29 Nov 2008 14:14:27 -0000	1.5
+++ workspace.cmcfixes48.patch	30 Nov 2008 23:05:59 -0000	1.6
@@ -1,3 +1,1631 @@
+Index: api/offapi/com/sun/star/security/SerialNumberAdapter.idl
+diff -u /dev/null api/offapi/com/sun/star/security/SerialNumberAdapter.idl:1.1.2.1
+--- /dev/null	Fri Aug  1 09:30:33 2008
++++ api/offapi/com/sun/star/security/SerialNumberAdapter.idl	Fri Aug  1 09:28:21 2008
+@@ -0,0 +1,60 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ * $Revision$
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#ifndef __com_sun_star_security_SerialNumberAdapter_idl_
++#define __com_sun_star_security_SerialNumberAdapter_idl_
++
++//============================================================================
++
++module com { module sun { module star { module security {
++        interface XSerialNumberAdapter; };
++}; }; };
++
++//============================================================================
++
++module com { module sun { module star { module security {
++
++//============================================================================
++
++/** provides conversion services for Serial Numbers.
++
++    <p>An implementation of this service enables the conversion of certificate
++       serial number to and from a string</p>
++
++    @since OOo 3.1.0
++ */
++
++service SerialNumberAdapter : XSerialNumberAdapter;
++
++//============================================================================
++
++}; }; }; };
++
++#endif
+Index: api/offapi/com/sun/star/security/XSerialNumberAdapter.idl
+diff -u /dev/null api/offapi/com/sun/star/security/XSerialNumberAdapter.idl:1.1.2.1
+--- /dev/null	Fri Aug  1 09:30:33 2008
++++ api/offapi/com/sun/star/security/XSerialNumberAdapter.idl	Fri Aug  1 09:28:21 2008
+@@ -0,0 +1,62 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile$
++ * $Revision$
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++ 
++/** -- idl definition -- **/
++
++#ifndef __com_sun_star_security_XSerialNumberAdapter_idl_
++#define __com_sun_star_security_XSerialNumberAdapter_idl_
++
++#include <com/sun/star/uno/XInterface.idl>
++
++module com { module sun { module star { module security {
++
++/**
++ * Interface of Certificate Serial Number Converter
++ *
++ * <p>This interface converts a certificate serial number to and from a string</p>
++ */
++interface XSerialNumberAdapter : com::sun::star::uno::XInterface
++{
++	/**
++        * Convert the SerialNumber to a string
++        */
++	string toString( [in]sequence< byte > SerialNumber );
++
++	/**
++        * Convert the SerialNumber to a sequence
++        */
++	sequence< byte > toSequence( [in]string SerialNumber );
++
++} ;
++
++} ; } ; } ; } ;
++
++#endif 
++
+Index: api/offapi/com/sun/star/security/makefile.mk
+diff -u api/offapi/com/sun/star/security/makefile.mk:1.8 api/offapi/com/sun/star/security/makefile.mk:1.8.108.1
+--- api/offapi/com/sun/star/security/makefile.mk:1.8	Thu Apr 10 20:19:53 2008
++++ api/offapi/com/sun/star/security/makefile.mk	Fri Aug  1 09:28:21 2008
+@@ -60,6 +60,8 @@
+     XDocumentDigitalSignatures.idl	\
+     KeyUsage.idl			\
+     XCertificateContainer.idl		\
++    XSerialNumberAdapter.idl		\
++    SerialNumberAdapter.idl		\
+     CertificateContainer.idl \
+     CertificateContainerStatus.idl
+ 
+Index: installation/scp2/source/ooo/file_library_ooo.scp
+diff -u installation/scp2/source/ooo/file_library_ooo.scp:1.302 installation/scp2/source/ooo/file_library_ooo.scp:1.302.14.1
+--- installation/scp2/source/ooo/file_library_ooo.scp:1.302	Thu Jul 17 08:34:36 2008
++++ installation/scp2/source/ooo/file_library_ooo.scp	Fri Aug  1 07:08:01 2008
+@@ -1104,6 +1104,20 @@
+     Name = "oleautobridge.uno.dll";
+ End
+ 
++#else
++
++File gid_File_Lib_Mozbootstrap
++    TXT_FILE_BODY;
++    Styles = (PACKED,UNO_COMPONENT,PATCH);
++    RegistryID = gid_Starregistry_Services_Rdb;
++    Dir = gid_Dir_Program;
++  #ifdef UNX
++    Name = STRING(CONCAT2(libmozbootstrap,UNXSUFFIX));
++  #else
++    Name = "libmozbootstrap.dll";
++  #endif
++End
++
+ #endif
+ 
+ SPECIAL_UNO_LIB_FILE(gid_File_Lib_Package2,package2)
+@@ -1657,26 +1671,18 @@
+     RegistryID = gid_Starregistry_Services_Rdb;
+ End
+ 
++#ifdef WNT
+ File gid_File_Lib_LibXMLSec_xmlseccore
+     TXT_FILE_BODY;
+-    #ifdef UNX
+-        #ifdef MACOSX
+-            Name = STRING(CONCAT2(libxmlsec1.1.2.6,UNXSUFFIX));
+-        #else
+-            Name = STRING(CONCAT3(libxmlsec1,UNXSUFFIX,.1.2.6));
+-        #endif
++    #ifdef _gcc3
++      Name = "libxmlsec1-1.dll";
+     #else
+-      #ifdef _gcc3
+-        Name = "libxmlsec1-1.dll";
+-      #else
+-        Name = "libxmlsec.dll";
+-      #endif
++      Name = "libxmlsec.dll";
+     #endif
+     Dir = gid_Dir_Program;
+     Styles = (PACKED);
+ End
+ 
+-#ifdef WNT
+ File gid_File_Lib_LibXMLSec_xmlsecmscrypto
+     TXT_FILE_BODY;
+   #ifdef _gcc3
+@@ -1689,18 +1695,6 @@
+ End
+ #endif
+ 
+-#ifdef UNX
+-File gid_File_Lib_LibXMLSec_xmlsecnss
+-    TXT_FILE_BODY;
+-    #ifdef MACOSX
+-        Name = STRING(CONCAT2(libxmlsec1-nss.1.2.6,UNXSUFFIX));
+-    #else
+-        Name = STRING(CONCAT3(libxmlsec1-nss,UNXSUFFIX,.1.2.6));
+-    #endif
+-    Dir = gid_Dir_Program;
+-    Styles = (PACKED);
+-End
+-#endif
+ //i20156 - end
+ #endif
+ 
+Index: installation/scp2/source/ooo/shortcut_ooo.scp
+diff -u installation/scp2/source/ooo/shortcut_ooo.scp:1.30 installation/scp2/source/ooo/shortcut_ooo.scp:1.30.40.1
+--- installation/scp2/source/ooo/shortcut_ooo.scp:1.30	Fri Jul 11 03:32:50 2008
++++ installation/scp2/source/ooo/shortcut_ooo.scp	Fri Aug  1 07:08:02 2008
+@@ -118,54 +118,6 @@
+ #endif
+ #endif
+ 
+-//i38417
+-#ifndef WITHOUT_MOZILLA
+-#ifdef UNX
+-Shortcut gid_Shortcut_Lib_LibXMLSec_xmlseccore
+-    FileID = gid_File_Lib_LibXMLSec_xmlseccore;
+-    Dir = gid_Dir_Program;
+-#ifdef MACOSX
+-    Name = STRING(CONCAT2(libxmlsec1.1,UNXSUFFIX));
+-#else
+-    Name = STRING(CONCAT3(libxmlsec1,UNXSUFFIX,.1));
+-#endif
+-    Styles = (NETWORK,RELATIVE);
+-End
+-#endif
+-
+-#ifdef UNX
+-Shortcut gid_Shortcut_Lib_LibXMLSec_xmlseccore_2
+-    ShortcutID = gid_Shortcut_Lib_LibXMLSec_xmlseccore;
+-    Dir = gid_Dir_Program;
+-    Name = STRING(CONCAT2(libxmlsec1,UNXSUFFIX));
+-    Styles = (NETWORK,RELATIVE);
+-End
+-#endif
+-
+-#ifdef UNX
+-Shortcut gid_Shortcut_Lib_LibXMLSec_xmlsecnss
+-    FileID = gid_File_Lib_LibXMLSec_xmlsecnss;
+-    Dir = gid_Dir_Program;
+-#ifdef MACOSX
+-    Name = STRING(CONCAT2(libxmlsec1-nss.1,UNXSUFFIX));
+-#else
+-    Name = STRING(CONCAT3(libxmlsec1-nss,UNXSUFFIX,.1));
+-#endif
+-    Styles = (NETWORK,RELATIVE);
+-End
+-#endif
+-
+-#ifdef UNX
+-Shortcut gid_Shortcut_Lib_LibXMLSec_xmlsecnss_2
+-    ShortcutID = gid_Shortcut_Lib_LibXMLSec_xmlsecnss;
+-    Dir = gid_Dir_Program;
+-    Name = STRING(CONCAT2(libxmlsec1-nss,UNXSUFFIX));
+-    Styles = (NETWORK,RELATIVE);
+-End
+-#endif
+-#endif
+-//i38417 -end-
+-
+ #ifdef MACOSX
+ 
+ Shortcut gid_Shortcut_Lib_Hsqldb_2
+Index: external/libxmlsec/makefile.mk
+diff -u external/libxmlsec/makefile.mk:1.17 external/libxmlsec/makefile.mk:1.17.14.1
+--- external/libxmlsec/makefile.mk:1.17	Fri Apr 11 00:19:29 2008
++++ external/libxmlsec/makefile.mk	Fri Aug  1 07:04:33 2008
+@@ -124,18 +124,10 @@
+ LDFLAGS:=$(xmlsec_LDFLAGS)
+ .EXPORT: LDFLAGS
+ 
+-#.IF "$(OS)$(COM)"=="LINUXGCC"
+-#LDFLAGS:=-Wl,-rpath,'$$$$ORIGIN'
+-#.ENDIF			# "$(OS)$(COM)"=="LINUXGCC"
+-#.IF "$(OS)$(COM)"=="SOLARISC52"
+-#LDFLAGS:=-Wl,-R'$$$$ORIGIN'
+-#.ENDIF			# "$(OS)$(COM)"=="SOLARISC52"
+-#.EXPORT: LDFLAGS
+ .ENDIF
+ CONFIGURE_DIR=
+-#CONFIGURE_ACTION=chmod 777 libxml2-config && .$/configure CFLAGS="$(xmlsec_CFLAGS)" CPPFLAGS="$(xmlsec_CPPFLAGS)" LDFLAGS="$(xmlsec_LDFLAGS)"
+ CONFIGURE_ACTION=chmod 777 libxml2-config && .$/configure ADDCFLAGS="$(xmlsec_CFLAGS)" CPPFLAGS="$(xmlsec_CPPFLAGS)"
+-CONFIGURE_FLAGS=--with-libxslt=no --with-openssl=no --with-gnutls=no LIBXML2LIB="$(LIBXML2LIB)" ZLIB3RDLIB=$(ZLIB3RDLIB)
++CONFIGURE_FLAGS=--with-pic --disable-shared --with-libxslt=no --with-openssl=no --with-gnutls=no LIBXML2LIB="$(LIBXML2LIB)" ZLIB3RDLIB=$(ZLIB3RDLIB)
+ # system-mozilla needs pkgconfig to get the information about nss
+ # FIXME: This also will enable pkg-config usage for libxml2. It *seems*
+ # that the internal headers still are used when they are there but....
+@@ -155,9 +147,7 @@
+ 
+ OUTDIR2INC=include$/xmlsec 
+ 
+-.IF "$(OS)"=="MACOSX"
+-OUT2LIB+=src$/.libs$/libxmlsec1.*dylib src$/nss$/.libs$/libxmlsec1-nss.*dylib 
+-.ELIF "$(OS)"=="WNT"
++.IF "$(OS)"=="WNT"
+ .IF "$(COM)"=="GCC"
+ OUT2BIN+=src$/.libs$/libxmlsec1-1.dll src$/nss$/.libs$/libxmlsec1-nss-1.dll src$/mscrypto$/.libs$/libxmlsec1-mscrypto-1.dll
+ .ELSE
+@@ -165,7 +155,7 @@
+ OUT2BIN+=win32$/binaries$/*.dll
+ .ENDIF
+ .ELSE
+-OUT2LIB+=src$/.libs$/libxmlsec1.so* src$/nss$/.libs$/libxmlsec1-nss.so*
++OUT2LIB+=src$/.libs$/libxmlsec1.a src$/nss$/.libs$/libxmlsec1-nss.a
+ .ENDIF
+ 
+ # --- Targets ------------------------------------------------------
+Index: external/libxmlsec/prj/d.lst
+diff -u external/libxmlsec/prj/d.lst:1.3 external/libxmlsec/prj/d.lst:1.3.104.1
+--- external/libxmlsec/prj/d.lst:1.3	Thu Mar 10 09:49:59 2005
++++ external/libxmlsec/prj/d.lst	Fri Aug  1 07:04:33 2008
+@@ -4,9 +4,6 @@
+ ..\%__SRC%\inc\xmlsec\*.h %_DEST%\inc%_EXT%\external\xmlsec\*.h
+ ..\%__SRC%\inc\xmlsec\nss\*.h %_DEST%\inc%_EXT%\external\xmlsec\nss\*.h
+ ..\%__SRC%\inc\xmlsec\mscrypto\*.h %_DEST%\inc%_EXT%\external\xmlsec\mscrypto\*.h
+-..\%__SRC%\lib\lib*.so %_DEST%\lib%_EXT%
+-..\%__SRC%\lib\lib*.so.* %_DEST%\lib%_EXT%
+-..\%__SRC%\lib\lib*.dylib %_DEST%\lib%_EXT%
++..\%__SRC%\lib\lib*.a %_DEST%\lib%_EXT%
+ ..\%__SRC%\lib\*.lib %_DEST%\lib%_EXT%
+-..\%__SRC%\lib\*.dylib %_DEST%\lib%_EXT%
+ ..\%__SRC%\bin\*.dll %_DEST%\bin%_EXT%
+Index: xml/xmlsecurity/inc/xmlsecurity/baseencoding.hxx
+diff -u xml/xmlsecurity/inc/xmlsecurity/baseencoding.hxx:1.3 xml/xmlsecurity/inc/xmlsecurity/baseencoding.hxx:removed
+--- xml/xmlsecurity/inc/xmlsecurity/baseencoding.hxx:1.3	Thu Apr 10 17:05:47 2008
++++ xml/xmlsecurity/inc/xmlsecurity/baseencoding.hxx	Fri Aug  1 09:32:02 2008
+@@ -1,53 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile$
+- * $Revision$
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-
+-#ifndef _XMLSECURITY_BASEENCODING_HXX
+-#define _XMLSECURITY_BASEENCODING_HXX
+-
+-#include <sal/config.h>
+-#include <rtl/ustring.hxx>
+-
+-#ifndef _COM_SUN_STAR_UNO_REFERENCE_HPP_
+-#include <com/sun/star/uno/Reference.hxx>
+-#endif
+-#include "com/sun/star/uno/Sequence.h"
+-
+-enum BaseType {
+-	BASE16 = 16 ,
+-	BASE32 = 32 ,
+-	BASE64 = 64
+-} ;
+-
+-::rtl::OUString baseEncode( const ::com::sun::star::uno::Sequence< sal_Int8 >& rawdata, BaseType base ) ;
+-
+-::com::sun::star::uno::Sequence< sal_Int8 > baseDecode( const ::rtl::OUString& oustr, BaseType base ) ;
+-
+-#endif
+-
+Index: xml/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx
+diff -u xml/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx:1.5 xml/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx:1.5.22.1
+--- xml/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx:1.5	Thu Apr 10 17:06:29 2008
++++ xml/xmlsecurity/inc/xmlsecurity/certificatechooser.hxx	Fri Aug  1 06:54:30 2008
+@@ -57,6 +57,7 @@
+ class CertificateChooser : public ModalDialog
+ {
+ private:
++	cssu::Reference< cssu::XComponentContext > mxCtx;
+ 	cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > mxSecurityEnvironment;
+ 	cssu::Sequence< cssu::Reference< dcss::security::XCertificate > > maCerts;
+ 	SignatureInformations maCertsToIgnore;
+@@ -83,7 +84,7 @@
+ 	void ImplInitialize();
+ 
+ public:
+-	CertificateChooser( Window* pParent, cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const SignatureInformations& rCertsToIgnore );
++	CertificateChooser( Window* pParent, cssu::Reference< cssu::XComponentContext>& rxCtx, cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment, const SignatureInformations& rCertsToIgnore );
+ 	~CertificateChooser();
+ 
+ 	short Execute();
+Index: xml/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx
+diff -u xml/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx:1.12 xml/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx:1.12.16.1
+--- xml/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx:1.12	Fri May 16 02:40:59 2008
++++ xml/xmlsecurity/inc/xmlsecurity/digitalsignaturesdialog.hxx	Fri Aug  1 06:54:30 2008
+@@ -63,6 +63,7 @@
+ class DigitalSignaturesDialog : public ModalDialog
+ {
+ private:
++    cssu::Reference< cssu::XComponentContext >& mxCtx;
+ 	XMLSignatureHelper	    maSignatureHelper;
+ 
+     css::uno::Reference < css::embed::XStorage > mxStore;
+@@ -112,7 +113,7 @@
+ 
+ public:
+ 	DigitalSignaturesDialog( Window* pParent, cssu::Reference< 
+-        css::lang::XMultiServiceFactory >& rxMSF, DocumentSignatureMode eMode, 
++        cssu::XComponentContext >& rxCtx, DocumentSignatureMode eMode, 
+         sal_Bool bReadOnly );
+ 	~DigitalSignaturesDialog();
+ 
+Index: xml/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx
+diff -u xml/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx:1.14 xml/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx:1.14.22.1
+--- xml/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx:1.14	Thu Apr 10 17:07:53 2008
++++ xml/xmlsecurity/inc/xmlsecurity/macrosecurity.hxx	Fri Aug  1 06:54:30 2008
+@@ -76,6 +76,7 @@
+ 	HelpButton			maHelpBtn;
+ 	PushButton			maResetBtn;
+ 
++	cssu::Reference< cssu::XComponentContext >	mxCtx;
+ 	cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >	mxSecurityEnvironment;
+ 	SvtSecurityOptions											maSecOptions;
+ 
+@@ -84,7 +85,7 @@
+ 
+ 	DECL_LINK(			OkBtnHdl, void* );
+ public:
+-	MacroSecurity( Window* pParent, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment );
++	MacroSecurity( Window* pParent, const cssu::Reference< cssu::XComponentContext>& rxCtx, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& rxSecurityEnvironment );
+ 	virtual				~MacroSecurity();
+ 
+ 	inline void		EnableReset( bool _bEnable = true );
+Index: xml/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx
+diff -u xml/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx:1.12 xml/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx:1.12.16.1
+--- xml/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx:1.12	Wed May 14 03:21:06 2008
++++ xml/xmlsecurity/inc/xmlsecurity/xmlsignaturehelper.hxx	Fri Aug  1 06:54:30 2008
+@@ -41,6 +41,7 @@
+ 
+ #include <xmlsecurity/sigstruct.hxx>
+ 
++#include <com/sun/star/uno/XComponentContext.hpp>
+ #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+ #include <com/sun/star/xml/crypto/XUriBinding.hpp>
+ #include <com/sun/star/xml/crypto/XSEInitializer.hpp>
+@@ -55,8 +56,6 @@
+ namespace com {
+ namespace sun {
+ namespace star {
+-namespace lang {
+-    class XMultiServiceFactory; }
+ namespace io {
+     class XOutputStream;
+     class XInputStream; }
+@@ -109,7 +108,7 @@
+ class XMLSignatureHelper
+ {
+ private:
+-    ::com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory> mxMSF;
++    ::com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxCtx;
+     ::com::sun::star::uno::Reference< com::sun::star::xml::crypto::sax::XSecurityController > mxSecurityController;
+     ::com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding > mxUriBinding;
+ 
+@@ -133,7 +132,7 @@
+     XMLSignatureHelper(const XMLSignatureHelper&);
+ 
+ public:
+-    XMLSignatureHelper(const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory>& rxMSF );
++    XMLSignatureHelper(const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& mrCtx );
+     ~XMLSignatureHelper();
+ 
+                 // Initialize the security context with given crypto token.
+Index: xml/xmlsecurity/source/component/documentdigitalsignatures.cxx
+diff -u xml/xmlsecurity/source/component/documentdigitalsignatures.cxx:1.31 xml/xmlsecurity/source/component/documentdigitalsignatures.cxx:1.31.20.1
+--- xml/xmlsecurity/source/component/documentdigitalsignatures.cxx:1.31	Thu Apr 10 17:09:41 2008
++++ xml/xmlsecurity/source/component/documentdigitalsignatures.cxx	Fri Aug  1 06:54:30 2008
+@@ -36,10 +36,11 @@
+ #include <xmlsecurity/digitalsignaturesdialog.hxx>
+ #include <xmlsecurity/certificateviewer.hxx>
+ #include <xmlsecurity/macrosecurity.hxx>
+-#include <xmlsecurity/baseencoding.hxx>
+ #include <xmlsecurity/biginteger.hxx>
+ #include <xmlsecurity/global.hrc>
+ 
++#include <xmloff/xmluconv.hxx>
++
+ #include <../dialogs/resourcemanager.hxx>
+ #include <com/sun/star/embed/XStorage.hpp>
+ #include <com/sun/star/embed/XTransactedObject.hpp>
+@@ -53,11 +54,11 @@
+ #include <tools/urlobj.hxx>
+ #include <vcl/msgbox.hxx>
+ #include <svtools/securityoptions.hxx>
+-#ifndef _COM_SUN_STAR_SECURITY_CERTIFICATEVALIDITY_HDL_
+ #include <com/sun/star/security/CertificateValidity.hdl>
+-#endif
++#include <com/sun/star/security/SerialNumberAdapter.hpp>
+ #include <ucbhelper/contentbroker.hxx>
+ #include <unotools/ucbhelper.hxx>
++#include <comphelper/componentcontext.hxx>
+ 
+ #include <stdio.h>
+ 
+@@ -66,9 +67,9 @@
+ using namespace ::com::sun::star::uno;
+ namespace css = ::com::sun::star;
+ 
+-DocumentDigitalSignatures::DocumentDigitalSignatures( const Reference< com::sun::star::lang::XMultiServiceFactory> rxMSF )
++DocumentDigitalSignatures::DocumentDigitalSignatures( const Reference< XComponentContext >& rxCtx )
+ {
+-    mxMSF = rxMSF;
++    mxCtx = rxCtx;
+ }
+ 
+ sal_Bool DocumentDigitalSignatures::signDocumentContent( const Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSignStream ) throw (RuntimeException)
+@@ -144,7 +145,7 @@
+ sal_Bool DocumentDigitalSignatures::ImplViewSignatures( const Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSignStream, DocumentSignatureMode eMode, bool bReadOnly ) throw (RuntimeException)
+ {
+     sal_Bool bChanges = sal_False;
+-    DigitalSignaturesDialog aSignaturesDialog( NULL, mxMSF, eMode, bReadOnly );
++    DigitalSignaturesDialog aSignaturesDialog( NULL, mxCtx, eMode, bReadOnly );
+     bool bInit = aSignaturesDialog.Init( rtl::OUString() );
+     DBG_ASSERT( bInit, "Error initializing security context!" );
+     if ( bInit )
+@@ -196,7 +197,7 @@
+ 		return Sequence< ::com::sun::star::security::DocumentSignatureInformation >(0);
+ 
+ 	
+-	XMLSignatureHelper aSignatureHelper( mxMSF );
++	XMLSignatureHelper aSignatureHelper( mxCtx );
+ 
+     bool bInit = aSignatureHelper.Init( rtl::OUString() );
+ 
+@@ -223,6 +224,9 @@
+     if ( nInfos )
+     {
+         std::vector< rtl::OUString > aElementsToBeVerified = DocumentSignatureHelper::CreateElementList( rxStorage, ::rtl::OUString(), eMode );
++        Reference<security::XSerialNumberAdapter> xSerialNumberAdapter = 
++            ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
++
+         for( int n = 0; n < nInfos; ++n )
+         {
+ 		    const SignatureInformation& rInfo = aSignInfos[n];
+@@ -231,7 +235,7 @@
+             if (rInfo.ouX509Certificate.getLength())
+            	rSigInfo.Signer = xSecEnv->createCertificateFromAscii( rInfo.ouX509Certificate ) ;
+             if (!rSigInfo.Signer.is())
+-                rSigInfo.Signer = xSecEnv->getCertificate( rInfo.ouX509IssuerName, numericStringToBigInteger( rInfo.ouX509SerialNumber ) );
++                rSigInfo.Signer = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) );
+ 		
+             // --> PB 2004-12-14 #i38744# time support again
+             Date aDate( rInfo.stDateTime.Day, rInfo.stDateTime.Month, rInfo.stDateTime.Year );
+@@ -295,17 +299,17 @@
+ 	
+ 	cssu::Reference< dcss::xml::crypto::XSecurityEnvironment > xSecEnv;
+ 
+-	XMLSignatureHelper aSignatureHelper( mxMSF );
++	XMLSignatureHelper aSignatureHelper( mxCtx );
+ 	if ( aSignatureHelper.Init( rtl::OUString() ) )
+ 		xSecEnv = aSignatureHelper.GetSecurityEnvironment();
+ 		
+-	MacroSecurity aDlg( NULL, xSecEnv );
++	MacroSecurity aDlg( NULL, mxCtx, xSecEnv );
+ 	aDlg.Execute();
+ }
+ 
+ void DocumentDigitalSignatures::showCertificate( const Reference< ::com::sun::star::security::XCertificate >& _Certificate ) throw (RuntimeException)
+ {
+-    XMLSignatureHelper aSignatureHelper( mxMSF );
++    XMLSignatureHelper aSignatureHelper( mxCtx );
+ 
+ 	bool bInit = aSignatureHelper.Init( rtl::OUString() );
+ 
+@@ -322,7 +326,11 @@
+ ::sal_Bool DocumentDigitalSignatures::isAuthorTrusted( const Reference< ::com::sun::star::security::XCertificate >& Author ) throw (RuntimeException)
+ {
+ 	sal_Bool bFound = sal_False;
+-	::rtl::OUString sSerialNum = bigIntegerToNumericString( Author->getSerialNumber() );
++
++    Reference<security::XSerialNumberAdapter> xSerialNumberAdapter = 
++        ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
++
++	::rtl::OUString sSerialNum = xSerialNumberAdapter->toString( Author->getSerialNumber() );
+ 
+     Sequence< SvtSecurityOptions::Certificate > aTrustedAuthors = SvtSecurityOptions().GetTrustedAuthors();
+ 	const SvtSecurityOptions::Certificate* pAuthors = aTrustedAuthors.getConstArray();
+@@ -372,10 +380,17 @@
+ {
+     SvtSecurityOptions aSecOpts;
+ 
++    Reference<security::XSerialNumberAdapter> xSerialNumberAdapter = 
++        ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
++
+     SvtSecurityOptions::Certificate aNewCert( 3 );
+-	aNewCert[ 0 ] = Author->getIssuerName();
+-	aNewCert[ 1 ] = bigIntegerToNumericString( Author->getSerialNumber() );
+-    aNewCert[ 2 ] = baseEncode( Author->getEncoded(), BASE64 );
++    aNewCert[ 0 ] = Author->getIssuerName();
++    aNewCert[ 1 ] = xSerialNumberAdapter->toString( Author->getSerialNumber() );
++
++    rtl::OUStringBuffer aStrBuffer;
++    SvXMLUnitConverter::encodeBase64(aStrBuffer, Author->getEncoded());
++    aNewCert[ 2 ] = aStrBuffer.makeStringAndClear();
++
+ 
+     Sequence< SvtSecurityOptions::Certificate > aTrustedAuthors = aSecOpts.GetTrustedAuthors();
+     sal_Int32 nCnt = aTrustedAuthors.getLength();
+@@ -412,8 +427,8 @@
+ 
+ 
+ Reference< XInterface > DocumentDigitalSignatures_CreateInstance(
+-	const Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr) throw ( Exception )
++	const Reference< XComponentContext >& rCtx) throw ( Exception )
+ {
+-	return (cppu::OWeakObject*) new DocumentDigitalSignatures( rSMgr );
++	return (cppu::OWeakObject*) new DocumentDigitalSignatures( rCtx );
+ }
+ 
+Index: xml/xmlsecurity/source/component/documentdigitalsignatures.hxx
+diff -u xml/xmlsecurity/source/component/documentdigitalsignatures.hxx:1.8 xml/xmlsecurity/source/component/documentdigitalsignatures.hxx:1.8.22.1
+--- xml/xmlsecurity/source/component/documentdigitalsignatures.hxx:1.8	Thu Apr 10 17:09:58 2008
++++ xml/xmlsecurity/source/component/documentdigitalsignatures.hxx	Fri Aug  1 06:54:31 2008
+@@ -45,14 +45,14 @@
+ >
+ {
+ private:
+-    com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory > mxMSF;
++    com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext > mxCtx;
+     
+     sal_Bool ImplViewSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XStream >& xSignStream, DocumentSignatureMode eMode, bool bReadOnly ) throw (::com::sun::star::uno::RuntimeException);
+     sal_Bool ImplViewSignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignStream, DocumentSignatureMode eMode, bool bReadOnly ) throw (::com::sun::star::uno::RuntimeException);
+     com::sun::star::uno::Sequence< ::com::sun::star::security::DocumentSignatureInformation > ImplVerifySignatures( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& rxStorage, const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& xSignStream, DocumentSignatureMode eMode ) throw (::com::sun::star::uno::RuntimeException);
+ 
+ public:
+-    DocumentDigitalSignatures( const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory> rxMSF );
++    DocumentDigitalSignatures( const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext>& rxCtx );
+ 
+     // for service registration...
+ 	static ::rtl::OUString GetImplementationName() throw (com::sun::star::uno::RuntimeException); 
+@@ -81,6 +81,6 @@
+ };
+ 
+ com::sun::star::uno::Reference< com::sun::star::uno::XInterface > SAL_CALL DocumentDigitalSignatures_CreateInstance( 
+-	const com::sun::star::uno::Reference< com::sun::star::lang::XMultiServiceFactory >& rSMgr) throw ( com::sun::star::uno::Exception );
++	const com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext >& rCtx) throw ( com::sun::star::uno::Exception );
+ 
+ #endif // _XMLSECURITY_DOCUMENTDIGITALSIGNATURES_HXX
+Index: xml/xmlsecurity/source/component/registerservices.cxx
+diff -u xml/xmlsecurity/source/component/registerservices.cxx:1.6 xml/xmlsecurity/source/component/registerservices.cxx:1.6.22.1
+--- xml/xmlsecurity/source/component/registerservices.cxx:1.6	Thu Apr 10 17:10:47 2008
++++ xml/xmlsecurity/source/component/registerservices.cxx	Fri Aug  1 06:54:31 2008
+@@ -93,42 +93,35 @@
+ 
+ void* SAL_CALL component_getFactory( const sal_Char * pImplName, void * pServiceManager, void * /*pRegistryKey*/ )
+ {
+-	void* pRet = NULL;
++    void* pRet = 0;
++    uno::Reference< XInterface > xFactory;
+ 	
+ 	//Decryptor
+-        rtl::OUString implName = rtl::OUString::createFromAscii( pImplName );
++    rtl::OUString implName = rtl::OUString::createFromAscii( pImplName );
+         
+-        // DocumentDigitalSignatures
+ 	if ( pServiceManager && implName.equals( DocumentDigitalSignatures::GetImplementationName() ) )
+ 	{
+-            uno::Reference< lang::XSingleServiceFactory > xFactory( cppu::createSingleFactory(
+-            reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
++        // DocumentDigitalSignatures
++        xFactory = cppu::createSingleComponentFactory(
++			DocumentDigitalSignatures_CreateInstance,
+             rtl::OUString::createFromAscii( pImplName ),
+-			DocumentDigitalSignatures_CreateInstance, DocumentDigitalSignatures::GetSupportedServiceNames() ) );
+-		
+-		if (xFactory.is())
+-		{
+-			xFactory->acquire();
+-			pRet = xFactory.get();
+-		}
++            DocumentDigitalSignatures::GetSupportedServiceNames() );
+ 	}
+-        
++    else if ( pServiceManager && implName.equals( CertificateContainer::impl_getStaticImplementationName() ))
++	{
+         // CertificateContainer
+-        if ( pServiceManager && implName.equals( CertificateContainer::impl_getStaticImplementationName() ))
++        xFactory = cppu::createOneInstanceFactory(
++            reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
++            rtl::OUString::createFromAscii( pImplName ), 
++            CertificateContainer::impl_createInstance, 
++            CertificateContainer::impl_getStaticSupportedServiceNames() );
++	}
++   
++ 	if (xFactory.is())
+ 	{
+-            uno::Reference< lang::XSingleServiceFactory > xFactoryCertificateContainer( cppu::createOneInstanceFactory(
+-                reinterpret_cast< lang::XMultiServiceFactory * >( pServiceManager ),
+-                rtl::OUString::createFromAscii( pImplName ), 
+-                CertificateContainer::impl_createInstance, 
+-                CertificateContainer::impl_getStaticSupportedServiceNames() ) );
+-		
+-            if (xFactoryCertificateContainer.is())
+-            {
+-		xFactoryCertificateContainer->acquire();
+-		pRet = xFactoryCertificateContainer.get();
+-            }
++		xFactory->acquire();
++		pRet = xFactory.get();
+ 	}
+-        
+ 	return pRet;
+ }
+ 
+Index: xml/xmlsecurity/source/dialogs/certificatechooser.cxx
+diff -u xml/xmlsecurity/source/dialogs/certificatechooser.cxx:1.12 xml/xmlsecurity/source/dialogs/certificatechooser.cxx:1.12.22.1
+--- xml/xmlsecurity/source/dialogs/certificatechooser.cxx:1.12	Thu Apr 10 17:11:15 2008
++++ xml/xmlsecurity/source/dialogs/certificatechooser.cxx	Fri Aug  1 06:54:31 2008
+@@ -36,9 +36,11 @@
+ #include <xmlsecurity/biginteger.hxx>
+ #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
+ #include <comphelper/sequence.hxx>
++#include <comphelper/processfactory.hxx>
+ 
+ #include <com/sun/star/security/NoPasswordException.hpp>
+ #include <com/sun/star/security/CertificateCharacters.hpp>
++#include <com/sun/star/security/SerialNumberAdapter.hpp>
+ 
+ #include <dialogs.hrc>
+ #include <resourcemanager.hxx>
+@@ -64,7 +66,7 @@
+ 	return (USHORT) nSel;
+ }
+ 
+-CertificateChooser::CertificateChooser( Window* _pParent, uno::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment, const SignatureInformations& _rCertsToIgnore )
++CertificateChooser::CertificateChooser( Window* _pParent, uno::Reference< uno::XComponentContext>& _rxCtx, uno::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment, const SignatureInformations& _rCertsToIgnore )
+ 	:ModalDialog	( _pParent, XMLSEC_RES( RID_XMLSECDLG_CERTCHOOSER ) )
+ 	,maCertsToIgnore( _rCertsToIgnore )
+ 	,maHintFT		( this, XMLSEC_RES( FT_HINT_SELECT ) )
+@@ -84,6 +86,7 @@
+ 
+ 	FreeResource();
+ 
++	mxCtx = _rxCtx;
+ 	mxSecurityEnvironment = _rxSecurityEnvironment;
+ 	mbInitialized = FALSE;
+ 
+@@ -135,6 +138,9 @@
+ 		{
+ 		}
+ 
++        uno::Reference< dcss::security::XSerialNumberAdapter> xSerialNumberAdapter =
++            ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
++
+ 		sal_Int32 nCertificates = maCerts.getLength();
+ 		sal_Int32 nCertificatesToIgnore = maCertsToIgnore.size();
+ 		for( sal_Int32 nCert = nCertificates; nCert; )
+@@ -150,7 +156,7 @@
+ 				{
+ 					const SignatureInformation& rInf = maCertsToIgnore[ nSig ];
+ 					if ( ( aIssuerName == rInf.ouX509IssuerName ) &&
+-						( bigIntegerToNumericString( xCert->getSerialNumber() ) == rInf.ouX509SerialNumber ) )
++						( xSerialNumberAdapter->toString( xCert->getSerialNumber() ) == rInf.ouX509SerialNumber ) )
+ 					{
+ 						bIgnoreThis = true;
+ 						break;
+Index: xml/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx
+diff -u xml/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx:1.35 xml/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx:1.35.16.1
+--- xml/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx:1.35	Thu May 22 23:45:13 2008
++++ xml/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx	Fri Aug  1 06:54:31 2008
+@@ -34,7 +34,7 @@
+ #include <xmlsecurity/certificatechooser.hxx>
+ #include <xmlsecurity/certificateviewer.hxx>
+ #include <xmlsecurity/biginteger.hxx>
+-#include "xmlsecurity/baseencoding.hxx"
++#include <xmloff/xmluconv.hxx>
+ #include <com/sun/star/embed/XStorage.hpp>
+ #include <com/sun/star/embed/ElementModes.hpp>
+ #include <com/sun/star/io/XSeekable.hpp>
+@@ -47,6 +47,9 @@
+ #include <com/sun/star/beans/XPropertySet.hpp>
+ #include <com/sun/star/security/CertificateValidity.hdl>
+ #include <com/sun/star/packages/WrongPasswordException.hpp>
++#include <com/sun/star/security/SerialNumberAdapter.hpp>
++
++#include <rtl/ustrbuf.hxx>
+ 
+ #include <tools/date.hxx>
+ #include <tools/time.hxx>
+@@ -57,6 +60,7 @@
+ 
+ #include <vcl/msgbox.hxx> // Until encrypted docs work...
+ #include <unotools/configitem.hxx>
++#include <comphelper/componentcontext.hxx>
+ 
+ 
+ using namespace ::com::sun::star::security;
+@@ -146,10 +150,11 @@
+ 
+ DigitalSignaturesDialog::DigitalSignaturesDialog( 
+     Window* pParent, 
+-    uno::Reference< lang::XMultiServiceFactory >& rxMSF, DocumentSignatureMode eMode, 
++    uno::Reference< uno::XComponentContext >& rxCtx, DocumentSignatureMode eMode, 
+     sal_Bool bReadOnly)
+ 	:ModalDialog		( pParent, XMLSEC_RES( RID_XMLSECDLG_DIGSIG ) )
+-	,maSignatureHelper	( rxMSF )
++	,mxCtx 				( rxCtx )
++	,maSignatureHelper	( rxCtx )
+ 	,meSignatureMode	( eMode )
+ 	,maHintDocFT		( this, XMLSEC_RES( FT_HINT_DOC ) )
+ 	,maHintBasicFT		( this, XMLSEC_RES( FT_HINT_BASIC ) )
+@@ -319,7 +324,10 @@
+     try
+     {
+         uno::Reference<com::sun::star::xml::crypto::XSecurityEnvironment> xSecEnv = maSignatureHelper.GetSecurityEnvironment();
+-        CertificateChooser aChooser( this, xSecEnv, maCurrentSignatureInformations );
++
++        uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter = 
++			::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
++        CertificateChooser aChooser( this, mxCtx, xSecEnv, maCurrentSignatureInformations );
+         if ( aChooser.Execute() == RET_OK )
+         {
+             uno::Reference< ::com::sun::star::security::XCertificate > xCert = aChooser.GetSelectedCertificate();
+@@ -328,19 +336,24 @@
+                 DBG_ERRORFILE( "no certificate selected" );
+                 return -1;
+             }
+-            rtl::OUString aCertSerial = bigIntegerToNumericString( xCert->getSerialNumber() );
++            rtl::OUString aCertSerial = xSerialNumberAdapter->toString( xCert->getSerialNumber() );
+             if ( !aCertSerial.getLength() )
+             {
+                 DBG_ERROR( "Error in Certificate, problem with serial number!" );
+                 return -1;
+-			}
++            }
+ 
+             maSignatureHelper.StartMission();
+ 
+             sal_Int32 nSecurityId = maSignatureHelper.GetNewSecurityId();
+-			
+-			maSignatureHelper.SetX509Certificate( nSecurityId, xCert->getIssuerName(), aCertSerial,
+-				baseEncode(xCert->getEncoded(), BASE64));
++
++            rtl::OUStringBuffer aStrBuffer;
++            SvXMLUnitConverter::encodeBase64(aStrBuffer, xCert->getEncoded());
++   
++            maSignatureHelper.SetX509Certificate( nSecurityId,
++                xCert->getIssuerName(), aCertSerial, 
++                aStrBuffer.makeStringAndClear());
++
+ 			
+             std::vector< rtl::OUString > aElements = DocumentSignatureHelper::CreateElementList( mxStore, rtl::OUString(), meSignatureMode );
+ 
+@@ -390,6 +403,7 @@
+ 			aStreamHelper = SignatureStreamHelper();	// release objects...
+ 
+             sal_Int32 nStatus = maSignatureHelper.GetSignatureInformation( nSecurityId ).nStatus;
++
+             if ( nStatus == ::com::sun::star::xml::crypto::SecurityOperationStatus_OPERATION_SUCCEEDED )
+             {
+                 mbSignaturesChanged = true;
+@@ -472,6 +486,9 @@
+     maSignaturesLB.Clear();
+ 
+     uno::Reference< ::com::sun::star::xml::crypto::XSecurityEnvironment > xSecEnv = maSignatureHelper.GetSecurityEnvironment();
++    uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter = 
++        ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
++
+     uno::Reference< ::com::sun::star::security::XCertificate > xCert;
+ 
+ 	String aNullStr;
+@@ -500,7 +517,7 @@
+ 			//In case there is no embedded certificate we try to get it from a local store
+             //Todo: This probably could be removed, see above.
+ 			if (!xCert.is())
+-				xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, numericStringToBigInteger( rInfo.ouX509SerialNumber ) );
++				xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) );
+ 
+ 		    DBG_ASSERT( xCert.is(), "Certificate not found and can't be created!" );
+ 
+@@ -615,13 +632,15 @@
+ 		const SignatureInformation&	rInfo = maCurrentSignatureInformations[ nSelected ];
+ 		css::uno::Reference<css::xml::crypto::XSecurityEnvironment > xSecEnv =
+ 			maSignatureHelper.GetSecurityEnvironment();
++        css::uno::Reference<com::sun::star::security::XSerialNumberAdapter> xSerialNumberAdapter = 
++            ::com::sun::star::security::SerialNumberAdapter::create(mxCtx);
+ 		// Use Certificate from doc, not from key store
+ 		uno::Reference< dcss::security::XCertificate > xCert;
+ 		if (rInfo.ouX509Certificate.getLength())
+ 			xCert = xSecEnv->createCertificateFromAscii(rInfo.ouX509Certificate);
+ 		//fallback if no certificate is embedded, get if from store
+ 		if (!xCert.is())
+-			xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, numericStringToBigInteger( rInfo.ouX509SerialNumber ) );
++			xCert = xSecEnv->getCertificate( rInfo.ouX509IssuerName, xSerialNumberAdapter->toSequence( rInfo.ouX509SerialNumber ) );
+ 
+ 		DBG_ASSERT( xCert.is(), "Error getting cCertificate!" );
+ 		if ( xCert.is() )
+Index: xml/xmlsecurity/source/dialogs/macrosecurity.cxx
+diff -u xml/xmlsecurity/source/dialogs/macrosecurity.cxx:1.30 xml/xmlsecurity/source/dialogs/macrosecurity.cxx:1.30.22.1
+--- xml/xmlsecurity/source/dialogs/macrosecurity.cxx:1.30	Thu Apr 10 17:13:31 2008
++++ xml/xmlsecurity/source/dialogs/macrosecurity.cxx	Fri Aug  1 06:54:31 2008
+@@ -41,6 +41,7 @@
+ 
+ 
+ #include <com/sun/star/xml/crypto/XSecurityEnvironment.hpp>
++#include <com/sun/star/security/SerialNumberAdapter.hpp>
+ #include <comphelper/sequence.hxx>
+ #include <sfx2/filedlghelper.hxx>
+ #include <svtools/pickerhelper.hxx>
+@@ -74,7 +75,7 @@
+ 	return 0;
+ }
+ 
+-MacroSecurity::MacroSecurity( Window* _pParent, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment )
++MacroSecurity::MacroSecurity( Window* _pParent, const cssu::Reference< cssu::XComponentContext> &_rxCtx, const cssu::Reference< dcss::xml::crypto::XSecurityEnvironment >& _rxSecurityEnvironment )
+ 	:TabDialog			( _pParent, XMLSEC_RES( RID_XMLSECTP_MACROSEC ) )
+ 	,maTabCtrl			( this, XMLSEC_RES( 1 ) )
+ 	,maOkBtn			( this, XMLSEC_RES( BTN_OK ) )
+@@ -84,6 +85,7 @@
+ {
+ 	FreeResource();
+ 
++	mxCtx = _rxCtx;
+ 	mxSecurityEnvironment = _rxSecurityEnvironment;
+ 
+ 	mpLevelTP = new MacroSecurityLevelTP( &maTabCtrl, this );
+@@ -201,7 +203,11 @@
+ 	if( maTrustCertLB.FirstSelected() )
+ 	{
+         USHORT nSelected = USHORT( sal_uIntPtr( maTrustCertLB.FirstSelected()->GetUserData() ) );
+-		uno::Reference< dcss::security::XCertificate > xCert = mpDlg->mxSecurityEnvironment->getCertificate( maTrustedAuthors[nSelected][0], numericStringToBigInteger( maTrustedAuthors[nSelected][1] ) );
++
++		uno::Reference< dcss::security::XSerialNumberAdapter > xSerialNumberAdapter =
++            ::com::sun::star::security::SerialNumberAdapter::create(mpDlg->mxCtx);
++
++		uno::Reference< dcss::security::XCertificate > xCert = mpDlg->mxSecurityEnvironment->getCertificate( maTrustedAuthors[nSelected][0], xSerialNumberAdapter->toSequence( maTrustedAuthors[nSelected][1] ) );
+ 
+         // If we don't get it, create it from signature data:
+         if ( !xCert.is() )
+Index: xml/xmlsecurity/source/helper/xmlsignaturehelper.cxx
+diff -u xml/xmlsecurity/source/helper/xmlsignaturehelper.cxx:1.28 xml/xmlsecurity/source/helper/xmlsignaturehelper.cxx:1.28.16.1
+--- xml/xmlsecurity/source/helper/xmlsignaturehelper.cxx:1.28	Wed May 14 03:22:07 2008
++++ xml/xmlsecurity/source/helper/xmlsignaturehelper.cxx	Fri Aug  1 06:54:31 2008
+@@ -46,6 +46,8 @@
+ #include <com/sun/star/io/XInputStream.hpp>
+ #include <com/sun/star/io/XActiveDataSource.hpp>
+ #include <com/sun/star/lang/XComponent.hpp>
++#include <com/sun/star/security/SerialNumberAdapter.hpp>
++#include <com/sun/star/beans/XPropertySet.hpp>
+ 
+ #include <tools/date.hxx>
+ #include <tools/time.hxx>
+@@ -63,12 +65,11 @@
+ 
+ using namespace ::com::sun::star;
+ 
+-XMLSignatureHelper::XMLSignatureHelper( const uno::Reference< lang::XMultiServiceFactory>& rxMSF)
+-    : mxMSF(rxMSF), mbODFPre1_2(false)
++XMLSignatureHelper::XMLSignatureHelper( const uno::Reference< uno::XComponentContext >& rxCtx)
++    : mxCtx(rxCtx), mbODFPre1_2(false)
+ {
+-    mpXSecController = new XSecController;
++    mpXSecController = new XSecController(rxCtx);
+     mxSecurityController = mpXSecController;
+-    mpXSecController->setFactory( rxMSF );
+     mbError = false;
+ }
+ 
+@@ -93,11 +94,10 @@
+ 
+ void XMLSignatureHelper::ImplCreateSEInitializer()
+ { 
+-	rtl::OUString sSEInitializer;
+-	
+-	sSEInitializer = rtl::OUString::createFromAscii( SEINITIALIZER_COMPONENT );
+-	mxSEInitializer = uno::Reference< com::sun::star::xml::crypto::XSEInitializer > (
+-			mxMSF->createInstance( sSEInitializer ), uno::UNO_QUERY );
++    rtl::OUString sSEInitializer(rtl::OUString::createFromAscii( SEINITIALIZER_COMPONENT ));
++    uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
++    mxSEInitializer = uno::Reference< com::sun::star::xml::crypto::XSEInitializer > (
++        xMCF->createInstanceWithContext( sSEInitializer,  mxCtx ), uno::UNO_QUERY );
+ }
+ 
+ void XMLSignatureHelper::SetUriBinding( com::sun::star::uno::Reference< com::sun::star::xml::crypto::XUriBinding >& rxUriBinding )
+@@ -200,10 +200,10 @@
+ 	/*
+ 	 * get SAX writer component 
+ 	 */
++	uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
+ 	uno::Reference< io::XActiveDataSource > xSaxWriter(
+-		mxMSF->createInstance(rtl::OUString::createFromAscii( 
+-			"com.sun.star.xml.sax.Writer")),
+-		uno::UNO_QUERY );
++		xMCF->createInstanceWithContext(rtl::OUString::createFromAscii( 
++			"com.sun.star.xml.sax.Writer"), mxCtx ), uno::UNO_QUERY );
+ 		
+ 	DBG_ASSERT( xSaxWriter.is(), "can't instantiate XML writer" );
+ 	
+@@ -318,10 +318,12 @@
+ 	/*
+ 	 * get SAX parser component
+ 	 */
++	uno::Reference< lang::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
+ 	uno::Reference< xml::sax::XParser > xParser(
+-		mxMSF->createInstance(
+-			rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser") ),
++		xMCF->createInstanceWithContext(
++			rtl::OUString::createFromAscii("com.sun.star.xml.sax.Parser"), mxCtx ),
+ 		uno::UNO_QUERY );
++
+ 	DBG_ASSERT( xParser.is(), "Can't create parser" );
+ 
+ 	/*
+@@ -462,6 +464,3 @@
+ 
+     return 0;
+ }
+-
+-
+-
+Index: xml/xmlsecurity/source/helper/xsecctl.cxx
+diff -u xml/xmlsecurity/source/helper/xsecctl.cxx:1.11 xml/xmlsecurity/source/helper/xsecctl.cxx:1.11.22.1
+--- xml/xmlsecurity/source/helper/xsecctl.cxx:1.11	Thu Apr 10 17:24:20 2008
++++ xml/xmlsecurity/source/helper/xsecctl.cxx	Fri Aug  1 06:54:32 2008
+@@ -65,8 +65,9 @@
+ /* string for package protocol */
+ #define PACKAGEPROTOCOL "vnd.sun.star.Package:"
+ 
+-XSecController::XSecController( )
+-	:m_nNextSecurityId(1),
++XSecController::XSecController( const cssu::Reference<cssu::XComponentContext>& rxCtx )
++	:mxCtx(rxCtx),
++	 m_nNextSecurityId(1),
+  	 m_bIsSAXEventKeeperConnected(false),
+ 	 m_nStatusOfSecurityComponents(UNINITIALIZED),
+  	 m_bIsSAXEventKeeperSticky(false),
+@@ -360,9 +361,11 @@
+ 	m_xXMLSignature = NULL;
+ 	m_xXMLDocumentWrapper = NULL;
+ 	m_xSAXEventKeeper = NULL;
++
++	cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
+ 	
+ 	m_xXMLSignature = cssu::Reference< cssxc::XXMLSignature >(
+-		mxMSF->createInstance( sXMLSignature ),
++		xMCF->createInstanceWithContext( sXMLSignature, mxCtx ),
+ 		cssu::UNO_QUERY );
+ 		
+ 	bool bSuccess = (0!=m_xXMLSignature.is());
+@@ -372,7 +375,7 @@
+ 	 */
+ 	{
+ 		m_xXMLDocumentWrapper = cssu::Reference< cssxw::XXMLDocumentWrapper >(
+-			mxMSF->createInstance( sXMLDocument ),
++			xMCF->createInstanceWithContext( sXMLDocument, mxCtx ),
+ 			cssu::UNO_QUERY );
+ 	}
+ 	
+@@ -383,7 +386,7 @@
+ 	 */
+ 	{
+ 		m_xSAXEventKeeper = cssu::Reference< cssxc::sax::XSecuritySAXEventKeeper >(
+-			mxMSF->createInstance( sSAXEventKeeper ),
++			xMCF->createInstanceWithContext( sSAXEventKeeper, mxCtx ),
+ 			cssu::UNO_QUERY );
+ 	}
+ 
+@@ -769,49 +772,6 @@
+  * public methods 
+  */
+ 
+-void XSecController::setFactory( const cssu::Reference<cssl::XMultiServiceFactory>& rxMSF)
+-/****** XSecController/setFactory *********************************************
+- *
+- *   NAME
+- *	setFactory -- configures the service factory component.
+- *
+- *   SYNOPSIS
+- *	setFactory( rxMSF );
+- *
+- *   FUNCTION
+- *	See NAME.
+- *
+- *   INPUTS
+- *	rxMSF - the service factory component
+- *
+- *   RESULT
+- *	empty
+- *
+- *   HISTORY
+- *	05.01.2004 -	implemented
+- *
+- *   AUTHOR
+- *	Michael Mi
+- *	Email: michael.mi at sun.com
+- ******************************************************************************/
+-{
+-	mxMSF = rxMSF;
+-}
+-
+-#if 0
+-void XSecController::setSignatureCreationResultListener( 
+-	const cssu::Reference< cssxc::sax::XSignatureCreationResultListener >& xSignatureCreationResultListener)
+-{
+-	m_xSignatureCreationResultListener = xSignatureCreationResultListener;
+-}
+-	
+-void XSecController::setSignatureVerifyResultListener( 
+-	const cssu::Reference< cssxc::sax::XSignatureVerifyResultListener >& xSignatureVerifyResultListener)
+-{                                                                                                          
+-	m_xSignatureVerifyResultListener = xSignatureVerifyResultListener;
+-}
+-#endif
+-
+ sal_Int32 XSecController::getNewSecurityId(  )
+ {
+ 	sal_Int32 nId = m_nNextSecurityId;
+Index: xml/xmlsecurity/source/helper/xsecctl.hxx
+diff -u xml/xmlsecurity/source/helper/xsecctl.hxx:1.11 xml/xmlsecurity/source/helper/xsecctl.hxx:1.11.22.1
+--- xml/xmlsecurity/source/helper/xsecctl.hxx:1.11	Thu Apr 10 17:24:34 2008
++++ xml/xmlsecurity/source/helper/xsecctl.hxx	Fri Aug  1 06:54:32 2008
+@@ -33,6 +33,7 @@
+ 
+ #include <xmlsecurity/sigstruct.hxx>
+ 
++#include <com/sun/star/uno/XComponentContext.hpp>
+ #include <com/sun/star/xml/sax/XParser.hpp>
+ #include <com/sun/star/lang/XInitialization.hpp>
+ #include <com/sun/star/xml/sax/XDocumentHandler.hpp>
+@@ -192,8 +193,7 @@
+ 	friend class XSecParser;
+ 
+ private:
+-	com::sun::star::uno::Reference<
+-		com::sun::star::lang::XMultiServiceFactory> mxMSF;
++	com::sun::star::uno::Reference< com::sun::star::uno::XComponentContext> mxCtx;
+ 	
+ 	/*
+ 	 * used to buffer SAX events
+@@ -428,21 +428,9 @@
+ 		sal_Int32 nSecurityId );
+ 		
+ public:
+-	XSecController();
++	XSecController(const com::sun::star::uno::Reference<com::sun::star::uno::XComponentContext>& rxCtx);
+ 	~XSecController();
+ 	
+-	/*
+-	 * Common methods
+-	 */
+-	void setFactory( const com::sun::star::uno::Reference<
+-		com::sun::star::lang::XMultiServiceFactory>& rxMSF);
+-#if 0		
+-	void setSignatureCreationResultListener( const com::sun::star::uno::Reference<
+-		com::sun::star::xml::crypto::sax::XSignatureCreationResultListener >& xSignatureCreationResultListener);
+-	void setSignatureVerifyResultListener( const com::sun::star::uno::Reference<
+-		com::sun::star::xml::crypto::sax::XSignatureVerifyResultListener >& xSignatureVerifyResultListener);
+-#endif
+-
+ 	sal_Int32 getNewSecurityId(  );
+ 
+ 	void startMission( const com::sun::star::uno::Reference< 
+Index: xml/xmlsecurity/source/helper/xsecsign.cxx
+diff -u xml/xmlsecurity/source/helper/xsecsign.cxx:1.11 xml/xmlsecurity/source/helper/xsecsign.cxx:1.11.22.1
+--- xml/xmlsecurity/source/helper/xsecsign.cxx:1.11	Thu Apr 10 17:25:19 2008
++++ xml/xmlsecurity/source/helper/xsecsign.cxx	Fri Aug  1 06:54:32 2008
+@@ -86,9 +86,10 @@
+         /*
+          * create a SignatureCreator
+          */
++	cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
+ 	xReferenceResolvedListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >(
+-		mxMSF->createInstance(
+-			rtl::OUString::createFromAscii(SIGNATURECREATOR_COMPONENT)),
++		xMCF->createInstanceWithContext(
++			rtl::OUString::createFromAscii(SIGNATURECREATOR_COMPONENT), mxCtx),
+ 		cssu::UNO_QUERY);
+ 	
+ 	cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY);
+Index: xml/xmlsecurity/source/helper/xsecverify.cxx
+diff -u xml/xmlsecurity/source/helper/xsecverify.cxx:1.9 xml/xmlsecurity/source/helper/xsecverify.cxx:1.9.22.1
+--- xml/xmlsecurity/source/helper/xsecverify.cxx:1.9	Thu Apr 10 17:25:38 2008
++++ xml/xmlsecurity/source/helper/xsecverify.cxx	Fri Aug  1 06:54:32 2008
+@@ -70,9 +70,10 @@
+         /*
+          * create a SignatureVerifier
+          */
++	cssu::Reference< cssl::XMultiComponentFactory > xMCF( mxCtx->getServiceManager() );
+ 	xReferenceResolvedListener = cssu::Reference< cssxc::sax::XReferenceResolvedListener >(
+-		mxMSF->createInstance(
+-			rtl::OUString::createFromAscii( SIGNATUREVERIFIER_COMPONENT )),
++		xMCF->createInstanceWithContext(
++			rtl::OUString::createFromAscii( SIGNATUREVERIFIER_COMPONENT ), mxCtx),
+ 		cssu::UNO_QUERY);
+ 	
+ 	cssu::Reference<cssl::XInitialization> xInitialization(xReferenceResolvedListener, cssu::UNO_QUERY);
+Index: xml/xmlsecurity/source/xmlsec/baseencoding.cxx
+diff -u xml/xmlsecurity/source/xmlsec/baseencoding.cxx:1.6 xml/xmlsecurity/source/xmlsec/baseencoding.cxx:removed
+--- xml/xmlsecurity/source/xmlsec/baseencoding.cxx:1.6	Thu Apr 10 17:25:53 2008
++++ xml/xmlsecurity/source/xmlsec/baseencoding.cxx	Fri Aug  1 09:32:05 2008
+@@ -1,100 +0,0 @@
+-/*************************************************************************
+- *
+- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+- * 
+- * Copyright 2008 by Sun Microsystems, Inc.
+- *
+- * OpenOffice.org - a multi-platform office productivity suite
+- *
+- * $RCSfile$
+- * $Revision$
+- *
+- * This file is part of OpenOffice.org.
+- *
+- * OpenOffice.org is free software: you can redistribute it and/or modify
+- * it under the terms of the GNU Lesser General Public License version 3
+- * only, as published by the Free Software Foundation.
+- *
+- * OpenOffice.org is distributed in the hope that it will be useful,
+- * but WITHOUT ANY WARRANTY; without even the implied warranty of
+- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+- * GNU Lesser General Public License version 3 for more details
+- * (a copy is included in the LICENSE file that accompanied this code).
+- *
+- * You should have received a copy of the GNU Lesser General Public License
+- * version 3 along with OpenOffice.org.  If not, see
+- * <http://www.openoffice.org/license.html>
+- * for a copy of the LGPLv3 License.
+- *
+- ************************************************************************/
+-
+-// MARKER(update_precomp.py): autogen include statement, do not remove
+-#include "precompiled_xmlsecurity.hxx"
+-#include "xmlsecurity/baseencoding.hxx"
+-
+-#include <xmlsec/xmlsec.h>
+-#include <xmlsec/base64.h>
+-#include <com/sun/star/uno/Sequence.hxx>
+-
+-//CP : added by CP
+-#include <rtl/locale.h>
+-#include <osl/nlsupport.h> 
+-#include <osl/process.h>
+-
+-//CP : end
+-
+-
+-using namespace ::com::sun::star::uno ;
+-using ::rtl::OUString ;
+-
+-//We only implment the base64 encoding at present.
+-::rtl::OUString SAL_CALL baseEncode( const ::com::sun::star::uno::Sequence< sal_Int8 >& rawdata, BaseType base ) {
+-	if( base == BASE64 ) {
+-		xmlChar* chData ;
+-
+-		chData = xmlSecBase64Encode( ( const unsigned char* )&rawdata[0], rawdata.getLength(), 0 ) ;
+-		if( chData != NULL ) {
+-			OUString ouStr = OUString::createFromAscii( ( const sal_Char* )chData );
+-			xmlFree( chData ) ;
+-
+-			return ouStr ;
+-		}
+-	} else {
+-		return OUString() ;
+-	}
+-
+-	return OUString() ;
+-}
+-
+-//We only implment the base64 encoding at present.
+-::com::sun::star::uno::Sequence< sal_Int8 > SAL_CALL baseDecode( const ::rtl::OUString& oustr, BaseType base ) {
+-	if( base == BASE64 ) {
+-		xmlChar* chData ;
+-		xmlSecSize chSize ;
+-
+-		// add By CP
+-		sal_uInt16 encoding;
+-		rtl_Locale* pLocale = NULL;
+-		osl_getProcessLocale(&pLocale);
+-		encoding = osl_getTextEncodingFromLocale(pLocale);
+-		// CP end
+-
+-		rtl::OString ostr = rtl::OUStringToOString( oustr , encoding ) ;
+-		//rtl::OString ostr = rtl::OUStringToOString( oustr , RTL_TEXTENCODING_ASCII_US ) ;
+-
+-		chData = xmlStrndup( ( const xmlChar* )ostr.getStr(), ( int )ostr.getLength() ) ;
+-
+-		chSize = xmlSecBase64Decode( chData, ( xmlSecByte* )chData, xmlStrlen( chData ) ) ;
+-
+-		Sequence< sal_Int8 > rawData( chSize ) ;
+-		for( unsigned int i = 0 ; i < chSize ; i ++ )
+-			rawData[i] = *( chData + i ) ;
+-
+-		xmlFree( chData ) ;
+-
+-		return rawData ;
+-	}
+-
+-	return ::com::sun::star::uno::Sequence< sal_Int8 >() ;
+-}
+-
+Index: xml/xmlsecurity/source/xmlsec/biginteger.cxx
+diff -u xml/xmlsecurity/source/xmlsec/biginteger.cxx:1.7 xml/xmlsecurity/source/xmlsec/biginteger.cxx:1.7.22.1
+--- xml/xmlsecurity/source/xmlsec/biginteger.cxx:1.7	Thu Apr 10 17:26:07 2008
++++ xml/xmlsecurity/source/xmlsec/biginteger.cxx	Wed Jul 30 02:30:33 2008
+@@ -33,6 +33,11 @@
+ 
+ #include <xmlsecurity/biginteger.hxx>
+ 
++#include <sal/types.h>
++//For reasons that escape me, this is what xmlsec does when size_t is not 4
++#if SAL_TYPES_SIZEOFPOINTER != 4
++#    define XMLSEC_NO_SIZE_T
++#endif
+ #include <xmlsec/xmlsec.h>
+ #include <xmlsec/bn.h>
+ #include <com/sun/star/uno/Sequence.hxx>
+Index: xml/xmlsecurity/source/xmlsec/errorcallback.cxx
+diff -u xml/xmlsecurity/source/xmlsec/errorcallback.cxx:1.9 xml/xmlsecurity/source/xmlsec/errorcallback.cxx:1.9.22.1
+--- xml/xmlsecurity/source/xmlsec/errorcallback.cxx:1.9	Thu Apr 10 17:27:07 2008
++++ xml/xmlsecurity/source/xmlsec/errorcallback.cxx	Wed Jul 30 02:30:33 2008
+@@ -36,6 +36,11 @@
+  */
+ #include "errorcallback.hxx"
+ 
++#include <sal/types.h>
++//For reasons that escape me, this is what xmlsec does when size_t is not 4
++#if SAL_TYPES_SIZEOFPOINTER != 4
++#    define XMLSEC_NO_SIZE_T
++#endif
+ #include "xmlsec/xmlsec.h"
+ #include "xmlsec/errors.h"
+ 
+Index: xml/xmlsecurity/source/xmlsec/makefile.mk
+diff -u xml/xmlsecurity/source/xmlsec/makefile.mk:1.11 xml/xmlsecurity/source/xmlsec/makefile.mk:1.11.22.1
+--- xml/xmlsecurity/source/xmlsec/makefile.mk:1.11	Thu Apr 10 17:27:38 2008
++++ xml/xmlsecurity/source/xmlsec/makefile.mk	Fri Aug  1 06:54:32 2008
+@@ -57,7 +57,6 @@
+ 
+ # --- Files --------------------------------------------------------
+ SLOFILES = \
+-	$(SLO)$/baseencoding.obj \
+ 	$(SLO)$/biginteger.obj \
+ 	$(SLO)$/certvalidity.obj \
+ 	$(SLO)$/saxhelper.obj \
+Index: xml/xmlsecurity/source/xmlsec/xmlstreamio.cxx
+diff -u xml/xmlsecurity/source/xmlsec/xmlstreamio.cxx:1.6 xml/xmlsecurity/source/xmlsec/xmlstreamio.cxx:1.6.10.1
+--- xml/xmlsecurity/source/xmlsec/xmlstreamio.cxx:1.6	Thu Jun 19 08:39:17 2008
++++ xml/xmlsecurity/source/xmlsec/xmlstreamio.cxx	Wed Jul 30 02:30:34 2008
+@@ -39,6 +39,11 @@
+ #include "rtl/uri.hxx"
+ 
+ #include <libxml/uri.h>
++#include <sal/types.h>
++//For reasons that escape me, this is what xmlsec does when size_t is not 4
++#if SAL_TYPES_SIZEOFPOINTER != 4
++#    define XMLSEC_NO_SIZE_T
++#endif
+ #include <xmlsec/io.h>
+ 
+ #define XMLSTREAMIO_INITIALIZED 0x01
+Index: xml/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx
+diff -u xml/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx:1.5 xml/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx:1.5.22.1
+--- xml/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx:1.5	Thu Apr 10 17:30:05 2008
++++ xml/xmlsecurity/source/xmlsec/xsec_xmlsec.cxx	Fri Aug  1 06:54:32 2008
+@@ -37,10 +37,13 @@
+ #include <osl/mutex.hxx>
+ #include <osl/thread.h>
+ #include <cppuhelper/factory.hxx>
++#include <cppuhelper/implbase1.hxx>
+ #include <com/sun/star/lang/XSingleServiceFactory.hpp>
++#include <com/sun/star/security/XSerialNumberAdapter.hpp>
+ 
+ #include "xmlelementwrapper_xmlsecimpl.hxx"
+ #include "xmldocumentwrapper_xmlsecimpl.hxx"
++#include "xmlsecurity/biginteger.hxx"
+ 
+ using namespace ::rtl;
+ using namespace ::cppu;
+@@ -48,6 +51,48 @@
+ using namespace ::com::sun::star::lang;
+ using namespace ::com::sun::star::registry;
+ 
++namespace
++{
++class SerialNumberAdapterImpl : public WeakImplHelper1<
++        ::com::sun::star::security::XSerialNumberAdapter >
++{
++    virtual OUString SAL_CALL toString( const Sequence< sal_Int8 >& rSerialNumber ) 
++        throw (RuntimeException)
++    {
++        return bigIntegerToNumericString(rSerialNumber);
++    }
++    virtual Sequence< sal_Int8 > SAL_CALL toSequence( const OUString& rSerialNumber )
++        throw (RuntimeException)
++    {
++        return numericStringToBigInteger(rSerialNumber);
++    }
++};
++
++OUString SerialNumberAdapterImpl_getImplementationName()
++    throw (RuntimeException)
++{
++    return OUString(RTL_CONSTASCII_USTRINGPARAM(
++        "com.sun.star.security.SerialNumberAdapter"));
++}
++
++Sequence< OUString > SerialNumberAdapterImpl_getSupportedServiceNames()
++    throw (RuntimeException)
++{
++    Sequence < OUString > aRet(1);
++    OUString* pArray = aRet.getArray();
++    pArray[0] = OUString(RTL_CONSTASCII_USTRINGPARAM(
++        "com.sun.star.security.SerialNumberAdapter" ) );
++    return aRet;
++}
++
++Reference< XInterface > SerialNumberAdapterImpl_createInstance(
++    const Reference< XComponentContext > &) throw( Exception )
++{
++    return Reference< XInterface >( *new SerialNumberAdapterImpl() );
++}
++
++}
++
+ extern "C"
+ {
+ 
+@@ -103,6 +148,18 @@
+ 				xNewKey->createKey( seqServices.getConstArray()[i] ) ;
+ 		}
+ 
++		// SerialNumberAdapterImpl
++		sKeyName = OUString( RTL_CONSTASCII_USTRINGPARAM( "/" ) ) ;
++		sKeyName += SerialNumberAdapterImpl_getImplementationName() ;
++		sKeyName += OUString::createFromAscii( "/UNO/SERVICES" ) ;
++
++		xNewKey = xKey->createKey( sKeyName ) ;
++		if( xNewKey.is() ) {
++			seqServices = SerialNumberAdapterImpl_getSupportedServiceNames() ;
++			for( i = seqServices.getLength() ; i -- ;  )
++				xNewKey->createKey( seqServices.getConstArray()[i] ) ;
++		}
++
+ #if defined( XMLSEC_CRYPTO_NSS )
+ 		result = nss_component_writeInfo( pServiceManager, pRegistryKey ) ;
+ 		if( !result )
+@@ -127,7 +184,7 @@
+ void* SAL_CALL component_getFactory( const sal_Char* pImplName , void* pServiceManager , void* pRegistryKey )
+ {
+ 	void* pRet = 0;
+-	Reference< XSingleServiceFactory > xFactory ;
++	Reference< XInterface > xFactory ;
+ 
+ 	if( pImplName != NULL && pServiceManager != NULL ) {
+ 		if( XMLElementWrapper_XmlSecImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) 
+@@ -144,6 +201,13 @@
+ 				OUString::createFromAscii( pImplName ),
+ 				XMLDocumentWrapper_XmlSecImpl_createInstance, XMLDocumentWrapper_XmlSecImpl_getSupportedServiceNames() ) );
+ 		}
++		else if( SerialNumberAdapterImpl_getImplementationName().equals( OUString::createFromAscii( pImplName ) ) ) 
++		{
++			xFactory = ::cppu::createSingleComponentFactory(
++              SerialNumberAdapterImpl_createInstance,
++              OUString::createFromAscii( pImplName ),
++              SerialNumberAdapterImpl_getSupportedServiceNames() );
++		}
+ 	}
+ 
+ 	if( xFactory.is() ) {
+Index: xml/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx
+diff -u xml/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx:1.22 xml/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx:1.22.22.1
+--- xml/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx:1.22	Thu Apr 10 17:37:54 2008
++++ xml/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.cxx	Wed Jul 30 02:30:34 2008
+@@ -45,6 +45,11 @@
+ #include "certt.h"
+ #include "prerror.h"
+ 
++#include <sal/types.h>
++//For reasons that escape me, this is what xmlsec does when size_t is not 4
++#if SAL_TYPES_SIZEOFPOINTER != 4
++#    define XMLSEC_NO_SIZE_T
++#endif
+ #include <xmlsec/xmlsec.h>
+ #include <xmlsec/keysmngr.h>
+ #include <xmlsec/crypto.h>
+Index: xml/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx
+diff -u xml/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx:1.8 xml/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx:1.8.22.1
+--- xml/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx:1.8	Thu Apr 10 17:38:15 2008
++++ xml/xmlsecurity/source/xmlsec/nss/securityenvironment_nssimpl.hxx	Wed Jul 30 02:30:34 2008
+@@ -59,6 +59,11 @@
+ #include "certdb.h"
+ #include "list"
+ 
++#include <sal/types.h>
++//For reasons that escape me, this is what xmlsec does when size_t is not 4
++#if SAL_TYPES_SIZEOFPOINTER != 4
++#    define XMLSEC_NO_SIZE_T
++#endif
+ #include "xmlsec/xmlsec.h"
+ 
+ class SecurityEnvironment_NssImpl : public ::cppu::WeakImplHelper4<
+Index: xml/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx
+diff -u xml/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx:1.21 xml/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx:1.21.22.1
+--- xml/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx:1.21	Thu Apr 10 17:38:31 2008
++++ xml/xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx	Thu Jul 24 06:25:05 2008
+@@ -68,6 +68,7 @@
+ #include "pk11func.h"
+ #ifdef SYSTEM_MOZILLA
+ #include "nssrenam.h"
++#include "secmod.h"        
+ #endif
+ #include "cert.h"
+ #include "cryptohi.h"
+@@ -104,6 +105,15 @@
+                         printf("%s",error);
+                     return false ;
+                 }
++
++#ifdef SYSTEM_MOZILLA
++		if (!SECMOD_HasRootCerts())
++		{
++			SECMOD_AddNewModule("Root Certs", "libnssckbi" SAL_DLLEXTENSION, 
++				0, 0);
++		}
++#endif
++
+ 		initialized = 1 ;
+ 	}
+ 
+Index: xml/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx
+diff -u xml/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx:1.9 xml/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx:1.9.22.1
+--- xml/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx:1.9	Thu Apr 10 17:39:31 2008
++++ xml/xmlsecurity/source/xmlsec/nss/xmlencryption_nssimpl.cxx	Wed Jul 30 02:30:34 2008
+@@ -47,6 +47,11 @@
+ #endif
+ #include "errorcallback.hxx"
+ 
++#include <sal/types.h>
++//For reasons that escape me, this is what xmlsec does when size_t is not 4
++#if SAL_TYPES_SIZEOFPOINTER != 4
++#    define XMLSEC_NO_SIZE_T
++#endif
+ #include "xmlsec/xmlsec.h"
+ #include "xmlsec/xmltree.h"
+ #include "xmlsec/xmlenc.h"
+Index: xml/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx
+diff -u xml/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx:1.7 xml/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx:1.7.22.1
+--- xml/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx:1.7	Thu Apr 10 17:40:05 2008
++++ xml/xmlsecurity/source/xmlsec/nss/xmlsecuritycontext_nssimpl.cxx	Wed Jul 30 02:30:35 2008
+@@ -39,6 +39,11 @@
+ #endif
+ #include "xmlstreamio.hxx"
+ 
++#include <sal/types.h>
++//For reasons that escape me, this is what xmlsec does when size_t is not 4
++#if SAL_TYPES_SIZEOFPOINTER != 4
++#    define XMLSEC_NO_SIZE_T
++#endif
+ #include "xmlsec/xmlsec.h"
+ #include "xmlsec/keysmngr.h"
+ #include "xmlsec/crypto.h"
+Index: xml/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx
+diff -u xml/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx:1.9 xml/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx:1.9.22.1
+--- xml/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx:1.9	Thu Apr 10 17:40:37 2008
++++ xml/xmlsecurity/source/xmlsec/nss/xmlsignature_nssimpl.cxx	Wed Jul 30 02:30:35 2008
+@@ -52,6 +52,11 @@
+ #include "xmlstreamio.hxx"
+ #include "errorcallback.hxx"
+ 
++#include <sal/types.h>
++//For reasons that escape me, this is what xmlsec does when size_t is not 4
++#if SAL_TYPES_SIZEOFPOINTER != 4
++#    define XMLSEC_NO_SIZE_T
++#endif
+ #include "xmlsec/xmlsec.h"
+ #include "xmlsec/xmldsig.h"
+ #include "xmlsec/crypto.h"
+Index: xml/xmlsecurity/util/makefile.mk
+diff -u xml/xmlsecurity/util/makefile.mk:1.22 xml/xmlsecurity/util/makefile.mk:1.22.22.1
+--- xml/xmlsecurity/util/makefile.mk:1.22	Thu Apr 10 17:51:04 2008
++++ xml/xmlsecurity/util/makefile.mk	Fri Aug  1 06:54:33 2008
+@@ -137,10 +137,6 @@
+                 $(SLB)$/dialogs.lib     \
+                 $(SLB)$/component.lib
+ 
+-SHL4OBJS=\
+-                $(SLO)$/baseencoding.obj    \
+-                $(SLO)$/biginteger.obj
+-
+ SHL4STDLIBS=\
+                 $(CPPULIB)			\
+ 				$(CPPUHELPERLIB)	\
+@@ -158,9 +154,6 @@
+ 				$(XMLOFFLIB)		\
+ 				$(SVXLIB)
+ 
+-#MT: Remove libxml2 and xs_comm (above) by cerating service for base encodings
+-SHL4STDLIBS+= $(LIBXML2LIB) $(XMLSECLIB)
+-
+ SHL4VERSIONMAP = xmlsecurity.map
+ SHL4DEPN=
+ SHL4IMPLIB=i$(TARGET)
 Index: tools/solenv/bin/langwrap
 diff -u tools/solenv/bin/langwrap:1.1.1.1 tools/solenv/bin/langwrap:1.1.1.1.1992.1
 --- tools/solenv/bin/langwrap:1.1.1.1	Wed Sep 20 07:43:11 2000




More information about the scm-commits mailing list