summaryrefslogtreecommitdiff
path: root/sot/source/sdstor/stgdir.cxx
diff options
context:
space:
mode:
authorMathias Bauer <mba@openoffice.org>2000-11-20 11:56:37 +0000
committerMathias Bauer <mba@openoffice.org>2000-11-20 11:56:37 +0000
commit9b86f6942b96f5513be53ed5b033657c5267a778 (patch)
treee48ac52a3e08b5ca4ed978ecf20bf34ac4e9fbb9 /sot/source/sdstor/stgdir.cxx
parent066f06e8cab65ff100d0986565c0884474999f1e (diff)
#80466#: new Copy method to support new JAR storages
Diffstat (limited to 'sot/source/sdstor/stgdir.cxx')
-rw-r--r--sot/source/sdstor/stgdir.cxx29
1 files changed, 27 insertions, 2 deletions
diff --git a/sot/source/sdstor/stgdir.cxx b/sot/source/sdstor/stgdir.cxx
index c5f4db205021..d71d38e4a2d3 100644
--- a/sot/source/sdstor/stgdir.cxx
+++ b/sot/source/sdstor/stgdir.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: stgdir.cxx,v $
*
- * $Revision: 1.1.1.1 $
+ * $Revision: 1.2 $
*
- * last change: $Author: hr $ $Date: 2000-09-18 16:56:51 $
+ * last change: $Author: mba $ $Date: 2000-11-20 12:56:37 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -519,6 +519,31 @@ void StgDirEntry::Copy( StgDirEntry& rDest )
}
}
+void StgDirEntry::Copy( BaseStorageStream& rDest )
+{
+ INT32 n = GetSize();
+ if( rDest.SetSize( n ) && n )
+ {
+ ULONG nPos = rDest.Tell();
+ void* p = new BYTE[ 4096 ];
+ Seek( 0L );
+ rDest.Seek( 0L );
+ while( n )
+ {
+ INT32 nn = n;
+ if( nn > 4096 )
+ nn = 4096;
+ if( Read( p, nn ) != nn )
+ break;
+ if( rDest.Write( p, nn ) != nn )
+ break;
+ n -= nn;
+ }
+ delete p;
+ rDest.Seek( nPos ); // ?! Seems to be undocumented !
+ }
+}
+
// Commit this entry
BOOL StgDirEntry::Commit()