INTEGRATION: CWS fwk61 (1.22.6); FILE MERGED

2007/01/26 14:27:28 mav 1.22.6.1: #i71889# allow to open the document readonly
This commit is contained in:
Ivo Hinkelmann
2007-03-26 10:59:14 +00:00
parent d60d647894
commit efef57e967

View File

@@ -4,9 +4,9 @@
* *
* $RCSfile: ed_ipersiststr.cxx,v $ * $RCSfile: ed_ipersiststr.cxx,v $
* *
* $Revision: 1.22 $ * $Revision: 1.23 $
* *
* last change: $Author: rt $ $Date: 2006-12-05 13:06:14 $ * last change: $Author: ihi $ $Date: 2007-03-26 11:59:14 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
@@ -239,23 +239,22 @@ EmbedDocument_Impl::~EmbedDocument_Impl()
uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Impl( uno::Reference< io::XInputStream > xStream, DWORD /*nStreamMode*/, LPCOLESTR pFilePath ) uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Impl( uno::Reference< io::XInputStream > xStream, DWORD /*nStreamMode*/, LPCOLESTR pFilePath )
{ {
uno::Sequence< beans::PropertyValue > aArgs( 4 ); uno::Sequence< beans::PropertyValue > aArgs( 3 );
aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "FilterName" ) ); sal_Int32 nInd = 0; // must not be bigger than the preset size
aArgs[0].Value <<= getFilterNameFromGUID_Impl( &m_guid ); aArgs[nInd].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "FilterName" ) );
aArgs[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ReadOnly" ) ); aArgs[nInd++].Value <<= getFilterNameFromGUID_Impl( &m_guid );
aArgs[1].Value <<= sal_False; //( ( nStreamMode & ( STGM_READWRITE | STGM_WRITE ) ) ? sal_True : sal_False );
if ( xStream.is() ) if ( xStream.is() )
{ {
aArgs[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "InputStream" ) ); aArgs[nInd].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "InputStream" ) );
aArgs[2].Value <<= xStream; aArgs[nInd++].Value <<= xStream;
aArgs[3].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "URL" ) ); aArgs[nInd].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "URL" ) );
aArgs[3].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "private:stream" ) ); aArgs[nInd++].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "private:stream" ) );
} }
else else
{ {
aArgs[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "URL" ) ); aArgs[nInd].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "URL" ) );
rtl::OUString sDocUrl; rtl::OUString sDocUrl;
if ( pFilePath ) if ( pFilePath )
@@ -275,10 +274,14 @@ uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Imp
} }
} }
aArgs[2].Value <<= sDocUrl; aArgs[nInd++].Value <<= sDocUrl;
aArgs.realloc( 3 );
} }
aArgs.realloc( nInd );
// aArgs[].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ReadOnly" ) );
// aArgs[].Value <<= sal_False; //( ( nStreamMode & ( STGM_READWRITE | STGM_WRITE ) ) ? sal_True : sal_False );
return aArgs; return aArgs;
} }