summaryrefslogtreecommitdiff
path: root/unotools/source/ucbhelper/ucbstreamhelper.cxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2006-04-26 13:24:28 +0000
committerKurt Zenker <kz@openoffice.org>2006-04-26 13:24:28 +0000
commit294d8e82d2f40767315c8ef497aaa3bace301901 (patch)
tree29d01dab8d35126c5c334e36193744219e14f5b7 /unotools/source/ucbhelper/ucbstreamhelper.cxx
parentb4c84a7d96e5f2750dfb2578c5e2db5b785ed8db (diff)
INTEGRATION: CWS fwk37 (1.16.38); FILE MERGED
2006/03/29 09:43:24 mav 1.16.38.1: #b6404500# support substorages in OLESimpleStorage service
Diffstat (limited to 'unotools/source/ucbhelper/ucbstreamhelper.cxx')
-rw-r--r--unotools/source/ucbhelper/ucbstreamhelper.cxx43
1 files changed, 41 insertions, 2 deletions
diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx
index c5e7f664f6ee..7c49d3969133 100644
--- a/unotools/source/ucbhelper/ucbstreamhelper.cxx
+++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx
@@ -4,9 +4,9 @@
*
* $RCSfile: ucbstreamhelper.cxx,v $
*
- * $Revision: 1.16 $
+ * $Revision: 1.17 $
*
- * last change: $Author: rt $ $Date: 2005-09-09 09:52:11 $
+ * last change: $Author: kz $ $Date: 2006-04-26 14:24:28 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -219,4 +219,43 @@ SvStream* UcbStreamHelper::CreateStream( Reference < XStream > xStream )
return pStream;
};
+SvStream* UcbStreamHelper::CreateStream( Reference < XInputStream > xStream, sal_Bool bCloseStream )
+{
+ SvStream* pStream = NULL;
+ UcbLockBytesRef xLockBytes = UcbLockBytes::CreateInputLockBytes( xStream );
+ if ( xLockBytes.Is() )
+ {
+ if ( !bCloseStream )
+ xLockBytes->setDontClose_Impl();
+
+ pStream = new SvStream( xLockBytes );
+ pStream->SetBufferSize( 4096 );
+ pStream->SetError( xLockBytes->GetError() );
+ }
+
+ return pStream;
+};
+
+SvStream* UcbStreamHelper::CreateStream( Reference < XStream > xStream, sal_Bool bCloseStream )
+{
+ SvStream* pStream = NULL;
+ if ( xStream->getOutputStream().is() )
+ {
+ UcbLockBytesRef xLockBytes = UcbLockBytes::CreateLockBytes( xStream );
+ if ( xLockBytes.Is() )
+ {
+ if ( !bCloseStream )
+ xLockBytes->setDontClose_Impl();
+
+ pStream = new SvStream( xLockBytes );
+ pStream->SetBufferSize( 4096 );
+ pStream->SetError( xLockBytes->GetError() );
+ }
+ }
+ else
+ return CreateStream( xStream->getInputStream(), bCloseStream );
+
+ return pStream;
+};
+
};