diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-11-02 10:47:37 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2007-11-02 10:47:37 +0000 |
commit | 7f201d2e1b0e7c06a34842a5842787c8a979341b (patch) | |
tree | 894846e6525705dd82821fa60338ea855ae9d2cd /embedserv/source/embed | |
parent | 5225ae401c07d30d398f8b2c72285cadac9b34cb (diff) |
INTEGRATION: CWS fwk75_SRC680 (1.25.8); FILE MERGED
2007/09/13 14:03:37 mav 1.25.8.1: #i71889# allow to open the document readonly
Diffstat (limited to 'embedserv/source/embed')
-rwxr-xr-x | embedserv/source/embed/ed_ipersiststr.cxx | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/embedserv/source/embed/ed_ipersiststr.cxx b/embedserv/source/embed/ed_ipersiststr.cxx index 8f9d79e3ca63..0ac37eb572c0 100755 --- a/embedserv/source/embed/ed_ipersiststr.cxx +++ b/embedserv/source/embed/ed_ipersiststr.cxx @@ -4,9 +4,9 @@ * * $RCSfile: ed_ipersiststr.cxx,v $ * - * $Revision: 1.25 $ + * $Revision: 1.26 $ * - * last change: $Author: vg $ $Date: 2007-05-25 11:08:24 $ + * last change: $Author: hr $ $Date: 2007-11-02 11:47:37 $ * * The Contents of this file are made available subject to * 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 > aArgs( 4 ); + uno::Sequence< beans::PropertyValue > aArgs( 3 ); - aArgs[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "FilterName" ) ); - aArgs[0].Value <<= getFilterNameFromGUID_Impl( &m_guid ); - aArgs[1].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "ReadOnly" ) ); - aArgs[1].Value <<= sal_False; //( ( nStreamMode & ( STGM_READWRITE | STGM_WRITE ) ) ? sal_True : sal_False ); + sal_Int32 nInd = 0; // must not be bigger than the preset size + aArgs[nInd].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "FilterName" ) ); + aArgs[nInd++].Value <<= getFilterNameFromGUID_Impl( &m_guid ); if ( xStream.is() ) { - aArgs[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "InputStream" ) ); - aArgs[2].Value <<= xStream; - aArgs[3].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "URL" ) ); - aArgs[3].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "private:stream" ) ); + aArgs[nInd].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "InputStream" ) ); + aArgs[nInd++].Value <<= xStream; + aArgs[nInd].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "URL" ) ); + aArgs[nInd++].Value <<= ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "private:stream" ) ); } else { - aArgs[2].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "URL" ) ); + aArgs[nInd].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM ( "URL" ) ); rtl::OUString sDocUrl; if ( pFilePath ) @@ -274,10 +273,14 @@ uno::Sequence< beans::PropertyValue > EmbedDocument_Impl::fillArgsForLoading_Imp } } - aArgs[2].Value <<= sDocUrl; - aArgs.realloc( 3 ); + aArgs[nInd++].Value <<= sDocUrl; } + 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; } |