diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-04-15 13:10:29 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-04-15 13:10:29 +0000 |
commit | 59a60f289235e5aee13144ccaf6a339f1b056cf1 (patch) | |
tree | 7274e7eaae5482e75d0da1af8cc5963257fb5699 /ucbhelper | |
parent | bbf8962db9161c5a15ae1e94cbec5f9b426025b8 (diff) |
INTEGRATION: CWS calcshare2 (1.36.40); FILE MERGED
2008/03/14 21:40:20 mav 1.36.40.1: #i85794# new file locking prototype
Diffstat (limited to 'ucbhelper')
-rw-r--r-- | ucbhelper/source/client/content.cxx | 53 |
1 files changed, 52 insertions, 1 deletions
diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx index 4f88fb2d422b..c82a0bc19b77 100644 --- a/ucbhelper/source/client/content.cxx +++ b/ucbhelper/source/client/content.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: content.cxx,v $ - * $Revision: 1.37 $ + * $Revision: 1.38 $ * * This file is part of OpenOffice.org. * @@ -1182,6 +1182,7 @@ Reference< XResultSet > Content::createSortedCursor( return aResult; } + //========================================================================= Reference< XInputStream > Content::openStream() throw( CommandAbortedException, RuntimeException, Exception ) @@ -1208,6 +1209,31 @@ Reference< XInputStream > Content::openStream() } //========================================================================= +Reference< XInputStream > Content::openStreamNoLock() + throw( CommandAbortedException, RuntimeException, Exception ) +{ + if ( !isDocument() ) + return Reference< XInputStream >(); + + Reference< XActiveDataSink > xSink = new ActiveDataSink; + + OpenCommandArgument2 aArg; + aArg.Mode = OpenMode::DOCUMENT_SHARE_DENY_NONE; + aArg.Priority = 0; // unused + aArg.Sink = xSink; + aArg.Properties = Sequence< Property >( 0 ); // unused + + Command aCommand; + aCommand.Name = rtl::OUString::createFromAscii( "open" ); + aCommand.Handle = -1; // n/a + aCommand.Argument <<= aArg; + + m_xImpl->executeCommand( aCommand ); + + return xSink->getInputStream(); +} + +//========================================================================= Reference< XStream > Content::openWriteableStream() throw( CommandAbortedException, RuntimeException, Exception ) { @@ -1233,6 +1259,31 @@ Reference< XStream > Content::openWriteableStream() } //========================================================================= +Reference< XStream > Content::openWriteableStreamNoLock() + throw( CommandAbortedException, RuntimeException, Exception ) +{ + if ( !isDocument() ) + return Reference< XStream >(); + + Reference< XActiveDataStreamer > xStreamer = new ActiveDataStreamer; + + OpenCommandArgument2 aArg; + aArg.Mode = OpenMode::DOCUMENT_SHARE_DENY_NONE; + aArg.Priority = 0; // unused + aArg.Sink = xStreamer; + aArg.Properties = Sequence< Property >( 0 ); // unused + + Command aCommand; + aCommand.Name = rtl::OUString::createFromAscii( "open" ); + aCommand.Handle = -1; // n/a + aCommand.Argument <<= aArg; + + m_xImpl->executeCommand( aCommand ); + + return xStreamer->getStream(); +} + +//========================================================================= sal_Bool Content::openStream( const Reference< XActiveDataSink >& rSink ) throw( CommandAbortedException, RuntimeException, Exception ) { |