Files
libreoffice/package/source/zippackage/ZipPackageStream.cxx

926 lines
33 KiB
C++
Raw Normal View History

/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2012-06-22 18:32:07 +01:00
/*
* 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/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include <com/sun/star/packages/zip/ZipConstants.hpp>
2010-04-13 10:28:25 +02:00
#include <com/sun/star/embed/StorageFormats.hpp>
#include <com/sun/star/packages/zip/ZipIOException.hpp>
#include <com/sun/star/io/TempFile.hpp>
#include <com/sun/star/io/XInputStream.hpp>
#include <com/sun/star/io/XOutputStream.hpp>
#include <com/sun/star/io/XStream.hpp>
#include <com/sun/star/io/XSeekable.hpp>
2011-03-09 17:29:09 +01:00
#include <com/sun/star/xml/crypto/DigestID.hpp>
#include <com/sun/star/xml/crypto/CipherID.hpp>
#include <string.h>
#include <ZipPackageStream.hxx>
#include <ZipPackage.hxx>
#include <ZipFile.hxx>
#include <EncryptedDataHeader.hxx>
2010-10-10 19:46:46 -05:00
#include <osl/diagnose.h>
#include "wrapstreamforshare.hxx"
#include <comphelper/processfactory.hxx>
#include <comphelper/seekableinput.hxx>
#include <comphelper/storagehelper.hxx>
#include <cppuhelper/supportsservice.hxx>
#include <cppuhelper/typeprovider.hxx>
#include <rtl/instance.hxx>
#include <PackageConstants.hxx>
using namespace com::sun::star::packages::zip::ZipConstants;
using namespace com::sun::star::packages::zip;
using namespace com::sun::star::uno;
using namespace com::sun::star::lang;
using namespace com::sun::star;
using namespace cppu;
2010-10-15 12:18:51 -05:00
#if OSL_DEBUG_LEVEL > 0
#define THROW_WHERE SAL_WHERE
#else
#define THROW_WHERE ""
#endif
namespace { struct lcl_CachedImplId : public rtl::Static< cppu::OImplementationId, lcl_CachedImplId > {}; }
::com::sun::star::uno::Sequence < sal_Int8 > ZipPackageStream::static_getImplementationId()
{
return lcl_CachedImplId::get().getImplementationId();
}
ZipPackageStream::ZipPackageStream ( ZipPackage & rNewPackage,
const uno::Reference< XComponentContext >& xContext,
bool bAllowRemoveOnInsert )
: m_xContext( xContext )
2011-03-09 17:29:09 +01:00
, rZipPackage( rNewPackage )
, bToBeCompressed ( true )
, bToBeEncrypted ( false )
, bHaveOwnKey ( false )
, bIsEncrypted ( false )
, m_nImportedStartKeyAlgorithm( 0 )
2011-03-09 17:29:09 +01:00
, m_nImportedEncryptionAlgorithm( 0 )
, m_nImportedChecksumAlgorithm( 0 )
, m_nImportedDerivedKeySize( 0 )
, m_nStreamMode( PACKAGE_STREAM_NOTSET )
, m_nMagicalHackPos( 0 )
, m_nMagicalHackSize( 0 )
, m_bHasSeekable( false )
, m_bCompressedIsSetFromOutside( false )
, m_bFromManifest( false )
2011-03-09 17:29:09 +01:00
, m_bUseWinEncoding( false )
{
OSL_ENSURE( m_xContext.is(), "No factory is provided to ZipPackageStream!\n" );
this->mbAllowRemoveOnInsert = bAllowRemoveOnInsert;
SetFolder ( false );
aEntry.nVersion = -1;
aEntry.nFlag = 0;
aEntry.nMethod = -1;
aEntry.nTime = -1;
aEntry.nCrc = -1;
aEntry.nCompressedSize = -1;
aEntry.nSize = -1;
aEntry.nOffset = -1;
CWS-TOOLING: integrate CWS encsig09 2009-09-14 15:11:29 +0200 oc r276125 : #i105049# MacroSignatur needs Macro 2009-09-09 17:09:46 +0200 jl r276005 : #i103989# could not signe encrypted doc containing a formular object 2009-09-09 13:11:24 +0200 jl r275985 : #i103989# could not signe encrypted doc containing a formular object 2009-09-08 15:54:02 +0200 mav r275934 : #i103906# fix the automation test scenario ( tempfile should be writable for the user ) 2009-09-07 14:01:39 +0200 mav r275895 : #i103906# fix the problem with reload 2009-09-07 09:34:48 +0200 mav r275871 : #i104786# do the ODF version check only for ODF documents 2009-09-07 08:19:06 +0200 mav r275870 : #i104389# fix text 2009-09-06 22:24:21 +0200 mav r275867 : #i104786# check the consistency of ODF version 2009-09-06 22:23:24 +0200 mav r275866 : #i104786# check the consistency of ODF version 2009-09-06 22:23:00 +0200 mav r275865 : #i104786# check the consistency of ODF version 2009-09-06 22:22:36 +0200 mav r275864 : #i104786# check the consistency of ODF version 2009-09-06 22:22:03 +0200 mav r275863 : #i104786# check the consistency of ODF version 2009-09-02 17:09:30 +0200 mav r275722 : #i104715# let repairing mechanics use the streams correctly 2009-09-01 16:52:49 +0200 mav r275670 : #i104389# notify user not to trust the corrupted document 2009-09-01 16:31:37 +0200 mav r275668 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:30:32 +0200 mav r275667 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:22:13 +0200 jl r275666 : #i104339# small content change 2009-09-01 14:20:42 +0200 jl r275660 : #i103519# remove some debug output 2009-09-01 13:51:52 +0200 jl r275659 : #i103519# NSS uses '\' for escaping in distinguished names 2009-09-01 12:49:47 +0200 mav r275655 : #i104389# use zip-mode to read from jar files 2009-09-01 12:40:22 +0200 mav r275653 : #i104389# use zip-mode to read from jar files 2009-09-01 12:32:29 +0200 mav r275652 : #i104389# use constants 2009-08-31 21:58:00 +0200 mav r275637 : #i10000# fix warning 2009-08-31 21:11:17 +0200 mav r275636 : #i104227# adding of scripting signature removes the document signature 2009-08-31 20:55:05 +0200 mav r275635 : #i103905# ZipStorage supports Compressed property 2009-08-31 20:53:55 +0200 mav r275634 : #i103905# adjust macro signature transfer to usage of ZipStorage 2009-08-31 15:30:49 +0200 jl r275609 : #i103989# warning is shown as long the user does not click 'OK' 2009-08-31 14:36:10 +0200 jl r275608 : #i103989# changed warning text when signing macro and there is a document signature. This warning is only displayed once 2009-08-31 13:34:41 +0200 mav r275603 : #i104452# disable macros in repaired documents 2009-08-31 13:33:42 +0200 mav r275602 : #i104452# disable macros in repaired documents 2009-08-31 13:03:56 +0200 jl r275600 : #i45212# signature dialog could not be started when using read-only documents 2009-08-31 09:26:13 +0200 mav r275583 : #i104578# store the additional entry as the last one to workaround parsing problem in OOo3.1 and later 2009-08-30 20:54:25 +0200 mav r275562 : #i10000# adopt for unix 2009-08-30 10:56:00 +0200 mav r275561 : CWS-TOOLING: rebase CWS encsig09 to trunk@275331 (milestone: DEV300:m56) 2009-08-28 16:34:00 +0200 mav r275539 : #i104578# write necessary info in manifest.xml for ODF1.2 encrypted document 2009-08-28 14:04:22 +0200 mav r275533 : #104587# fix handling of readonly streams 2009-08-28 13:58:10 +0200 mav r275531 : #i104389# fix the broken document handling 2009-08-28 11:40:39 +0200 mav r275522 : #i104389# fix the signature streams check 2009-08-27 21:48:12 +0200 mav r275509 : #i103927# show the warning 2009-08-27 21:47:48 +0200 mav r275508 : #i103927# show the warning 2009-08-27 16:45:59 +0200 jl r275495 : #i45212# remove unused variable 2009-08-27 16:34:00 +0200 jl r275494 : #i103989# 2009-08-27 13:54:28 +0200 jl r275482 : #i103519# fixed replacement of 'S' by 'ST' 2009-08-27 12:32:21 +0200 mav r275472 : #i10000# fix warning 2009-08-27 11:58:11 +0200 mav r275467 : #i104389# handle the entry path correctly 2009-08-26 17:18:35 +0200 jl r275438 : #i103519# subject and issuer distinguished names were not properly displayed. The strings were obtained by system functions (Windows, NSS), which use quotes to escape the values, when they contain special characters 2009-08-26 11:00:20 +0200 mav r275403 : #i10000# fix warnings 2009-08-26 08:25:45 +0200 mav r275392 : #i10000# fix warning 2009-08-26 08:02:22 +0200 mav r275391 : #i10000# adopt for linux 2009-08-26 07:40:30 +0200 mav r275390 : #i10000# fix warning 2009-08-26 07:35:28 +0200 mav r275389 : #i10000# use correct include file name 2009-08-25 15:01:41 +0200 jl r275356 : #i103989# better check for mimetype of streams 2009-08-25 09:07:09 +0200 mav r275335 : CWS-TOOLING: rebase CWS encsig09 to trunk@274622 (milestone: DEV300:m54) 2009-08-24 18:17:02 +0200 mav r275329 : #i103927# check the nonencrypted streams 2009-08-24 18:14:14 +0200 mav r275328 : #i103927# check the nonencrypted streams 2009-08-24 17:59:34 +0200 mav r275327 : #i103927#,#i104389# check the package consistency and nonencrypted streams 2009-08-24 16:18:28 +0200 jl r275323 : #i103989# added comment 2009-08-24 13:08:47 +0200 jl r275305 : #i45212# #i66276# only write the X509Certificate element once and allow to add remove several certificates at a time 2009-08-21 12:57:28 +0200 ufi r275239 : 104339 2009-08-21 08:39:05 +0200 jl r275213 : #i10398# comparing URIs of signed files with the 'element list' 2009-08-20 13:39:47 +0200 jl r275178 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:35:39 +0200 jl r275177 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:29:06 +0200 jl r275176 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:26:21 +0200 jl r275175 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 12:05:09 +0200 ufi r275170 : i104339 2009-08-19 12:24:54 +0200 jl r275146 : #i10398# displaying 'old signature' icon and status in signature dialog 2009-08-18 15:18:48 +0200 jl r275111 : #i103989# document signatures containing manifest.xml are now validated according to the final ODF1.2 spec 2009-08-18 11:41:06 +0200 mav r275087 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-18 11:35:13 +0200 mav r275085 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-14 17:32:41 +0200 jl r274999 : #i103989# using c14n tranformation for XML streams 2009-08-14 15:27:43 +0200 jl r274987 : #i103989# remove special handling for encrypted document streams in UriBindingHelper::OpenInputStream, since we use zip storage this is not necessary anymore 2009-08-14 15:08:10 +0200 jl r274983 : #i103989# Showing a message when adding or removing a macro signature, that the document signature will be removed 2009-08-14 14:57:27 +0200 jl r274982 : #i103989# accesing Sequence at invalid index 2009-08-11 08:55:02 +0200 mav r274846 : #i103905# let signing service know if there is already a valid document signature 2009-08-10 11:33:37 +0200 jl r274799 : #i103905# do not truncate the stream 2009-08-10 10:43:47 +0200 mav r274797 : #i103905# provide the storage version 2009-08-07 16:58:46 +0200 jl r274780 : #i103989# 2009-08-07 16:56:19 +0200 jl r274779 : #i103989# using odf version string etc. 2009-08-07 15:20:53 +0200 mav r274771 : #i103905# provide the storage version 2009-08-07 15:19:12 +0200 mav r274770 : #i103905# provide the storage version 2009-08-07 12:41:45 +0200 mav r274758 : #103930# do not store thumbnail in case of encrypted document 2009-08-07 12:36:52 +0200 mav r274757 : #i103905# provide the storage version 2009-08-07 12:15:54 +0200 mav r274754 : #i103760# the signed state is not lost on saving 2009-08-07 12:06:19 +0200 mav r274753 : #i103760# avoid warning regarding signature removal on export 2009-08-07 12:06:01 +0200 mav r274752 : #i103760# avoid warning regarding signature removal on export 2009-08-06 08:47:34 +0200 mav r274703 : #i103905# allow to transport ODF version to the signing component 2009-08-05 21:34:42 +0200 mav r274701 : #i103905# allow to transport ODF version to the signing component 2009-08-05 15:48:17 +0200 mav r274683 : #i103905# allow to transport ODF version to the signing component 2009-08-05 14:58:12 +0200 jl r274673 : #i103989# documentsignature now signes all streams except documentsignatures.xml, all streams are processed as binary files 2009-08-05 12:00:32 +0200 mav r274648 : #i103905# allow to transport ODF version to the signing component 2009-08-04 10:57:04 +0200 jl r274612 : #i103989# added XInitialization 2009-07-31 10:32:27 +0200 mav r274516 : #i103905# use zip storage to sign documents 2009-07-30 14:01:33 +0200 mav r274489 : #i103906# optimize the usage of temporary medium 2009-07-30 14:00:28 +0200 mav r274488 : #i103906# optimize the usage of temporary medium 2009-07-30 13:59:09 +0200 mav r274487 : #i103906# optimize the usage of temporary medium 2009-07-30 13:50:44 +0200 mav r274485 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:53 +0200 mav r274484 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:13 +0200 mav r274483 : #i103906# optimize the usage of temporary medium 2009-07-30 13:47:09 +0200 mav r274482 : #i103905#,#i103906# let the signing process use zip-storage; optimize the usage of temporary medium 2009-07-21 09:10:31 +0200 mav r274159 : CWS-TOOLING: rebase CWS encsig09 to trunk@273468 (milestone: DEV300:m51) 2009-05-05 08:39:01 +0200 mav r271496 : #i100832# allow to sign macros only when there are any
2009-09-17 13:53:54 +00:00
aEntry.nPathLen = -1;
aEntry.nExtraLen = -1;
}
ZipPackageStream::~ZipPackageStream( void )
{
}
2011-03-09 17:29:09 +01:00
void ZipPackageStream::setZipEntryOnLoading( const ZipEntry &rInEntry )
{
aEntry.nVersion = rInEntry.nVersion;
aEntry.nFlag = rInEntry.nFlag;
aEntry.nMethod = rInEntry.nMethod;
aEntry.nTime = rInEntry.nTime;
aEntry.nCrc = rInEntry.nCrc;
aEntry.nCompressedSize = rInEntry.nCompressedSize;
aEntry.nSize = rInEntry.nSize;
aEntry.nOffset = rInEntry.nOffset;
CWS-TOOLING: integrate CWS encsig09 2009-09-14 15:11:29 +0200 oc r276125 : #i105049# MacroSignatur needs Macro 2009-09-09 17:09:46 +0200 jl r276005 : #i103989# could not signe encrypted doc containing a formular object 2009-09-09 13:11:24 +0200 jl r275985 : #i103989# could not signe encrypted doc containing a formular object 2009-09-08 15:54:02 +0200 mav r275934 : #i103906# fix the automation test scenario ( tempfile should be writable for the user ) 2009-09-07 14:01:39 +0200 mav r275895 : #i103906# fix the problem with reload 2009-09-07 09:34:48 +0200 mav r275871 : #i104786# do the ODF version check only for ODF documents 2009-09-07 08:19:06 +0200 mav r275870 : #i104389# fix text 2009-09-06 22:24:21 +0200 mav r275867 : #i104786# check the consistency of ODF version 2009-09-06 22:23:24 +0200 mav r275866 : #i104786# check the consistency of ODF version 2009-09-06 22:23:00 +0200 mav r275865 : #i104786# check the consistency of ODF version 2009-09-06 22:22:36 +0200 mav r275864 : #i104786# check the consistency of ODF version 2009-09-06 22:22:03 +0200 mav r275863 : #i104786# check the consistency of ODF version 2009-09-02 17:09:30 +0200 mav r275722 : #i104715# let repairing mechanics use the streams correctly 2009-09-01 16:52:49 +0200 mav r275670 : #i104389# notify user not to trust the corrupted document 2009-09-01 16:31:37 +0200 mav r275668 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:30:32 +0200 mav r275667 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:22:13 +0200 jl r275666 : #i104339# small content change 2009-09-01 14:20:42 +0200 jl r275660 : #i103519# remove some debug output 2009-09-01 13:51:52 +0200 jl r275659 : #i103519# NSS uses '\' for escaping in distinguished names 2009-09-01 12:49:47 +0200 mav r275655 : #i104389# use zip-mode to read from jar files 2009-09-01 12:40:22 +0200 mav r275653 : #i104389# use zip-mode to read from jar files 2009-09-01 12:32:29 +0200 mav r275652 : #i104389# use constants 2009-08-31 21:58:00 +0200 mav r275637 : #i10000# fix warning 2009-08-31 21:11:17 +0200 mav r275636 : #i104227# adding of scripting signature removes the document signature 2009-08-31 20:55:05 +0200 mav r275635 : #i103905# ZipStorage supports Compressed property 2009-08-31 20:53:55 +0200 mav r275634 : #i103905# adjust macro signature transfer to usage of ZipStorage 2009-08-31 15:30:49 +0200 jl r275609 : #i103989# warning is shown as long the user does not click 'OK' 2009-08-31 14:36:10 +0200 jl r275608 : #i103989# changed warning text when signing macro and there is a document signature. This warning is only displayed once 2009-08-31 13:34:41 +0200 mav r275603 : #i104452# disable macros in repaired documents 2009-08-31 13:33:42 +0200 mav r275602 : #i104452# disable macros in repaired documents 2009-08-31 13:03:56 +0200 jl r275600 : #i45212# signature dialog could not be started when using read-only documents 2009-08-31 09:26:13 +0200 mav r275583 : #i104578# store the additional entry as the last one to workaround parsing problem in OOo3.1 and later 2009-08-30 20:54:25 +0200 mav r275562 : #i10000# adopt for unix 2009-08-30 10:56:00 +0200 mav r275561 : CWS-TOOLING: rebase CWS encsig09 to trunk@275331 (milestone: DEV300:m56) 2009-08-28 16:34:00 +0200 mav r275539 : #i104578# write necessary info in manifest.xml for ODF1.2 encrypted document 2009-08-28 14:04:22 +0200 mav r275533 : #104587# fix handling of readonly streams 2009-08-28 13:58:10 +0200 mav r275531 : #i104389# fix the broken document handling 2009-08-28 11:40:39 +0200 mav r275522 : #i104389# fix the signature streams check 2009-08-27 21:48:12 +0200 mav r275509 : #i103927# show the warning 2009-08-27 21:47:48 +0200 mav r275508 : #i103927# show the warning 2009-08-27 16:45:59 +0200 jl r275495 : #i45212# remove unused variable 2009-08-27 16:34:00 +0200 jl r275494 : #i103989# 2009-08-27 13:54:28 +0200 jl r275482 : #i103519# fixed replacement of 'S' by 'ST' 2009-08-27 12:32:21 +0200 mav r275472 : #i10000# fix warning 2009-08-27 11:58:11 +0200 mav r275467 : #i104389# handle the entry path correctly 2009-08-26 17:18:35 +0200 jl r275438 : #i103519# subject and issuer distinguished names were not properly displayed. The strings were obtained by system functions (Windows, NSS), which use quotes to escape the values, when they contain special characters 2009-08-26 11:00:20 +0200 mav r275403 : #i10000# fix warnings 2009-08-26 08:25:45 +0200 mav r275392 : #i10000# fix warning 2009-08-26 08:02:22 +0200 mav r275391 : #i10000# adopt for linux 2009-08-26 07:40:30 +0200 mav r275390 : #i10000# fix warning 2009-08-26 07:35:28 +0200 mav r275389 : #i10000# use correct include file name 2009-08-25 15:01:41 +0200 jl r275356 : #i103989# better check for mimetype of streams 2009-08-25 09:07:09 +0200 mav r275335 : CWS-TOOLING: rebase CWS encsig09 to trunk@274622 (milestone: DEV300:m54) 2009-08-24 18:17:02 +0200 mav r275329 : #i103927# check the nonencrypted streams 2009-08-24 18:14:14 +0200 mav r275328 : #i103927# check the nonencrypted streams 2009-08-24 17:59:34 +0200 mav r275327 : #i103927#,#i104389# check the package consistency and nonencrypted streams 2009-08-24 16:18:28 +0200 jl r275323 : #i103989# added comment 2009-08-24 13:08:47 +0200 jl r275305 : #i45212# #i66276# only write the X509Certificate element once and allow to add remove several certificates at a time 2009-08-21 12:57:28 +0200 ufi r275239 : 104339 2009-08-21 08:39:05 +0200 jl r275213 : #i10398# comparing URIs of signed files with the 'element list' 2009-08-20 13:39:47 +0200 jl r275178 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:35:39 +0200 jl r275177 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:29:06 +0200 jl r275176 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:26:21 +0200 jl r275175 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 12:05:09 +0200 ufi r275170 : i104339 2009-08-19 12:24:54 +0200 jl r275146 : #i10398# displaying 'old signature' icon and status in signature dialog 2009-08-18 15:18:48 +0200 jl r275111 : #i103989# document signatures containing manifest.xml are now validated according to the final ODF1.2 spec 2009-08-18 11:41:06 +0200 mav r275087 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-18 11:35:13 +0200 mav r275085 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-14 17:32:41 +0200 jl r274999 : #i103989# using c14n tranformation for XML streams 2009-08-14 15:27:43 +0200 jl r274987 : #i103989# remove special handling for encrypted document streams in UriBindingHelper::OpenInputStream, since we use zip storage this is not necessary anymore 2009-08-14 15:08:10 +0200 jl r274983 : #i103989# Showing a message when adding or removing a macro signature, that the document signature will be removed 2009-08-14 14:57:27 +0200 jl r274982 : #i103989# accesing Sequence at invalid index 2009-08-11 08:55:02 +0200 mav r274846 : #i103905# let signing service know if there is already a valid document signature 2009-08-10 11:33:37 +0200 jl r274799 : #i103905# do not truncate the stream 2009-08-10 10:43:47 +0200 mav r274797 : #i103905# provide the storage version 2009-08-07 16:58:46 +0200 jl r274780 : #i103989# 2009-08-07 16:56:19 +0200 jl r274779 : #i103989# using odf version string etc. 2009-08-07 15:20:53 +0200 mav r274771 : #i103905# provide the storage version 2009-08-07 15:19:12 +0200 mav r274770 : #i103905# provide the storage version 2009-08-07 12:41:45 +0200 mav r274758 : #103930# do not store thumbnail in case of encrypted document 2009-08-07 12:36:52 +0200 mav r274757 : #i103905# provide the storage version 2009-08-07 12:15:54 +0200 mav r274754 : #i103760# the signed state is not lost on saving 2009-08-07 12:06:19 +0200 mav r274753 : #i103760# avoid warning regarding signature removal on export 2009-08-07 12:06:01 +0200 mav r274752 : #i103760# avoid warning regarding signature removal on export 2009-08-06 08:47:34 +0200 mav r274703 : #i103905# allow to transport ODF version to the signing component 2009-08-05 21:34:42 +0200 mav r274701 : #i103905# allow to transport ODF version to the signing component 2009-08-05 15:48:17 +0200 mav r274683 : #i103905# allow to transport ODF version to the signing component 2009-08-05 14:58:12 +0200 jl r274673 : #i103989# documentsignature now signes all streams except documentsignatures.xml, all streams are processed as binary files 2009-08-05 12:00:32 +0200 mav r274648 : #i103905# allow to transport ODF version to the signing component 2009-08-04 10:57:04 +0200 jl r274612 : #i103989# added XInitialization 2009-07-31 10:32:27 +0200 mav r274516 : #i103905# use zip storage to sign documents 2009-07-30 14:01:33 +0200 mav r274489 : #i103906# optimize the usage of temporary medium 2009-07-30 14:00:28 +0200 mav r274488 : #i103906# optimize the usage of temporary medium 2009-07-30 13:59:09 +0200 mav r274487 : #i103906# optimize the usage of temporary medium 2009-07-30 13:50:44 +0200 mav r274485 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:53 +0200 mav r274484 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:13 +0200 mav r274483 : #i103906# optimize the usage of temporary medium 2009-07-30 13:47:09 +0200 mav r274482 : #i103905#,#i103906# let the signing process use zip-storage; optimize the usage of temporary medium 2009-07-21 09:10:31 +0200 mav r274159 : CWS-TOOLING: rebase CWS encsig09 to trunk@273468 (milestone: DEV300:m51) 2009-05-05 08:39:01 +0200 mav r271496 : #i100832# allow to sign macros only when there are any
2009-09-17 13:53:54 +00:00
aEntry.sPath = rInEntry.sPath;
aEntry.nPathLen = rInEntry.nPathLen;
aEntry.nExtraLen = rInEntry.nExtraLen;
if ( aEntry.nMethod == STORED )
bToBeCompressed = false;
}
void ZipPackageStream::CloseOwnStreamIfAny()
{
if ( xStream.is() )
{
xStream->closeInput();
xStream = uno::Reference< io::XInputStream >();
m_bHasSeekable = false;
}
}
uno::Reference< io::XInputStream > ZipPackageStream::GetOwnSeekStream()
{
if ( !m_bHasSeekable && xStream.is() )
{
// The package component requires that every stream either be FROM a package or it must support XSeekable!
// The only exception is a nonseekable stream that is provided only for storing, if such a stream
// is accessed before commit it MUST be wrapped.
// Wrap the stream in case it is not seekable
xStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( xStream, m_xContext );
2011-03-09 17:29:09 +01:00
uno::Reference< io::XSeekable > xSeek( xStream, UNO_QUERY );
if ( !xSeek.is() )
throw RuntimeException( THROW_WHERE "The stream must support XSeekable!" );
m_bHasSeekable = true;
}
return xStream;
}
uno::Reference< io::XInputStream > ZipPackageStream::GetRawEncrStreamNoHeaderCopy()
{
if ( m_nStreamMode != PACKAGE_STREAM_RAW || !GetOwnSeekStream().is() )
throw io::IOException(THROW_WHERE );
2011-03-09 17:29:09 +01:00
if ( m_xBaseEncryptionData.is() )
throw ZipIOException(THROW_WHERE "Encrypted stream without encryption data!" );
uno::Reference< io::XSeekable > xSeek( GetOwnSeekStream(), UNO_QUERY );
if ( !xSeek.is() )
throw ZipIOException(THROW_WHERE "The stream must be seekable!" );
// skip header
2011-03-09 17:29:09 +01:00
xSeek->seek( n_ConstHeaderSize + getInitialisationVector().getLength() +
getSalt().getLength() + getDigest().getLength() );
// create temporary stream
uno::Reference < io::XTempFile > xTempFile = io::TempFile::create(m_xContext);
uno::Reference < io::XOutputStream > xTempOut = xTempFile->getOutputStream();
uno::Reference < io::XInputStream > xTempIn = xTempFile->getInputStream();;
uno::Reference < io::XSeekable > xTempSeek( xTempOut, UNO_QUERY_THROW );
// copy the raw stream to the temporary file starting from the current position
::comphelper::OStorageHelper::CopyInputToOutput( GetOwnSeekStream(), xTempOut );
xTempOut->closeOutput();
xTempSeek->seek( 0 );
return xTempIn;
}
sal_Int32 ZipPackageStream::GetEncryptionAlgorithm() const
{
return m_nImportedEncryptionAlgorithm ? m_nImportedEncryptionAlgorithm : rZipPackage.GetEncAlgID();
}
sal_Int32 ZipPackageStream::GetBlockSize() const
{
return GetEncryptionAlgorithm() == ::com::sun::star::xml::crypto::CipherID::AES_CBC_W3C_PADDING ? 16 : 8;
}
2011-03-09 17:29:09 +01:00
::rtl::Reference< EncryptionData > ZipPackageStream::GetEncryptionData( bool bUseWinEncoding )
{
2011-03-09 17:29:09 +01:00
::rtl::Reference< EncryptionData > xResult;
if ( m_xBaseEncryptionData.is() )
xResult = new EncryptionData(
*m_xBaseEncryptionData,
GetEncryptionKey( bUseWinEncoding ),
GetEncryptionAlgorithm(),
2011-03-09 17:29:09 +01:00
m_nImportedChecksumAlgorithm ? m_nImportedChecksumAlgorithm : rZipPackage.GetChecksumAlgID(),
m_nImportedDerivedKeySize ? m_nImportedDerivedKeySize : rZipPackage.GetDefaultDerivedKeySize(),
GetStartKeyGenID() );
2011-03-09 17:29:09 +01:00
return xResult;
}
uno::Sequence< sal_Int8 > ZipPackageStream::GetEncryptionKey( bool bUseWinEncoding )
{
uno::Sequence< sal_Int8 > aResult;
sal_Int32 nKeyGenID = GetStartKeyGenID();
2011-03-09 17:29:09 +01:00
bUseWinEncoding = ( bUseWinEncoding || m_bUseWinEncoding );
if ( bHaveOwnKey && m_aStorageEncryptionKeys.getLength() )
{
OUString aNameToFind;
2011-03-09 17:29:09 +01:00
if ( nKeyGenID == xml::crypto::DigestID::SHA256 )
aNameToFind = PACKAGE_ENCRYPTIONDATA_SHA256UTF8;
else if ( nKeyGenID == xml::crypto::DigestID::SHA1 )
{
aNameToFind = bUseWinEncoding ? PACKAGE_ENCRYPTIONDATA_SHA1MS1252 : PACKAGE_ENCRYPTIONDATA_SHA1UTF8;
}
else
throw uno::RuntimeException(THROW_WHERE "No expected key is provided!" );
2011-03-09 17:29:09 +01:00
for ( sal_Int32 nInd = 0; nInd < m_aStorageEncryptionKeys.getLength(); nInd++ )
if ( m_aStorageEncryptionKeys[nInd].Name.equals( aNameToFind ) )
m_aStorageEncryptionKeys[nInd].Value >>= aResult;
// empty keys are not allowed here
// so it is not important whether there is no key, or the key is empty, it is an error
if ( !aResult.getLength() )
throw uno::RuntimeException(THROW_WHERE "No expected key is provided!" );
2011-03-09 17:29:09 +01:00
}
else
aResult = m_aEncryptionKey;
if ( !aResult.getLength() || !bHaveOwnKey )
aResult = rZipPackage.GetEncryptionKey();
return aResult;
}
sal_Int32 ZipPackageStream::GetStartKeyGenID()
2011-03-17 09:16:41 +01:00
{
// generally should all the streams use the same Start Key
// but if raw copy without password takes place, we should preserve the imported algorithm
return m_nImportedStartKeyAlgorithm ? m_nImportedStartKeyAlgorithm : rZipPackage.GetStartKeyGenID();
2011-03-17 09:16:41 +01:00
}
uno::Reference< io::XInputStream > ZipPackageStream::TryToGetRawFromDataStream( bool bAddHeaderForEncr )
2011-03-09 17:29:09 +01:00
{
if ( m_nStreamMode != PACKAGE_STREAM_DATA || !GetOwnSeekStream().is() || ( bAddHeaderForEncr && !bToBeEncrypted ) )
throw packages::NoEncryptionException(THROW_WHERE );
Sequence< sal_Int8 > aKey;
if ( bToBeEncrypted )
{
2011-03-09 17:29:09 +01:00
aKey = GetEncryptionKey();
if ( !aKey.getLength() )
throw packages::NoEncryptionException(THROW_WHERE );
}
try
{
// create temporary file
uno::Reference < io::XStream > xTempStream(
io::TempFile::create(m_xContext),
uno::UNO_QUERY_THROW );
// create a package based on it
ZipPackage* pPackage = new ZipPackage( m_xContext );
2011-03-09 17:29:09 +01:00
uno::Reference< XSingleServiceFactory > xPackageAsFactory( static_cast< XSingleServiceFactory* >( pPackage ) );
if ( !xPackageAsFactory.is() )
throw RuntimeException(THROW_WHERE );
Sequence< Any > aArgs( 1 );
aArgs[0] <<= xTempStream;
pPackage->initialize( aArgs );
// create a new package stream
2011-03-09 17:29:09 +01:00
uno::Reference< XDataSinkEncrSupport > xNewPackStream( xPackageAsFactory->createInstance(), UNO_QUERY );
if ( !xNewPackStream.is() )
throw RuntimeException(THROW_WHERE );
xNewPackStream->setDataStream( static_cast< io::XInputStream* >(
CWS-TOOLING: integrate CWS dba32f 2009-08-31 10:43:51 +0200 msc r275590 : #no issuezilla available# make the testcase more error proof 2009-08-31 10:43:28 +0200 msc r275589 : #no issuezilla available# make the testcase more error proof 2009-08-31 10:40:33 +0200 msc r275588 : i85993 remove bugid 2009-08-31 10:38:28 +0200 msc r275587 : i100000 2009-08-27 13:27:32 +0200 fs r275476 : #i103882# 2009-08-27 12:47:54 +0200 fs r275474 : #i104544# do not allow re-entrance for impl_ensureControl_nothrow Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from the grid control implementation), but to ensure it won't happen, again, I added some safety herein. 2009-08-27 12:47:16 +0200 fs r275473 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble 2009-08-27 10:18:05 +0200 mav r275461 : #i103266# do not allow any stream operation on package streams while commiting the package 2009-08-20 15:25:48 +0200 fs r275184 : #i104362# fall back to a ViewObjectContactOfSdrObj in case we don't have a page view 2009-08-20 15:25:06 +0200 fs r275183 : AUGMENT_LIBRARY_PATH 2009-08-20 15:10:34 +0200 fs r275182 : AUGMENT_LIBRARY_PATH 2009-08-20 09:50:36 +0200 oj r275167 : #i104266# notify propertyforward when new dest was created 2009-08-19 08:01:28 +0200 mav r275133 : #i103266# fix the typo 2009-08-18 22:45:34 +0200 fs r275131 : #i10000# 2009-08-18 13:53:07 +0200 oj r275105 : #i104266# set column settings after alter columns 2009-08-18 13:41:49 +0200 fs r275103 : #i102550# do not interpret names of existing data sources as system path 2009-08-18 13:13:05 +0200 oj r275097 : #i103882# use correct number Format 2009-08-18 12:59:13 +0200 fs r275094 : #i104181# 2009-08-18 09:07:48 +0200 fs r275079 : updated readme to refer to proper 1.1.14 2009-08-18 08:32:31 +0200 oj r275077 : #i104187# wrong default for FirstCellAsLabel corrected 2009-08-18 08:10:00 +0200 oj r275076 : #i104187# dispose status controller to avoid access of dead statusBar in sfx 2009-08-17 21:56:19 +0200 fs r275074 : merge fix for issue #102564# from dba32e 2009-08-17 15:34:40 +0200 fs r275058 : don't set MaxFieldSize to 0 unconditionally 2009-08-17 14:33:57 +0200 oj r275054 : #i103528# patch for bitxtor 2009-08-17 14:12:26 +0200 oj r275051 : #i104160# fix VerticalAlignment 2009-08-17 14:11:47 +0200 oj r275050 : #i104160# fix VerticalAlignment 2009-08-14 15:54:04 +0200 mav r274989 : #i103266# avoid possibility for race condition 2009-08-13 13:52:43 +0200 fs r274939 : improved diagnostics 2009-08-13 13:52:28 +0200 fs r274938 : typo 2009-08-13 12:51:03 +0200 fs r274934 : #i103763# provided by cloph: correct libIDL check when compiling Mozilla 2009-08-13 12:43:23 +0200 fs r274933 : #i103763# provided by cloph: allow to cross-compile prebuilt zips on Mac 2009-08-13 12:41:15 +0200 fs r274932 : #i103371# fire PREPARECLOSEDOC even for embedded objects (why not?) 2009-08-13 12:24:49 +0200 fs r274930 : #i99890# remove 'Insert Control' from the popup menu 2009-08-13 12:23:38 +0200 fs r274929 : #i99890# DoToolboxAction: assert unknown/unimplemented actions 2009-08-13 09:32:07 +0200 fs r274923 : #i103721# 2009-08-13 09:26:32 +0200 fs r274922 : #i99894# provided by dtardon: xforms_nowFunction: use proper memory allocation function 2009-08-13 09:20:21 +0200 fs r274921 : #i103938# provided by cmc: pass proper arguments to OUString::intern 2009-08-12 22:34:28 +0200 fs r274916 : #i104139# when executing a PopupMenu, pass the POPUPMENU_NOMOUSEUPCLOSE flag
2009-09-08 08:54:47 +00:00
new WrapStreamForShare( GetOwnSeekStream(), rZipPackage.GetSharedMutexRef() ) ) );
2011-03-09 17:29:09 +01:00
uno::Reference< XPropertySet > xNewPSProps( xNewPackStream, UNO_QUERY );
if ( !xNewPSProps.is() )
throw RuntimeException(THROW_WHERE );
// copy all the properties of this stream to the new stream
xNewPSProps->setPropertyValue("MediaType", makeAny( msMediaType ) );
xNewPSProps->setPropertyValue("Compressed", makeAny( bToBeCompressed ) );
if ( bToBeEncrypted )
{
xNewPSProps->setPropertyValue(ENCRYPTION_KEY_PROPERTY, makeAny( aKey ) );
xNewPSProps->setPropertyValue("Encrypted", makeAny( true ) );
}
// insert a new stream in the package
2011-03-09 17:29:09 +01:00
uno::Reference< XUnoTunnel > xTunnel;
Any aRoot = pPackage->getByHierarchicalName("/");
aRoot >>= xTunnel;
2011-03-09 17:29:09 +01:00
uno::Reference< container::XNameContainer > xRootNameContainer( xTunnel, UNO_QUERY );
if ( !xRootNameContainer.is() )
throw RuntimeException(THROW_WHERE );
2011-03-09 17:29:09 +01:00
uno::Reference< XUnoTunnel > xNPSTunnel( xNewPackStream, UNO_QUERY );
xRootNameContainer->insertByName("dummy", makeAny( xNPSTunnel ) );
// commit the temporary package
pPackage->commitChanges();
// get raw stream from the temporary package
2011-03-09 17:29:09 +01:00
uno::Reference< io::XInputStream > xInRaw;
if ( bAddHeaderForEncr )
xInRaw = xNewPackStream->getRawStream();
else
xInRaw = xNewPackStream->getPlainRawStream();
// create another temporary file
uno::Reference < io::XOutputStream > xTempOut(
io::TempFile::create(m_xContext),
uno::UNO_QUERY_THROW );
uno::Reference < io::XInputStream > xTempIn( xTempOut, UNO_QUERY_THROW );
uno::Reference < io::XSeekable > xTempSeek( xTempOut, UNO_QUERY_THROW );
// copy the raw stream to the temporary file
::comphelper::OStorageHelper::CopyInputToOutput( xInRaw, xTempOut );
xTempOut->closeOutput();
xTempSeek->seek( 0 );
// close raw stream, package stream and folder
2011-03-09 17:29:09 +01:00
xInRaw = uno::Reference< io::XInputStream >();
xNewPSProps = uno::Reference< XPropertySet >();
xNPSTunnel = uno::Reference< XUnoTunnel >();
xNewPackStream = uno::Reference< XDataSinkEncrSupport >();
xTunnel = uno::Reference< XUnoTunnel >();
xRootNameContainer = uno::Reference< container::XNameContainer >();
// return the stream representing the first temporary file
return xTempIn;
}
catch ( RuntimeException& )
{
throw;
}
catch ( Exception& )
{
}
throw io::IOException(THROW_WHERE );
}
bool ZipPackageStream::ParsePackageRawStream()
{
OSL_ENSURE( GetOwnSeekStream().is(), "A stream must be provided!\n" );
if ( !GetOwnSeekStream().is() )
return false;
bool bOk = false;
2011-03-09 17:29:09 +01:00
::rtl::Reference< BaseEncryptionData > xTempEncrData;
sal_Int32 nMagHackSize = 0;
Sequence < sal_Int8 > aHeader ( 4 );
try
{
if ( GetOwnSeekStream()->readBytes ( aHeader, 4 ) == 4 )
{
const sal_Int8 *pHeader = aHeader.getConstArray();
sal_uInt32 nHeader = ( pHeader [0] & 0xFF ) |
( pHeader [1] & 0xFF ) << 8 |
( pHeader [2] & 0xFF ) << 16 |
( pHeader [3] & 0xFF ) << 24;
if ( nHeader == n_ConstHeader )
{
// this is one of our god-awful, but extremely devious hacks, everyone cheer
2011-03-09 17:29:09 +01:00
xTempEncrData = new BaseEncryptionData;
OUString aMediaType;
2011-03-09 17:29:09 +01:00
sal_Int32 nEncAlgorithm = 0;
sal_Int32 nChecksumAlgorithm = 0;
sal_Int32 nDerivedKeySize = 0;
sal_Int32 nStartKeyGenID = 0;
if ( ZipFile::StaticFillData( xTempEncrData, nEncAlgorithm, nChecksumAlgorithm, nDerivedKeySize, nStartKeyGenID, nMagHackSize, aMediaType, GetOwnSeekStream() ) )
{
// We'll want to skip the data we've just read, so calculate how much we just read
// and remember it
2011-03-09 17:29:09 +01:00
m_nMagicalHackPos = n_ConstHeaderSize + xTempEncrData->m_aSalt.getLength()
+ xTempEncrData->m_aInitVector.getLength()
+ xTempEncrData->m_aDigest.getLength()
+ aMediaType.getLength() * sizeof( sal_Unicode );
2011-03-09 17:29:09 +01:00
m_nImportedEncryptionAlgorithm = nEncAlgorithm;
m_nImportedChecksumAlgorithm = nChecksumAlgorithm;
m_nImportedDerivedKeySize = nDerivedKeySize;
m_nImportedStartKeyAlgorithm = nStartKeyGenID;
m_nMagicalHackSize = nMagHackSize;
msMediaType = aMediaType;
bOk = true;
}
}
}
}
catch( Exception& )
{
}
if ( !bOk )
{
// the provided stream is not a raw stream
return false;
}
2011-03-09 17:29:09 +01:00
m_xBaseEncryptionData = xTempEncrData;
SetIsEncrypted ( true );
// it's already compressed and encrypted
bToBeEncrypted = bToBeCompressed = false;
return true;
}
void ZipPackageStream::SetPackageMember( bool bNewValue )
{
if ( bNewValue )
{
m_nStreamMode = PACKAGE_STREAM_PACKAGEMEMBER;
m_nMagicalHackPos = 0;
m_nMagicalHackSize = 0;
}
else if ( m_nStreamMode == PACKAGE_STREAM_PACKAGEMEMBER )
m_nStreamMode = PACKAGE_STREAM_NOTSET; // must be reset
}
// XActiveDataSink
2011-03-09 17:29:09 +01:00
void SAL_CALL ZipPackageStream::setInputStream( const uno::Reference< io::XInputStream >& aStream )
throw( RuntimeException, std::exception )
{
// if seekable access is required the wrapping will be done on demand
xStream = aStream;
2011-03-09 17:29:09 +01:00
m_nImportedEncryptionAlgorithm = 0;
m_bHasSeekable = false;
SetPackageMember ( false );
2000-11-28 15:49:34 +00:00
aEntry.nTime = -1;
m_nStreamMode = PACKAGE_STREAM_DETECT;
}
2011-03-09 17:29:09 +01:00
uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawData()
throw( RuntimeException )
{
try
{
2011-03-09 17:29:09 +01:00
if ( IsPackageMember() )
{
2011-03-09 17:29:09 +01:00
return rZipPackage.getZipFile().getRawData( aEntry, GetEncryptionData(), bIsEncrypted, rZipPackage.GetSharedMutexRef() );
}
else if ( GetOwnSeekStream().is() )
{
CWS-TOOLING: integrate CWS dba32f 2009-08-31 10:43:51 +0200 msc r275590 : #no issuezilla available# make the testcase more error proof 2009-08-31 10:43:28 +0200 msc r275589 : #no issuezilla available# make the testcase more error proof 2009-08-31 10:40:33 +0200 msc r275588 : i85993 remove bugid 2009-08-31 10:38:28 +0200 msc r275587 : i100000 2009-08-27 13:27:32 +0200 fs r275476 : #i103882# 2009-08-27 12:47:54 +0200 fs r275474 : #i104544# do not allow re-entrance for impl_ensureControl_nothrow Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from the grid control implementation), but to ensure it won't happen, again, I added some safety herein. 2009-08-27 12:47:16 +0200 fs r275473 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble 2009-08-27 10:18:05 +0200 mav r275461 : #i103266# do not allow any stream operation on package streams while commiting the package 2009-08-20 15:25:48 +0200 fs r275184 : #i104362# fall back to a ViewObjectContactOfSdrObj in case we don't have a page view 2009-08-20 15:25:06 +0200 fs r275183 : AUGMENT_LIBRARY_PATH 2009-08-20 15:10:34 +0200 fs r275182 : AUGMENT_LIBRARY_PATH 2009-08-20 09:50:36 +0200 oj r275167 : #i104266# notify propertyforward when new dest was created 2009-08-19 08:01:28 +0200 mav r275133 : #i103266# fix the typo 2009-08-18 22:45:34 +0200 fs r275131 : #i10000# 2009-08-18 13:53:07 +0200 oj r275105 : #i104266# set column settings after alter columns 2009-08-18 13:41:49 +0200 fs r275103 : #i102550# do not interpret names of existing data sources as system path 2009-08-18 13:13:05 +0200 oj r275097 : #i103882# use correct number Format 2009-08-18 12:59:13 +0200 fs r275094 : #i104181# 2009-08-18 09:07:48 +0200 fs r275079 : updated readme to refer to proper 1.1.14 2009-08-18 08:32:31 +0200 oj r275077 : #i104187# wrong default for FirstCellAsLabel corrected 2009-08-18 08:10:00 +0200 oj r275076 : #i104187# dispose status controller to avoid access of dead statusBar in sfx 2009-08-17 21:56:19 +0200 fs r275074 : merge fix for issue #102564# from dba32e 2009-08-17 15:34:40 +0200 fs r275058 : don't set MaxFieldSize to 0 unconditionally 2009-08-17 14:33:57 +0200 oj r275054 : #i103528# patch for bitxtor 2009-08-17 14:12:26 +0200 oj r275051 : #i104160# fix VerticalAlignment 2009-08-17 14:11:47 +0200 oj r275050 : #i104160# fix VerticalAlignment 2009-08-14 15:54:04 +0200 mav r274989 : #i103266# avoid possibility for race condition 2009-08-13 13:52:43 +0200 fs r274939 : improved diagnostics 2009-08-13 13:52:28 +0200 fs r274938 : typo 2009-08-13 12:51:03 +0200 fs r274934 : #i103763# provided by cloph: correct libIDL check when compiling Mozilla 2009-08-13 12:43:23 +0200 fs r274933 : #i103763# provided by cloph: allow to cross-compile prebuilt zips on Mac 2009-08-13 12:41:15 +0200 fs r274932 : #i103371# fire PREPARECLOSEDOC even for embedded objects (why not?) 2009-08-13 12:24:49 +0200 fs r274930 : #i99890# remove 'Insert Control' from the popup menu 2009-08-13 12:23:38 +0200 fs r274929 : #i99890# DoToolboxAction: assert unknown/unimplemented actions 2009-08-13 09:32:07 +0200 fs r274923 : #i103721# 2009-08-13 09:26:32 +0200 fs r274922 : #i99894# provided by dtardon: xforms_nowFunction: use proper memory allocation function 2009-08-13 09:20:21 +0200 fs r274921 : #i103938# provided by cmc: pass proper arguments to OUString::intern 2009-08-12 22:34:28 +0200 fs r274916 : #i104139# when executing a PopupMenu, pass the POPUPMENU_NOMOUSEUPCLOSE flag
2009-09-08 08:54:47 +00:00
return new WrapStreamForShare( GetOwnSeekStream(), rZipPackage.GetSharedMutexRef() );
}
else
2011-03-09 17:29:09 +01:00
return uno::Reference < io::XInputStream > ();
}
2011-03-09 17:29:09 +01:00
catch ( ZipException & )//rException )
{
Merge commit 'ooo/DEV300_m106' into libreoffice-3-4 Conflicts: extensions/source/svg/svgaction.cxx extensions/source/svg/svgaction.hxx extensions/source/svg/svgcom.hxx extensions/source/svg/svgprinter.cxx extensions/source/svg/svgprinter.hxx extensions/source/svg/svguno.cxx extensions/source/svg/svgwriter.cxx extensions/source/svg/svgwriter.hxx javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/InstallationOngoingCtrl.java javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java package/inc/ZipFile.hxx package/inc/ZipOutputStream.hxx package/inc/ZipPackage.hxx package/inc/ZipPackageStream.hxx package/source/manifest/ManifestExport.cxx package/source/manifest/ManifestImport.cxx package/source/manifest/UnoRegister.cxx package/source/xstor/owriteablestream.cxx package/source/xstor/xstorage.cxx package/source/xstor/xstorage.hxx package/source/zipapi/EntryInputStream.cxx package/source/zipapi/EntryInputStream.hxx package/source/zipapi/XFileStream.cxx package/source/zipapi/XFileStream.hxx package/source/zipapi/XMemoryStream.cxx package/source/zipapi/XUnbufferedStream.cxx package/source/zipapi/XUnbufferedStream.hxx package/source/zipapi/ZipFile.cxx package/source/zipapi/ZipOutputStream.cxx package/source/zipapi/sha1context.hxx package/source/zippackage/ZipPackage.cxx package/source/zippackage/ZipPackageFolder.cxx package/source/zippackage/ZipPackageStream.cxx setup_native/source/win32/customactions/shellextensions/registerextensions.cxx wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java xmlsecurity/prj/build.lst xmlsecurity/source/helper/xmlsignaturehelper.cxx xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx
2011-04-22 15:08:05 +02:00
OSL_FAIL( "ZipException thrown" );//rException.Message);
2011-03-09 17:29:09 +01:00
return uno::Reference < io::XInputStream > ();
}
2011-03-09 17:29:09 +01:00
catch ( Exception & )
{
Merge commit 'ooo/DEV300_m106' into libreoffice-3-4 Conflicts: extensions/source/svg/svgaction.cxx extensions/source/svg/svgaction.hxx extensions/source/svg/svgcom.hxx extensions/source/svg/svgprinter.cxx extensions/source/svg/svgprinter.hxx extensions/source/svg/svguno.cxx extensions/source/svg/svgwriter.cxx extensions/source/svg/svgwriter.hxx javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/InstallationOngoingCtrl.java javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java package/inc/ZipFile.hxx package/inc/ZipOutputStream.hxx package/inc/ZipPackage.hxx package/inc/ZipPackageStream.hxx package/source/manifest/ManifestExport.cxx package/source/manifest/ManifestImport.cxx package/source/manifest/UnoRegister.cxx package/source/xstor/owriteablestream.cxx package/source/xstor/xstorage.cxx package/source/xstor/xstorage.hxx package/source/zipapi/EntryInputStream.cxx package/source/zipapi/EntryInputStream.hxx package/source/zipapi/XFileStream.cxx package/source/zipapi/XFileStream.hxx package/source/zipapi/XMemoryStream.cxx package/source/zipapi/XUnbufferedStream.cxx package/source/zipapi/XUnbufferedStream.hxx package/source/zipapi/ZipFile.cxx package/source/zipapi/ZipOutputStream.cxx package/source/zipapi/sha1context.hxx package/source/zippackage/ZipPackage.cxx package/source/zippackage/ZipPackageFolder.cxx package/source/zippackage/ZipPackageStream.cxx setup_native/source/win32/customactions/shellextensions/registerextensions.cxx wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java xmlsecurity/prj/build.lst xmlsecurity/source/helper/xmlsignaturehelper.cxx xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx
2011-04-22 15:08:05 +02:00
OSL_FAIL( "Exception is thrown during stream wrapping!\n" );
2011-03-09 17:29:09 +01:00
return uno::Reference < io::XInputStream > ();
}
}
2011-03-09 17:29:09 +01:00
uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getInputStream()
throw( RuntimeException, std::exception )
{
try
2000-12-04 10:30:09 +00:00
{
2011-03-09 17:29:09 +01:00
if ( IsPackageMember() )
2000-12-04 10:30:09 +00:00
{
2011-03-09 17:29:09 +01:00
return rZipPackage.getZipFile().getInputStream( aEntry, GetEncryptionData(), bIsEncrypted, rZipPackage.GetSharedMutexRef() );
2000-12-04 10:30:09 +00:00
}
else if ( GetOwnSeekStream().is() )
2000-12-04 10:30:09 +00:00
{
CWS-TOOLING: integrate CWS dba32f 2009-08-31 10:43:51 +0200 msc r275590 : #no issuezilla available# make the testcase more error proof 2009-08-31 10:43:28 +0200 msc r275589 : #no issuezilla available# make the testcase more error proof 2009-08-31 10:40:33 +0200 msc r275588 : i85993 remove bugid 2009-08-31 10:38:28 +0200 msc r275587 : i100000 2009-08-27 13:27:32 +0200 fs r275476 : #i103882# 2009-08-27 12:47:54 +0200 fs r275474 : #i104544# do not allow re-entrance for impl_ensureControl_nothrow Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from the grid control implementation), but to ensure it won't happen, again, I added some safety herein. 2009-08-27 12:47:16 +0200 fs r275473 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble 2009-08-27 10:18:05 +0200 mav r275461 : #i103266# do not allow any stream operation on package streams while commiting the package 2009-08-20 15:25:48 +0200 fs r275184 : #i104362# fall back to a ViewObjectContactOfSdrObj in case we don't have a page view 2009-08-20 15:25:06 +0200 fs r275183 : AUGMENT_LIBRARY_PATH 2009-08-20 15:10:34 +0200 fs r275182 : AUGMENT_LIBRARY_PATH 2009-08-20 09:50:36 +0200 oj r275167 : #i104266# notify propertyforward when new dest was created 2009-08-19 08:01:28 +0200 mav r275133 : #i103266# fix the typo 2009-08-18 22:45:34 +0200 fs r275131 : #i10000# 2009-08-18 13:53:07 +0200 oj r275105 : #i104266# set column settings after alter columns 2009-08-18 13:41:49 +0200 fs r275103 : #i102550# do not interpret names of existing data sources as system path 2009-08-18 13:13:05 +0200 oj r275097 : #i103882# use correct number Format 2009-08-18 12:59:13 +0200 fs r275094 : #i104181# 2009-08-18 09:07:48 +0200 fs r275079 : updated readme to refer to proper 1.1.14 2009-08-18 08:32:31 +0200 oj r275077 : #i104187# wrong default for FirstCellAsLabel corrected 2009-08-18 08:10:00 +0200 oj r275076 : #i104187# dispose status controller to avoid access of dead statusBar in sfx 2009-08-17 21:56:19 +0200 fs r275074 : merge fix for issue #102564# from dba32e 2009-08-17 15:34:40 +0200 fs r275058 : don't set MaxFieldSize to 0 unconditionally 2009-08-17 14:33:57 +0200 oj r275054 : #i103528# patch for bitxtor 2009-08-17 14:12:26 +0200 oj r275051 : #i104160# fix VerticalAlignment 2009-08-17 14:11:47 +0200 oj r275050 : #i104160# fix VerticalAlignment 2009-08-14 15:54:04 +0200 mav r274989 : #i103266# avoid possibility for race condition 2009-08-13 13:52:43 +0200 fs r274939 : improved diagnostics 2009-08-13 13:52:28 +0200 fs r274938 : typo 2009-08-13 12:51:03 +0200 fs r274934 : #i103763# provided by cloph: correct libIDL check when compiling Mozilla 2009-08-13 12:43:23 +0200 fs r274933 : #i103763# provided by cloph: allow to cross-compile prebuilt zips on Mac 2009-08-13 12:41:15 +0200 fs r274932 : #i103371# fire PREPARECLOSEDOC even for embedded objects (why not?) 2009-08-13 12:24:49 +0200 fs r274930 : #i99890# remove 'Insert Control' from the popup menu 2009-08-13 12:23:38 +0200 fs r274929 : #i99890# DoToolboxAction: assert unknown/unimplemented actions 2009-08-13 09:32:07 +0200 fs r274923 : #i103721# 2009-08-13 09:26:32 +0200 fs r274922 : #i99894# provided by dtardon: xforms_nowFunction: use proper memory allocation function 2009-08-13 09:20:21 +0200 fs r274921 : #i103938# provided by cmc: pass proper arguments to OUString::intern 2009-08-12 22:34:28 +0200 fs r274916 : #i104139# when executing a PopupMenu, pass the POPUPMENU_NOMOUSEUPCLOSE flag
2009-09-08 08:54:47 +00:00
return new WrapStreamForShare( GetOwnSeekStream(), rZipPackage.GetSharedMutexRef() );
2000-12-04 10:30:09 +00:00
}
else
2011-03-09 17:29:09 +01:00
return uno::Reference < io::XInputStream > ();
}
2011-03-09 17:29:09 +01:00
catch ( ZipException & )//rException )
{
Merge commit 'ooo/DEV300_m106' into libreoffice-3-4 Conflicts: extensions/source/svg/svgaction.cxx extensions/source/svg/svgaction.hxx extensions/source/svg/svgcom.hxx extensions/source/svg/svgprinter.cxx extensions/source/svg/svgprinter.hxx extensions/source/svg/svguno.cxx extensions/source/svg/svgwriter.cxx extensions/source/svg/svgwriter.hxx javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/InstallationOngoingCtrl.java javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java package/inc/ZipFile.hxx package/inc/ZipOutputStream.hxx package/inc/ZipPackage.hxx package/inc/ZipPackageStream.hxx package/source/manifest/ManifestExport.cxx package/source/manifest/ManifestImport.cxx package/source/manifest/UnoRegister.cxx package/source/xstor/owriteablestream.cxx package/source/xstor/xstorage.cxx package/source/xstor/xstorage.hxx package/source/zipapi/EntryInputStream.cxx package/source/zipapi/EntryInputStream.hxx package/source/zipapi/XFileStream.cxx package/source/zipapi/XFileStream.hxx package/source/zipapi/XMemoryStream.cxx package/source/zipapi/XUnbufferedStream.cxx package/source/zipapi/XUnbufferedStream.hxx package/source/zipapi/ZipFile.cxx package/source/zipapi/ZipOutputStream.cxx package/source/zipapi/sha1context.hxx package/source/zippackage/ZipPackage.cxx package/source/zippackage/ZipPackageFolder.cxx package/source/zippackage/ZipPackageStream.cxx setup_native/source/win32/customactions/shellextensions/registerextensions.cxx wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java xmlsecurity/prj/build.lst xmlsecurity/source/helper/xmlsignaturehelper.cxx xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx
2011-04-22 15:08:05 +02:00
OSL_FAIL( "ZipException thrown" );//rException.Message);
2011-03-09 17:29:09 +01:00
return uno::Reference < io::XInputStream > ();
}
catch ( Exception &ex )
{
Merge commit 'ooo/DEV300_m106' into libreoffice-3-4 Conflicts: extensions/source/svg/svgaction.cxx extensions/source/svg/svgaction.hxx extensions/source/svg/svgcom.hxx extensions/source/svg/svgprinter.cxx extensions/source/svg/svgprinter.hxx extensions/source/svg/svguno.cxx extensions/source/svg/svgwriter.cxx extensions/source/svg/svgwriter.hxx javainstaller2/src/JavaSetup/org/openoffice/setup/Controller/InstallationOngoingCtrl.java javainstaller2/src/JavaSetup/org/openoffice/setup/InstallData.java javainstaller2/src/JavaSetup/org/openoffice/setup/Installer/LinuxInstaller.java package/inc/ZipFile.hxx package/inc/ZipOutputStream.hxx package/inc/ZipPackage.hxx package/inc/ZipPackageStream.hxx package/source/manifest/ManifestExport.cxx package/source/manifest/ManifestImport.cxx package/source/manifest/UnoRegister.cxx package/source/xstor/owriteablestream.cxx package/source/xstor/xstorage.cxx package/source/xstor/xstorage.hxx package/source/zipapi/EntryInputStream.cxx package/source/zipapi/EntryInputStream.hxx package/source/zipapi/XFileStream.cxx package/source/zipapi/XFileStream.hxx package/source/zipapi/XMemoryStream.cxx package/source/zipapi/XUnbufferedStream.cxx package/source/zipapi/XUnbufferedStream.hxx package/source/zipapi/ZipFile.cxx package/source/zipapi/ZipOutputStream.cxx package/source/zipapi/sha1context.hxx package/source/zippackage/ZipPackage.cxx package/source/zippackage/ZipPackageFolder.cxx package/source/zippackage/ZipPackageStream.cxx setup_native/source/win32/customactions/shellextensions/registerextensions.cxx wizards/com/sun/star/wizards/letter/LetterWizardDialogImpl.java xmlsecurity/prj/build.lst xmlsecurity/source/helper/xmlsignaturehelper.cxx xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.cxx xmlsecurity/source/xmlsec/nss/seinitializer_nssimpl.hxx
2011-04-22 15:08:05 +02:00
OSL_FAIL( "Exception is thrown during stream wrapping!\n" );
OSL_FAIL(OUStringToOString(ex.Message, RTL_TEXTENCODING_UTF8).getStr());
2012-02-17 16:32:02 +00:00
(void)ex;
2011-03-09 17:29:09 +01:00
return uno::Reference < io::XInputStream > ();
2000-12-04 10:30:09 +00:00
}
}
// XDataSinkEncrSupport
2011-03-09 17:29:09 +01:00
uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getDataStream()
throw ( packages::WrongPasswordException,
io::IOException,
RuntimeException, std::exception )
{
// There is no stream attached to this object
if ( m_nStreamMode == PACKAGE_STREAM_NOTSET )
2011-03-09 17:29:09 +01:00
return uno::Reference< io::XInputStream >();
// this method can not be used together with old approach
if ( m_nStreamMode == PACKAGE_STREAM_DETECT )
throw packages::zip::ZipIOException(THROW_WHERE );
2011-03-09 17:29:09 +01:00
if ( IsPackageMember() )
{
2011-03-09 17:29:09 +01:00
uno::Reference< io::XInputStream > xResult;
try
{
xResult = rZipPackage.getZipFile().getDataStream( aEntry, GetEncryptionData(), bIsEncrypted, rZipPackage.GetSharedMutexRef() );
}
catch( const packages::WrongPasswordException& )
2011-03-09 17:29:09 +01:00
{
if ( rZipPackage.GetStartKeyGenID() == xml::crypto::DigestID::SHA1 )
2011-03-09 17:29:09 +01:00
{
try
{
// rhbz#1013844 / fdo#47482 workaround for the encrypted
// OpenOffice.org 1.0 documents generated by Libreoffice <=
// 3.6 with the new encryption format and using SHA256, but
// missing a specified startkey of SHA256
// force SHA256 and see if that works
m_nImportedStartKeyAlgorithm = xml::crypto::DigestID::SHA256;
xResult = rZipPackage.getZipFile().getDataStream( aEntry, GetEncryptionData(), bIsEncrypted, rZipPackage.GetSharedMutexRef() );
return xResult;
}
catch (const packages::WrongPasswordException&)
{
// if that didn't work, restore to SHA1 and trundle through the *other* earlier
// bug fix
m_nImportedStartKeyAlgorithm = xml::crypto::DigestID::SHA1;
}
// workaround for the encrypted documents generated with the old OOo1.x bug.
if ( !m_bUseWinEncoding )
{
xResult = rZipPackage.getZipFile().getDataStream( aEntry, GetEncryptionData( true ), bIsEncrypted, rZipPackage.GetSharedMutexRef() );
m_bUseWinEncoding = true;
}
else
throw;
2011-03-09 17:29:09 +01:00
}
else
throw;
}
return xResult;
}
else if ( m_nStreamMode == PACKAGE_STREAM_RAW )
return ZipFile::StaticGetDataFromRawStream( m_xContext, GetOwnSeekStream(), GetEncryptionData() );
else if ( GetOwnSeekStream().is() )
{
CWS-TOOLING: integrate CWS dba32f 2009-08-31 10:43:51 +0200 msc r275590 : #no issuezilla available# make the testcase more error proof 2009-08-31 10:43:28 +0200 msc r275589 : #no issuezilla available# make the testcase more error proof 2009-08-31 10:40:33 +0200 msc r275588 : i85993 remove bugid 2009-08-31 10:38:28 +0200 msc r275587 : i100000 2009-08-27 13:27:32 +0200 fs r275476 : #i103882# 2009-08-27 12:47:54 +0200 fs r275474 : #i104544# do not allow re-entrance for impl_ensureControl_nothrow Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from the grid control implementation), but to ensure it won't happen, again, I added some safety herein. 2009-08-27 12:47:16 +0200 fs r275473 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble 2009-08-27 10:18:05 +0200 mav r275461 : #i103266# do not allow any stream operation on package streams while commiting the package 2009-08-20 15:25:48 +0200 fs r275184 : #i104362# fall back to a ViewObjectContactOfSdrObj in case we don't have a page view 2009-08-20 15:25:06 +0200 fs r275183 : AUGMENT_LIBRARY_PATH 2009-08-20 15:10:34 +0200 fs r275182 : AUGMENT_LIBRARY_PATH 2009-08-20 09:50:36 +0200 oj r275167 : #i104266# notify propertyforward when new dest was created 2009-08-19 08:01:28 +0200 mav r275133 : #i103266# fix the typo 2009-08-18 22:45:34 +0200 fs r275131 : #i10000# 2009-08-18 13:53:07 +0200 oj r275105 : #i104266# set column settings after alter columns 2009-08-18 13:41:49 +0200 fs r275103 : #i102550# do not interpret names of existing data sources as system path 2009-08-18 13:13:05 +0200 oj r275097 : #i103882# use correct number Format 2009-08-18 12:59:13 +0200 fs r275094 : #i104181# 2009-08-18 09:07:48 +0200 fs r275079 : updated readme to refer to proper 1.1.14 2009-08-18 08:32:31 +0200 oj r275077 : #i104187# wrong default for FirstCellAsLabel corrected 2009-08-18 08:10:00 +0200 oj r275076 : #i104187# dispose status controller to avoid access of dead statusBar in sfx 2009-08-17 21:56:19 +0200 fs r275074 : merge fix for issue #102564# from dba32e 2009-08-17 15:34:40 +0200 fs r275058 : don't set MaxFieldSize to 0 unconditionally 2009-08-17 14:33:57 +0200 oj r275054 : #i103528# patch for bitxtor 2009-08-17 14:12:26 +0200 oj r275051 : #i104160# fix VerticalAlignment 2009-08-17 14:11:47 +0200 oj r275050 : #i104160# fix VerticalAlignment 2009-08-14 15:54:04 +0200 mav r274989 : #i103266# avoid possibility for race condition 2009-08-13 13:52:43 +0200 fs r274939 : improved diagnostics 2009-08-13 13:52:28 +0200 fs r274938 : typo 2009-08-13 12:51:03 +0200 fs r274934 : #i103763# provided by cloph: correct libIDL check when compiling Mozilla 2009-08-13 12:43:23 +0200 fs r274933 : #i103763# provided by cloph: allow to cross-compile prebuilt zips on Mac 2009-08-13 12:41:15 +0200 fs r274932 : #i103371# fire PREPARECLOSEDOC even for embedded objects (why not?) 2009-08-13 12:24:49 +0200 fs r274930 : #i99890# remove 'Insert Control' from the popup menu 2009-08-13 12:23:38 +0200 fs r274929 : #i99890# DoToolboxAction: assert unknown/unimplemented actions 2009-08-13 09:32:07 +0200 fs r274923 : #i103721# 2009-08-13 09:26:32 +0200 fs r274922 : #i99894# provided by dtardon: xforms_nowFunction: use proper memory allocation function 2009-08-13 09:20:21 +0200 fs r274921 : #i103938# provided by cmc: pass proper arguments to OUString::intern 2009-08-12 22:34:28 +0200 fs r274916 : #i104139# when executing a PopupMenu, pass the POPUPMENU_NOMOUSEUPCLOSE flag
2009-09-08 08:54:47 +00:00
return new WrapStreamForShare( GetOwnSeekStream(), rZipPackage.GetSharedMutexRef() );
}
else
return uno::Reference< io::XInputStream >();
}
2011-03-09 17:29:09 +01:00
uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getRawStream()
throw ( packages::NoEncryptionException,
io::IOException,
uno::RuntimeException, std::exception )
{
// There is no stream attached to this object
if ( m_nStreamMode == PACKAGE_STREAM_NOTSET )
2011-03-09 17:29:09 +01:00
return uno::Reference< io::XInputStream >();
// this method can not be used together with old approach
if ( m_nStreamMode == PACKAGE_STREAM_DETECT )
throw packages::zip::ZipIOException(THROW_WHERE );
2011-03-09 17:29:09 +01:00
if ( IsPackageMember() )
{
2011-03-09 17:29:09 +01:00
if ( !bIsEncrypted || !GetEncryptionData().is() )
throw packages::NoEncryptionException(THROW_WHERE );
return rZipPackage.getZipFile().getWrappedRawStream( aEntry, GetEncryptionData(), msMediaType, rZipPackage.GetSharedMutexRef() );
}
else if ( GetOwnSeekStream().is() )
{
if ( m_nStreamMode == PACKAGE_STREAM_RAW )
{
CWS-TOOLING: integrate CWS dba32f 2009-08-31 10:43:51 +0200 msc r275590 : #no issuezilla available# make the testcase more error proof 2009-08-31 10:43:28 +0200 msc r275589 : #no issuezilla available# make the testcase more error proof 2009-08-31 10:40:33 +0200 msc r275588 : i85993 remove bugid 2009-08-31 10:38:28 +0200 msc r275587 : i100000 2009-08-27 13:27:32 +0200 fs r275476 : #i103882# 2009-08-27 12:47:54 +0200 fs r275474 : #i104544# do not allow re-entrance for impl_ensureControl_nothrow Actually, this is part of the fix only. I also removed the code which triggered this re-entrance (from the grid control implementation), but to ensure it won't happen, again, I added some safety herein. 2009-08-27 12:47:16 +0200 fs r275473 : #i104544# SetState: Do not call Update at the window which we just set text for. It should (sic\!) not be needed, but causes trouble 2009-08-27 10:18:05 +0200 mav r275461 : #i103266# do not allow any stream operation on package streams while commiting the package 2009-08-20 15:25:48 +0200 fs r275184 : #i104362# fall back to a ViewObjectContactOfSdrObj in case we don't have a page view 2009-08-20 15:25:06 +0200 fs r275183 : AUGMENT_LIBRARY_PATH 2009-08-20 15:10:34 +0200 fs r275182 : AUGMENT_LIBRARY_PATH 2009-08-20 09:50:36 +0200 oj r275167 : #i104266# notify propertyforward when new dest was created 2009-08-19 08:01:28 +0200 mav r275133 : #i103266# fix the typo 2009-08-18 22:45:34 +0200 fs r275131 : #i10000# 2009-08-18 13:53:07 +0200 oj r275105 : #i104266# set column settings after alter columns 2009-08-18 13:41:49 +0200 fs r275103 : #i102550# do not interpret names of existing data sources as system path 2009-08-18 13:13:05 +0200 oj r275097 : #i103882# use correct number Format 2009-08-18 12:59:13 +0200 fs r275094 : #i104181# 2009-08-18 09:07:48 +0200 fs r275079 : updated readme to refer to proper 1.1.14 2009-08-18 08:32:31 +0200 oj r275077 : #i104187# wrong default for FirstCellAsLabel corrected 2009-08-18 08:10:00 +0200 oj r275076 : #i104187# dispose status controller to avoid access of dead statusBar in sfx 2009-08-17 21:56:19 +0200 fs r275074 : merge fix for issue #102564# from dba32e 2009-08-17 15:34:40 +0200 fs r275058 : don't set MaxFieldSize to 0 unconditionally 2009-08-17 14:33:57 +0200 oj r275054 : #i103528# patch for bitxtor 2009-08-17 14:12:26 +0200 oj r275051 : #i104160# fix VerticalAlignment 2009-08-17 14:11:47 +0200 oj r275050 : #i104160# fix VerticalAlignment 2009-08-14 15:54:04 +0200 mav r274989 : #i103266# avoid possibility for race condition 2009-08-13 13:52:43 +0200 fs r274939 : improved diagnostics 2009-08-13 13:52:28 +0200 fs r274938 : typo 2009-08-13 12:51:03 +0200 fs r274934 : #i103763# provided by cloph: correct libIDL check when compiling Mozilla 2009-08-13 12:43:23 +0200 fs r274933 : #i103763# provided by cloph: allow to cross-compile prebuilt zips on Mac 2009-08-13 12:41:15 +0200 fs r274932 : #i103371# fire PREPARECLOSEDOC even for embedded objects (why not?) 2009-08-13 12:24:49 +0200 fs r274930 : #i99890# remove 'Insert Control' from the popup menu 2009-08-13 12:23:38 +0200 fs r274929 : #i99890# DoToolboxAction: assert unknown/unimplemented actions 2009-08-13 09:32:07 +0200 fs r274923 : #i103721# 2009-08-13 09:26:32 +0200 fs r274922 : #i99894# provided by dtardon: xforms_nowFunction: use proper memory allocation function 2009-08-13 09:20:21 +0200 fs r274921 : #i103938# provided by cmc: pass proper arguments to OUString::intern 2009-08-12 22:34:28 +0200 fs r274916 : #i104139# when executing a PopupMenu, pass the POPUPMENU_NOMOUSEUPCLOSE flag
2009-09-08 08:54:47 +00:00
return new WrapStreamForShare( GetOwnSeekStream(), rZipPackage.GetSharedMutexRef() );
}
else if ( m_nStreamMode == PACKAGE_STREAM_DATA && bToBeEncrypted )
return TryToGetRawFromDataStream( true );
}
throw packages::NoEncryptionException(THROW_WHERE );
}
2011-03-09 17:29:09 +01:00
void SAL_CALL ZipPackageStream::setDataStream( const uno::Reference< io::XInputStream >& aStream )
throw ( io::IOException,
RuntimeException, std::exception )
{
setInputStream( aStream );
m_nStreamMode = PACKAGE_STREAM_DATA;
}
2011-03-09 17:29:09 +01:00
void SAL_CALL ZipPackageStream::setRawStream( const uno::Reference< io::XInputStream >& aStream )
throw ( packages::EncryptionNotAllowedException,
packages::NoRawFormatException,
io::IOException,
RuntimeException, std::exception )
{
// wrap the stream in case it is not seekable
uno::Reference< io::XInputStream > xNewStream = ::comphelper::OSeekableInputWrapper::CheckSeekableCanWrap( aStream, m_xContext );
2011-03-09 17:29:09 +01:00
uno::Reference< io::XSeekable > xSeek( xNewStream, UNO_QUERY );
if ( !xSeek.is() )
throw RuntimeException(THROW_WHERE "The stream must support XSeekable!" );
xSeek->seek( 0 );
2011-03-09 17:29:09 +01:00
uno::Reference< io::XInputStream > xOldStream = xStream;
xStream = xNewStream;
if ( !ParsePackageRawStream() )
{
xStream = xOldStream;
throw packages::NoRawFormatException(THROW_WHERE );
}
// the raw stream MUST have seekable access
m_bHasSeekable = true;
SetPackageMember ( false );
aEntry.nTime = -1;
m_nStreamMode = PACKAGE_STREAM_RAW;
}
uno::Reference< io::XInputStream > SAL_CALL ZipPackageStream::getPlainRawStream()
throw ( io::IOException,
uno::RuntimeException, std::exception )
{
// There is no stream attached to this object
if ( m_nStreamMode == PACKAGE_STREAM_NOTSET )
2011-03-09 17:29:09 +01:00
return uno::Reference< io::XInputStream >();
// this method can not be used together with old approach
if ( m_nStreamMode == PACKAGE_STREAM_DETECT )
throw packages::zip::ZipIOException(THROW_WHERE );
2011-03-09 17:29:09 +01:00
if ( IsPackageMember() )
{
2011-03-09 17:29:09 +01:00
return rZipPackage.getZipFile().getRawData( aEntry, GetEncryptionData(), bIsEncrypted, rZipPackage.GetSharedMutexRef() );
}
else if ( GetOwnSeekStream().is() )
{
if ( m_nStreamMode == PACKAGE_STREAM_RAW )
{
// the header should not be returned here
return GetRawEncrStreamNoHeaderCopy();
}
else if ( m_nStreamMode == PACKAGE_STREAM_DATA )
return TryToGetRawFromDataStream( false );
}
2011-03-09 17:29:09 +01:00
return uno::Reference< io::XInputStream >();
}
// XUnoTunnel
sal_Int64 SAL_CALL ZipPackageStream::getSomething( const Sequence< sal_Int8 >& aIdentifier )
throw( RuntimeException, std::exception )
{
sal_Int64 nMe = 0;
if ( aIdentifier.getLength() == 16 &&
0 == memcmp( static_getImplementationId().getConstArray(), aIdentifier.getConstArray(), 16 ) )
nMe = reinterpret_cast < sal_Int64 > ( this );
return nMe;
}
// XPropertySet
void SAL_CALL ZipPackageStream::setPropertyValue( const OUString& aPropertyName, const Any& aValue )
throw( beans::UnknownPropertyException, beans::PropertyVetoException, IllegalArgumentException, WrappedTargetException, RuntimeException, std::exception )
{
if ( aPropertyName == "MediaType" )
{
2010-04-13 10:20:02 +02:00
if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE && rZipPackage.getFormat() != embed::StorageFormats::OFOPXML )
throw beans::PropertyVetoException(THROW_WHERE );
if ( aValue >>= msMediaType )
{
if ( !msMediaType.isEmpty() )
{
if ( msMediaType.indexOf ( "text" ) != -1
|| msMediaType == "application/vnd.sun.star.oleobject" )
bToBeCompressed = true;
else if ( !m_bCompressedIsSetFromOutside )
bToBeCompressed = false;
}
}
else
throw IllegalArgumentException(THROW_WHERE "MediaType must be a string!",
2011-03-09 17:29:09 +01:00
uno::Reference< XInterface >(),
2 );
}
else if ( aPropertyName == "Size" )
{
if ( !( aValue >>= aEntry.nSize ) )
throw IllegalArgumentException(THROW_WHERE "Wrong type for Size property!",
2011-03-09 17:29:09 +01:00
uno::Reference< XInterface >(),
2 );
}
else if ( aPropertyName == "Encrypted" )
{
2010-04-13 10:20:02 +02:00
if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE )
throw beans::PropertyVetoException(THROW_WHERE );
bool bEnc = false;
if ( aValue >>= bEnc )
{
// In case of new raw stream, the stream must not be encrypted on storing
if ( bEnc && m_nStreamMode == PACKAGE_STREAM_RAW )
throw IllegalArgumentException(THROW_WHERE "Raw stream can not be encrypted on storing",
2011-03-09 17:29:09 +01:00
uno::Reference< XInterface >(),
2 );
bToBeEncrypted = bEnc;
2011-03-09 17:29:09 +01:00
if ( bToBeEncrypted && !m_xBaseEncryptionData.is() )
m_xBaseEncryptionData = new BaseEncryptionData;
}
else
throw IllegalArgumentException(THROW_WHERE "Wrong type for Encrypted property!",
2011-03-09 17:29:09 +01:00
uno::Reference< XInterface >(),
2 );
}
else if ( aPropertyName == ENCRYPTION_KEY_PROPERTY )
{
2010-04-13 10:20:02 +02:00
if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE )
throw beans::PropertyVetoException(THROW_WHERE );
2011-03-09 17:29:09 +01:00
uno::Sequence< sal_Int8 > aNewKey;
if ( !( aValue >>= aNewKey ) )
{
OUString sTempString;
if ( ( aValue >>= sTempString ) )
{
CWS-TOOLING: integrate CWS encsig09 2009-09-14 15:11:29 +0200 oc r276125 : #i105049# MacroSignatur needs Macro 2009-09-09 17:09:46 +0200 jl r276005 : #i103989# could not signe encrypted doc containing a formular object 2009-09-09 13:11:24 +0200 jl r275985 : #i103989# could not signe encrypted doc containing a formular object 2009-09-08 15:54:02 +0200 mav r275934 : #i103906# fix the automation test scenario ( tempfile should be writable for the user ) 2009-09-07 14:01:39 +0200 mav r275895 : #i103906# fix the problem with reload 2009-09-07 09:34:48 +0200 mav r275871 : #i104786# do the ODF version check only for ODF documents 2009-09-07 08:19:06 +0200 mav r275870 : #i104389# fix text 2009-09-06 22:24:21 +0200 mav r275867 : #i104786# check the consistency of ODF version 2009-09-06 22:23:24 +0200 mav r275866 : #i104786# check the consistency of ODF version 2009-09-06 22:23:00 +0200 mav r275865 : #i104786# check the consistency of ODF version 2009-09-06 22:22:36 +0200 mav r275864 : #i104786# check the consistency of ODF version 2009-09-06 22:22:03 +0200 mav r275863 : #i104786# check the consistency of ODF version 2009-09-02 17:09:30 +0200 mav r275722 : #i104715# let repairing mechanics use the streams correctly 2009-09-01 16:52:49 +0200 mav r275670 : #i104389# notify user not to trust the corrupted document 2009-09-01 16:31:37 +0200 mav r275668 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:30:32 +0200 mav r275667 : #i104389# use vnd.sun.star.zip: protocol to access zip files 2009-09-01 16:22:13 +0200 jl r275666 : #i104339# small content change 2009-09-01 14:20:42 +0200 jl r275660 : #i103519# remove some debug output 2009-09-01 13:51:52 +0200 jl r275659 : #i103519# NSS uses '\' for escaping in distinguished names 2009-09-01 12:49:47 +0200 mav r275655 : #i104389# use zip-mode to read from jar files 2009-09-01 12:40:22 +0200 mav r275653 : #i104389# use zip-mode to read from jar files 2009-09-01 12:32:29 +0200 mav r275652 : #i104389# use constants 2009-08-31 21:58:00 +0200 mav r275637 : #i10000# fix warning 2009-08-31 21:11:17 +0200 mav r275636 : #i104227# adding of scripting signature removes the document signature 2009-08-31 20:55:05 +0200 mav r275635 : #i103905# ZipStorage supports Compressed property 2009-08-31 20:53:55 +0200 mav r275634 : #i103905# adjust macro signature transfer to usage of ZipStorage 2009-08-31 15:30:49 +0200 jl r275609 : #i103989# warning is shown as long the user does not click 'OK' 2009-08-31 14:36:10 +0200 jl r275608 : #i103989# changed warning text when signing macro and there is a document signature. This warning is only displayed once 2009-08-31 13:34:41 +0200 mav r275603 : #i104452# disable macros in repaired documents 2009-08-31 13:33:42 +0200 mav r275602 : #i104452# disable macros in repaired documents 2009-08-31 13:03:56 +0200 jl r275600 : #i45212# signature dialog could not be started when using read-only documents 2009-08-31 09:26:13 +0200 mav r275583 : #i104578# store the additional entry as the last one to workaround parsing problem in OOo3.1 and later 2009-08-30 20:54:25 +0200 mav r275562 : #i10000# adopt for unix 2009-08-30 10:56:00 +0200 mav r275561 : CWS-TOOLING: rebase CWS encsig09 to trunk@275331 (milestone: DEV300:m56) 2009-08-28 16:34:00 +0200 mav r275539 : #i104578# write necessary info in manifest.xml for ODF1.2 encrypted document 2009-08-28 14:04:22 +0200 mav r275533 : #104587# fix handling of readonly streams 2009-08-28 13:58:10 +0200 mav r275531 : #i104389# fix the broken document handling 2009-08-28 11:40:39 +0200 mav r275522 : #i104389# fix the signature streams check 2009-08-27 21:48:12 +0200 mav r275509 : #i103927# show the warning 2009-08-27 21:47:48 +0200 mav r275508 : #i103927# show the warning 2009-08-27 16:45:59 +0200 jl r275495 : #i45212# remove unused variable 2009-08-27 16:34:00 +0200 jl r275494 : #i103989# 2009-08-27 13:54:28 +0200 jl r275482 : #i103519# fixed replacement of 'S' by 'ST' 2009-08-27 12:32:21 +0200 mav r275472 : #i10000# fix warning 2009-08-27 11:58:11 +0200 mav r275467 : #i104389# handle the entry path correctly 2009-08-26 17:18:35 +0200 jl r275438 : #i103519# subject and issuer distinguished names were not properly displayed. The strings were obtained by system functions (Windows, NSS), which use quotes to escape the values, when they contain special characters 2009-08-26 11:00:20 +0200 mav r275403 : #i10000# fix warnings 2009-08-26 08:25:45 +0200 mav r275392 : #i10000# fix warning 2009-08-26 08:02:22 +0200 mav r275391 : #i10000# adopt for linux 2009-08-26 07:40:30 +0200 mav r275390 : #i10000# fix warning 2009-08-26 07:35:28 +0200 mav r275389 : #i10000# use correct include file name 2009-08-25 15:01:41 +0200 jl r275356 : #i103989# better check for mimetype of streams 2009-08-25 09:07:09 +0200 mav r275335 : CWS-TOOLING: rebase CWS encsig09 to trunk@274622 (milestone: DEV300:m54) 2009-08-24 18:17:02 +0200 mav r275329 : #i103927# check the nonencrypted streams 2009-08-24 18:14:14 +0200 mav r275328 : #i103927# check the nonencrypted streams 2009-08-24 17:59:34 +0200 mav r275327 : #i103927#,#i104389# check the package consistency and nonencrypted streams 2009-08-24 16:18:28 +0200 jl r275323 : #i103989# added comment 2009-08-24 13:08:47 +0200 jl r275305 : #i45212# #i66276# only write the X509Certificate element once and allow to add remove several certificates at a time 2009-08-21 12:57:28 +0200 ufi r275239 : 104339 2009-08-21 08:39:05 +0200 jl r275213 : #i10398# comparing URIs of signed files with the 'element list' 2009-08-20 13:39:47 +0200 jl r275178 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:35:39 +0200 jl r275177 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:29:06 +0200 jl r275176 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 13:26:21 +0200 jl r275175 : #i10398# displaying 'new partially signed' status in the status bar 2009-08-20 12:05:09 +0200 ufi r275170 : i104339 2009-08-19 12:24:54 +0200 jl r275146 : #i10398# displaying 'old signature' icon and status in signature dialog 2009-08-18 15:18:48 +0200 jl r275111 : #i103989# document signatures containing manifest.xml are now validated according to the final ODF1.2 spec 2009-08-18 11:41:06 +0200 mav r275087 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-18 11:35:13 +0200 mav r275085 : #i103927# detect if encrypted ODF1.2 document contains nonencrypted streams 2009-08-14 17:32:41 +0200 jl r274999 : #i103989# using c14n tranformation for XML streams 2009-08-14 15:27:43 +0200 jl r274987 : #i103989# remove special handling for encrypted document streams in UriBindingHelper::OpenInputStream, since we use zip storage this is not necessary anymore 2009-08-14 15:08:10 +0200 jl r274983 : #i103989# Showing a message when adding or removing a macro signature, that the document signature will be removed 2009-08-14 14:57:27 +0200 jl r274982 : #i103989# accesing Sequence at invalid index 2009-08-11 08:55:02 +0200 mav r274846 : #i103905# let signing service know if there is already a valid document signature 2009-08-10 11:33:37 +0200 jl r274799 : #i103905# do not truncate the stream 2009-08-10 10:43:47 +0200 mav r274797 : #i103905# provide the storage version 2009-08-07 16:58:46 +0200 jl r274780 : #i103989# 2009-08-07 16:56:19 +0200 jl r274779 : #i103989# using odf version string etc. 2009-08-07 15:20:53 +0200 mav r274771 : #i103905# provide the storage version 2009-08-07 15:19:12 +0200 mav r274770 : #i103905# provide the storage version 2009-08-07 12:41:45 +0200 mav r274758 : #103930# do not store thumbnail in case of encrypted document 2009-08-07 12:36:52 +0200 mav r274757 : #i103905# provide the storage version 2009-08-07 12:15:54 +0200 mav r274754 : #i103760# the signed state is not lost on saving 2009-08-07 12:06:19 +0200 mav r274753 : #i103760# avoid warning regarding signature removal on export 2009-08-07 12:06:01 +0200 mav r274752 : #i103760# avoid warning regarding signature removal on export 2009-08-06 08:47:34 +0200 mav r274703 : #i103905# allow to transport ODF version to the signing component 2009-08-05 21:34:42 +0200 mav r274701 : #i103905# allow to transport ODF version to the signing component 2009-08-05 15:48:17 +0200 mav r274683 : #i103905# allow to transport ODF version to the signing component 2009-08-05 14:58:12 +0200 jl r274673 : #i103989# documentsignature now signes all streams except documentsignatures.xml, all streams are processed as binary files 2009-08-05 12:00:32 +0200 mav r274648 : #i103905# allow to transport ODF version to the signing component 2009-08-04 10:57:04 +0200 jl r274612 : #i103989# added XInitialization 2009-07-31 10:32:27 +0200 mav r274516 : #i103905# use zip storage to sign documents 2009-07-30 14:01:33 +0200 mav r274489 : #i103906# optimize the usage of temporary medium 2009-07-30 14:00:28 +0200 mav r274488 : #i103906# optimize the usage of temporary medium 2009-07-30 13:59:09 +0200 mav r274487 : #i103906# optimize the usage of temporary medium 2009-07-30 13:50:44 +0200 mav r274485 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:53 +0200 mav r274484 : #i103906# optimize the usage of temporary medium 2009-07-30 13:49:13 +0200 mav r274483 : #i103906# optimize the usage of temporary medium 2009-07-30 13:47:09 +0200 mav r274482 : #i103905#,#i103906# let the signing process use zip-storage; optimize the usage of temporary medium 2009-07-21 09:10:31 +0200 mav r274159 : CWS-TOOLING: rebase CWS encsig09 to trunk@273468 (milestone: DEV300:m51) 2009-05-05 08:39:01 +0200 mav r271496 : #i100832# allow to sign macros only when there are any
2009-09-17 13:53:54 +00:00
sal_Int32 nPathLength = sTempString.getLength();
Sequence < sal_Int8 > aSequence ( nPathLength );
sal_Int8 *pArray = aSequence.getArray();
const sal_Unicode *pChar = sTempString.getStr();
2011-03-09 17:29:09 +01:00
for ( sal_Int16 i = 0; i < nPathLength; i++ )
pArray[i] = static_cast < const sal_Int8 > ( pChar[i] );
aNewKey = aSequence;
}
else
throw IllegalArgumentException(THROW_WHERE "Wrong type for EncryptionKey property!",
2011-03-09 17:29:09 +01:00
uno::Reference< XInterface >(),
2 );
}
if ( aNewKey.getLength() )
{
2011-03-09 17:29:09 +01:00
if ( !m_xBaseEncryptionData.is() )
m_xBaseEncryptionData = new BaseEncryptionData;
m_aEncryptionKey = aNewKey;
// In case of new raw stream, the stream must not be encrypted on storing
bHaveOwnKey = true;
2011-03-09 17:29:09 +01:00
if ( m_nStreamMode != PACKAGE_STREAM_RAW )
bToBeEncrypted = true;
2011-03-09 17:29:09 +01:00
}
else
{
bHaveOwnKey = false;
2011-03-09 17:29:09 +01:00
m_aEncryptionKey.realloc( 0 );
}
m_aStorageEncryptionKeys.realloc( 0 );
}
else if ( aPropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY )
2011-03-09 17:29:09 +01:00
{
if ( rZipPackage.getFormat() != embed::StorageFormats::PACKAGE )
throw beans::PropertyVetoException(THROW_WHERE );
2011-03-09 17:29:09 +01:00
uno::Sequence< beans::NamedValue > aKeys;
if ( !( aValue >>= aKeys ) )
{
throw IllegalArgumentException(THROW_WHERE "Wrong type for StorageEncryptionKeys property!",
2011-03-09 17:29:09 +01:00
uno::Reference< XInterface >(),
2 );
}
if ( aKeys.getLength() )
{
if ( !m_xBaseEncryptionData.is() )
m_xBaseEncryptionData = new BaseEncryptionData;
m_aStorageEncryptionKeys = aKeys;
// In case of new raw stream, the stream must not be encrypted on storing
bHaveOwnKey = true;
if ( m_nStreamMode != PACKAGE_STREAM_RAW )
bToBeEncrypted = true;
}
else
2011-03-09 17:29:09 +01:00
{
bHaveOwnKey = false;
2011-03-09 17:29:09 +01:00
m_aStorageEncryptionKeys.realloc( 0 );
}
m_aEncryptionKey.realloc( 0 );
}
else if ( aPropertyName == "Compressed" )
{
bool bCompr = false;
if ( aValue >>= bCompr )
{
// In case of new raw stream, the stream must not be encrypted on storing
if ( bCompr && m_nStreamMode == PACKAGE_STREAM_RAW )
throw IllegalArgumentException(THROW_WHERE "Raw stream can not be encrypted on storing",
2011-03-09 17:29:09 +01:00
uno::Reference< XInterface >(),
2 );
bToBeCompressed = bCompr;
m_bCompressedIsSetFromOutside = true;
}
else
throw IllegalArgumentException(THROW_WHERE "Wrong type for Compressed property!",
2011-03-09 17:29:09 +01:00
uno::Reference< XInterface >(),
2 );
}
else
throw beans::UnknownPropertyException(THROW_WHERE );
}
Any SAL_CALL ZipPackageStream::getPropertyValue( const OUString& PropertyName )
throw( beans::UnknownPropertyException, WrappedTargetException, RuntimeException, std::exception )
{
Any aAny;
if ( PropertyName == "MediaType" )
{
aAny <<= msMediaType;
return aAny;
}
else if ( PropertyName == "Size" )
{
aAny <<= aEntry.nSize;
return aAny;
}
else if ( PropertyName == "Encrypted" )
{
aAny <<= ((m_nStreamMode == PACKAGE_STREAM_RAW) || bToBeEncrypted);
return aAny;
}
else if ( PropertyName == "WasEncrypted" )
{
aAny <<= bIsEncrypted;
return aAny;
}
else if ( PropertyName == "Compressed" )
{
aAny <<= bToBeCompressed;
return aAny;
}
else if ( PropertyName == ENCRYPTION_KEY_PROPERTY )
{
2011-03-09 17:29:09 +01:00
aAny <<= m_aEncryptionKey;
return aAny;
}
else if ( PropertyName == STORAGE_ENCRYPTION_KEYS_PROPERTY )
{
aAny <<= m_aStorageEncryptionKeys;
return aAny;
}
else
throw beans::UnknownPropertyException(THROW_WHERE );
}
void ZipPackageStream::setSize ( const sal_Int64 nNewSize )
{
2011-03-09 17:29:09 +01:00
if ( aEntry.nCompressedSize != nNewSize )
aEntry.nMethod = DEFLATED;
aEntry.nSize = nNewSize;
}
OUString ZipPackageStream::getImplementationName()
throw ( RuntimeException, std::exception )
{
return OUString ("ZipPackageStream");
}
Sequence< OUString > ZipPackageStream::getSupportedServiceNames()
throw ( RuntimeException, std::exception )
{
2011-03-09 17:29:09 +01:00
Sequence< OUString > aNames( 1 );
aNames[0] = "com.sun.star.packages.PackageStream";
return aNames;
}
sal_Bool SAL_CALL ZipPackageStream::supportsService( OUString const & rServiceName )
throw ( RuntimeException, std::exception )
{
return cppu::supportsService(this, rServiceName);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */