diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-05-03 12:22:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2012-05-03 12:22:29 +0100 |
commit | b36612d4a34e4ab131c904a9e35ab3e2bded76f5 (patch) | |
tree | 92bfe6b4848931c78db6c3eeb0096c82c5cf724f /sot | |
parent | 056b9b45bf94bf5c362d8409c5919a6565d2922d (diff) |
Fix sot stream bustage
We want the Tell position of the wrapper stream, not that of the underlying
wrapped stream.
Change-Id: I5d30192dbc3746104ca2127d9a747ef70b85a136
Diffstat (limited to 'sot')
-rw-r--r-- | sot/inc/sot/stg.hxx | 6 | ||||
-rw-r--r-- | sot/source/sdstor/stg.cxx | 14 | ||||
-rw-r--r-- | sot/source/sdstor/storage.cxx | 2 | ||||
-rw-r--r-- | sot/source/sdstor/ucbstorage.cxx | 4 |
4 files changed, 13 insertions, 13 deletions
diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx index ab567f3c5b64..d71699505184 100644 --- a/sot/inc/sot/stg.hxx +++ b/sot/inc/sot/stg.hxx @@ -90,11 +90,11 @@ public: virtual sal_uLong Tell() = 0; virtual void Flush() = 0; virtual sal_Bool SetSize( sal_uLong nNewSize ) = 0; + virtual sal_uLong GetSize() const = 0; virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ) = 0; virtual sal_Bool Commit() = 0; virtual sal_Bool Revert() = 0; virtual sal_Bool Equals( const BaseStorageStream& rStream ) const = 0; - virtual sal_Size remainingSize() = 0; }; class BaseStorage : public StorageBase @@ -172,6 +172,7 @@ public: virtual sal_uLong Tell() { return nPos; } virtual void Flush(); virtual sal_Bool SetSize( sal_uLong nNewSize ); + virtual sal_uLong GetSize() const; virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ); virtual sal_Bool Commit(); virtual sal_Bool Revert(); @@ -179,7 +180,6 @@ public: virtual sal_Bool ValidateMode( StreamMode ) const; const SvStream* GetSvStream() const; virtual sal_Bool Equals( const BaseStorageStream& rStream ) const; - virtual sal_Size remainingSize(); }; class UCBStorageStream; @@ -267,12 +267,12 @@ public: virtual sal_uLong Tell(); virtual void Flush(); virtual sal_Bool SetSize( sal_uLong nNewSize ); + virtual sal_uLong GetSize() const; virtual sal_Bool CopyTo( BaseStorageStream * pDestStm ); virtual sal_Bool Commit(); virtual sal_Bool Revert(); virtual sal_Bool Validate( sal_Bool=sal_False ) const; virtual sal_Bool ValidateMode( StreamMode ) const; - virtual sal_Size remainingSize(); const SvStream* GetSvStream() const; virtual sal_Bool Equals( const BaseStorageStream& rStream ) const; sal_Bool SetProperty( const String& rName, const ::com::sun::star::uno::Any& rValue ); diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx index 4f4e991ae6ec..1f8b5bd66bce 100644 --- a/sot/source/sdstor/stg.cxx +++ b/sot/source/sdstor/stg.cxx @@ -234,13 +234,6 @@ sal_uLong StorageStream::Seek( sal_uLong n ) return n; } -sal_Size StorageStream::remainingSize() -{ - if( Validate() ) - return pEntry->GetSize() - Tell(); - return 0; -} - void StorageStream::Flush() { // Flushing means committing, since streams are never transacted @@ -259,6 +252,13 @@ sal_Bool StorageStream::SetSize( sal_uLong nNewSize ) return sal_False; } +sal_uLong StorageStream::GetSize() const +{ + if( Validate() ) + return pEntry->GetSize(); + return 0; +} + sal_Bool StorageStream::Commit() { if( !Validate() ) diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx index 67b270f33863..c4120bd488de 100644 --- a/sot/source/sdstor/storage.cxx +++ b/sot/source/sdstor/storage.cxx @@ -289,7 +289,7 @@ sal_uInt32 SotStorageStream::GetSize() const sal_Size SotStorageStream::remainingSize() { if (pOwnStm) - return pOwnStm->remainingSize(); + return pOwnStm->GetSize() - Tell(); return SvStream::remainingSize(); } diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx index 2a1a00047221..fd5761a2f384 100644 --- a/sot/source/sdstor/ucbstorage.cxx +++ b/sot/source/sdstor/ucbstorage.cxx @@ -1554,9 +1554,9 @@ sal_Bool UCBStorageStream::GetProperty( const String& rName, ::com::sun::star::u return sal_False; } -sal_Size UCBStorageStream::remainingSize() +sal_uLong UCBStorageStream::GetSize() const { - return pImp->GetSize() - Tell(); + return pImp->GetSize(); } UCBStorage::UCBStorage( SvStream& rStrm, sal_Bool bDirect ) |