diff options
author | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-04-13 11:03:37 +0000 |
---|---|---|
committer | Jens-Heiner Rechtien <hr@openoffice.org> | 2004-04-13 11:03:37 +0000 |
commit | 48dee8d2531d3b6be4d767513046063fcff3844f (patch) | |
tree | 1d6d8fb5d00a339d9f919c5931e8e58bac377ab8 /ucbhelper | |
parent | 805ad62d07352deb64e2ad6d1aa3de37b50f2159 (diff) |
INTEGRATION: CWS unopkg1 (1.27.28); FILE MERGED
2003/11/28 12:42:26 dbo 1.27.28.1: insertNewcontent(): providing an empty input stream instead of null reference
Diffstat (limited to 'ucbhelper')
-rw-r--r-- | ucbhelper/source/client/content.cxx | 60 |
1 files changed, 56 insertions, 4 deletions
diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx index 5ac1f9e343e6..38dc4a96490d 100644 --- a/ucbhelper/source/client/content.cxx +++ b/ucbhelper/source/client/content.cxx @@ -2,9 +2,9 @@ * * $RCSfile: content.cxx,v $ * - * $Revision: 1.27 $ + * $Revision: 1.28 $ * - * last change: $Author: vg $ $Date: 2003-07-25 11:36:37 $ + * last change: $Author: hr $ $Date: 2004-04-13 12:03:37 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -78,6 +78,8 @@ #include <cppuhelper/weak.hxx> #endif +#include <cppuhelper/implbase1.hxx> + #ifndef _COM_SUN_STAR_UCB_CONTENTCREATIONERROR_HPP_ #include <com/sun/star/ucb/ContentCreationError.hpp> #endif @@ -188,6 +190,56 @@ using namespace com::sun::star::uno; namespace ucb { +class EmptyInputStream : public ::cppu::WeakImplHelper1< XInputStream > +{ +public: + virtual sal_Int32 SAL_CALL readBytes( + Sequence< sal_Int8 > & data, sal_Int32 nBytesToRead ) + throw (IOException, RuntimeException); + virtual sal_Int32 SAL_CALL readSomeBytes( + Sequence< sal_Int8 > & data, sal_Int32 nMaxBytesToRead ) + throw (IOException, RuntimeException); + virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) + throw (IOException, RuntimeException); + virtual sal_Int32 SAL_CALL available() + throw (IOException, RuntimeException); + virtual void SAL_CALL closeInput() + throw (IOException, RuntimeException); +}; + +sal_Int32 EmptyInputStream::readBytes( + Sequence< sal_Int8 > & data, sal_Int32 nBytesToRead ) + throw (IOException, RuntimeException) +{ + data.realloc( 0 ); + return 0; +} + +sal_Int32 EmptyInputStream::readSomeBytes( + Sequence< sal_Int8 > & data, sal_Int32 nMaxBytesToRead ) + throw (IOException, RuntimeException) +{ + data.realloc( 0 ); + return 0; +} + +void EmptyInputStream::skipBytes( sal_Int32 nBytesToSkip ) + throw (IOException, RuntimeException) +{ +} + +sal_Int32 EmptyInputStream::available() + throw (IOException, RuntimeException) +{ + return 0; +} + +void EmptyInputStream::closeInput() + throw (IOException, RuntimeException) +{ +} + + //========================================================================= //========================================================================= // @@ -1272,7 +1324,7 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, return insertNewContent( rContentType, rPropertyNames, rPropertyValues, - Reference< XInputStream >(), + new EmptyInputStream, rNewContent ); } @@ -1287,7 +1339,7 @@ sal_Bool Content::insertNewContent( const rtl::OUString& rContentType, return insertNewContent( rContentType, nPropertyHandles, rPropertyValues, - Reference< XInputStream >(), + new EmptyInputStream, rNewContent ); } |