summaryrefslogtreecommitdiff
path: root/writerfilter
diff options
context:
space:
mode:
authorOliver Bolte <obo@openoffice.org>2009-09-07 14:41:16 +0000
committerOliver Bolte <obo@openoffice.org>2009-09-07 14:41:16 +0000
commit9fa41b880dcfef94fa3b7b057f601d97f8a37763 (patch)
treee9fa09c313164699137f72e8350585a0c8571849 /writerfilter
parentc2f366873f2a3b423265a1ebfdb5e1547d49f3e5 (diff)
CWS-TOOLING: integrate CWS dr72
2009-08-26 10:24:00 +0200 dr r275402 : #i92645# CODEPAGE is encrypted... 2009-08-24 14:37:36 +0200 dr r275316 : #i10000# enable exceptions for xlroot.cxx 2009-08-24 14:33:15 +0200 dr r275313 : #i10000# link openssl under solaris correctly 2009-08-21 17:41:16 +0200 dr r275267 : #i10000# unxlngi6 warning 2009-08-21 15:35:56 +0200 dr r275265 : #i10000# remove files again, already deleted in previous milestone... 2009-08-21 11:24:57 +0200 dr r275227 : #160401# port to DEV300 2009-08-21 09:53:45 +0200 dr r275221 : #i92645# full support for encrypted Word2007 files 2009-08-21 09:50:52 +0200 dr r275219 : #i92645# final changes for decryption 2009-08-20 19:48:40 +0200 dr r275195 : #i104370# missing parentheses, patch from cmc 2009-08-20 18:28:22 +0200 dr r275193 : #i92645# rework package decryption to repair 'Reload Document' functionality 2009-08-20 13:55:14 +0200 dr r275179 : #i92645# add new property names 2009-08-19 19:24:21 +0200 dr r275159 : #160401# open writeprotected files read-only, merged to DEV300 2009-08-18 14:41:47 +0200 dr r275109 : #i92645# add 'Aborted' property 2009-08-18 11:20:34 +0200 dr r275084 : #i92645# write back password to medium 2009-08-17 17:52:51 +0200 dr r275066 : #i92645# detect Word2007 docs with oox detection impl, this adds support of encryped Word2007; correct detection of templates and macro-enabled docs 2009-08-17 17:51:31 +0200 dr r275065 : #i92645# detect Word2007 docs with oox detection impl, this adds support of encryped Word2007; correct detection of templates and macro-enabled docs 2009-08-17 11:06:39 +0200 dr r275035 : #i92645# more password handling 2009-08-17 11:05:21 +0200 dr r275034 : #i92645# use new password input mechanism for BIFF filter and dumper in oox 2009-08-14 16:33:53 +0200 nn r274996 : #i104228# DelBroadcastAreasInRange: remove area from hash_set before deleting 2009-08-14 16:27:12 +0200 nn r274995 : #i104059# restore a change lost in the integration of fhawfixes1 2009-08-14 16:24:00 +0200 dr r274994 : #i92645# adapt BIFF import to latest changes 2009-08-14 16:21:30 +0200 dr r274993 : #i92645# adapt BIFF import to latest changes 2009-08-14 16:20:43 +0200 dr r274992 : #i92645# do not add default passwords to media descriptor 2009-08-13 19:20:45 +0200 dr r274965 : #i92645# add a helper to request a document password 2009-08-13 19:09:35 +0200 dr r274964 : #i92645# add a helper to request a document password 2009-08-13 19:09:03 +0200 dr r274963 : #i92645# add a helper to request a document password 2009-08-13 14:35:01 +0200 dr r274946 : #i92645# comment typo 2009-08-13 14:33:47 +0200 dr r274945 : #i92645# add a helper to request a document password 2009-08-13 14:04:47 +0200 dr r274941 : #i92645# add a helper to request a document password 2009-08-13 14:04:22 +0200 dr r274940 : #i92645# add a helper to request a document password 2009-08-13 11:16:27 +0200 dr r274927 : #i42303# show quick help if field name too long for button 2009-08-13 10:55:48 +0200 dr r274925 : #i31600# cut field name and add ellipsis, if too long for button 2009-08-12 18:47:26 +0200 dr r274914 : #i92645# ask user for a password 2009-08-12 18:02:39 +0200 dr r274909 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox 2009-08-12 16:59:11 +0200 dr r274906 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox 2009-08-12 16:41:18 +0200 dr r274905 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox 2009-08-12 16:40:33 +0200 dr r274904 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox 2009-08-12 16:40:08 +0200 dr r274903 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox 2009-08-12 16:39:30 +0200 dr r274902 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox 2009-08-12 16:15:28 +0200 dr r274899 : #i104183# move svtools/DocPasswordRequest to comphelper to be able to use it in oox 2009-08-11 19:51:12 +0200 dr r274877 : #i92645# open encrypted MSOOXML package protected with standard XL password 'VelvetSweatshop'
Diffstat (limited to 'writerfilter')
-rw-r--r--writerfilter/source/filter/ImportFilter.cxx42
-rw-r--r--writerfilter/util/makefile.mk5
2 files changed, 26 insertions, 21 deletions
diff --git a/writerfilter/source/filter/ImportFilter.cxx b/writerfilter/source/filter/ImportFilter.cxx
index b67b7dd283ac..af27bac94540 100644
--- a/writerfilter/source/filter/ImportFilter.cxx
+++ b/writerfilter/source/filter/ImportFilter.cxx
@@ -32,6 +32,8 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/io/XInputStream.hpp>
+#include <comphelper/mediadescriptor.hxx>
+#include <oox/core/filterdetect.hxx>
#include <dmapper/DomainMapper.hxx>
#include <WriterFilter.hxx>
#include <doctok/WW8Document.hxx>
@@ -44,6 +46,7 @@
#include <resourcemodel/TagLogger.hxx>
using namespace ::rtl;
using namespace ::com::sun::star;
+using ::comphelper::MediaDescriptor;
/*-- 09.06.2006 10:15:20---------------------------------------------------
@@ -62,28 +65,29 @@ sal_Bool WriterFilter::filter( const uno::Sequence< beans::PropertyValue >& aDes
if (!xExprtr.is() || !xFltr.is())
return sal_False;
xExprtr->setSourceDocument(m_xSrcDoc);
- if (xFltr->filter(aDescriptor))
- return sal_True;
- return sal_False;
+ return xFltr->filter(aDescriptor);
}
else if (m_xDstDoc.is())
{
-
- sal_Int32 nLength = aDescriptor.getLength();
- const beans::PropertyValue * pValue = aDescriptor.getConstArray();
- uno::Reference < io::XInputStream > xInputStream;
- ::rtl::OUString sFilterName;
- for ( sal_Int32 i = 0 ; i < nLength; i++)
- {
- if ( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "InputStream" ) ) )
- pValue[i].Value >>= xInputStream;
- else if( pValue[i].Name.equalsAsciiL ( RTL_CONSTASCII_STRINGPARAM ( "FilterName" ) ) )
- pValue[i].Value >>= sFilterName;
- }
- if ( !xInputStream.is() )
- {
- return sal_False;
- }
+ MediaDescriptor aMediaDesc( aDescriptor );
+ OUString sFilterName = aMediaDesc.getUnpackedValueOrDefault( MediaDescriptor::PROP_FILTERNAME(), OUString() );
+
+ uno::Reference< io::XInputStream > xInputStream;
+ try
+ {
+ // use the oox.core.FilterDetect implementation to extract the decrypted ZIP package
+ uno::Reference< lang::XMultiServiceFactory > xFactory( m_xContext->getServiceManager(), uno::UNO_QUERY_THROW );
+ ::oox::core::FilterDetect aDetector( xFactory );
+ xInputStream = aDetector.extractUnencryptedPackage( aMediaDesc );
+ }
+ catch( uno::Exception& )
+ {
+ }
+
+ if ( !xInputStream.is() )
+ {
+ return sal_False;
+ }
#ifdef DEBUG_ELEMENT
writerfilter::TagLogger::Pointer_t debugLogger
diff --git a/writerfilter/util/makefile.mk b/writerfilter/util/makefile.mk
index 08033ab9c8df..4e99764c688f 100644
--- a/writerfilter/util/makefile.mk
+++ b/writerfilter/util/makefile.mk
@@ -1,7 +1,7 @@
#************************************************************************
#
# 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
@@ -63,7 +63,8 @@ SHL1STDLIBS=\
$(CPPUHELPERLIB) \
$(COMPHELPERLIB) \
$(CPPULIB) \
- $(SALLIB)
+ $(SALLIB) \
+ $(OOXLIB)
SHL1DEPN=