summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSander Vesik <svesik@openoffice.org>2004-04-21 11:29:09 +0000
committerSander Vesik <svesik@openoffice.org>2004-04-21 11:29:09 +0000
commit03dd38954f995919bd0c94bd7b20dc789ad2fe12 (patch)
tree10a7bbc894f205032b0f0cb96737ccaf03a45481
parentd37fd0cad86ead943508f601ea61b08e2792c819 (diff)
INTEGRATION: CWS loadenv01 (1.12.142); FILE MERGED
2004/03/15 10:45:49 mba 1.12.142.1: #115936#: allow loading through XStream in MediaDescriptor
-rw-r--r--unotools/source/ucbhelper/ucbstreamhelper.cxx23
1 files changed, 21 insertions, 2 deletions
diff --git a/unotools/source/ucbhelper/ucbstreamhelper.cxx b/unotools/source/ucbhelper/ucbstreamhelper.cxx
index b4e5aa5c94d4..93425bfdcf61 100644
--- a/unotools/source/ucbhelper/ucbstreamhelper.cxx
+++ b/unotools/source/ucbhelper/ucbstreamhelper.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: ucbstreamhelper.cxx,v $
*
- * $Revision: 1.12 $
+ * $Revision: 1.13 $
*
- * last change: $Author: mba $ $Date: 2001-07-20 11:14:07 $
+ * last change: $Author: svesik $ $Date: 2004-04-21 12:29:09 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -207,4 +207,23 @@ SvStream* UcbStreamHelper::CreateStream( Reference < XInputStream > xStream )
return pStream;
};
+SvStream* UcbStreamHelper::CreateStream( Reference < XStream > xStream )
+{
+ SvStream* pStream = NULL;
+ if ( xStream->getOutputStream().is() )
+ {
+ UcbLockBytesRef xLockBytes = UcbLockBytes::CreateLockBytes( xStream );
+ if ( xLockBytes.Is() )
+ {
+ pStream = new SvStream( xLockBytes );
+ pStream->SetBufferSize( 4096 );
+ pStream->SetError( xLockBytes->GetError() );
+ }
+ }
+ else
+ return CreateStream( xStream->getInputStream() );
+
+ return pStream;
+};
+
};