summaryrefslogtreecommitdiff
path: root/basic/source/classes/image.cxx
diff options
context:
space:
mode:
authorKurt Zenker <kz@openoffice.org>2005-05-18 12:07:10 +0000
committerKurt Zenker <kz@openoffice.org>2005-05-18 12:07:10 +0000
commit0eb374f33decbb826582466bcea21402daf98169 (patch)
tree0c5e2e7b87a2003f0454e76f5c9ecc683359e268 /basic/source/classes/image.cxx
parent23b91acd622a2884533a8e9785d461e365c6bb46 (diff)
INTEGRATION: CWS abbin64k (1.13.10); FILE MERGED
2005/05/12 07:06:09 ab 1.13.10.1: #122688# Write/read B_EXTSOURCE records for modules >64K
Diffstat (limited to 'basic/source/classes/image.cxx')
-rw-r--r--basic/source/classes/image.cxx37
1 files changed, 34 insertions, 3 deletions
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx
index e0ba6a52bb9c..c187dd1c824b 100644
--- a/basic/source/classes/image.cxx
+++ b/basic/source/classes/image.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: image.cxx,v $
*
- * $Revision: 1.13 $
+ * $Revision: 1.14 $
*
- * last change: $Author: obo $ $Date: 2005-04-13 09:09:30 $
+ * last change: $Author: kz $ $Date: 2005-05-18 13:07:10 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -200,6 +200,18 @@ BOOL SbiImage::Load( SvStream& r )
//r >> aSource;
break;
}
+#ifdef EXTENDED_BINARY_MODULES
+ case B_EXTSOURCE:
+ {
+ for( UINT16 i = 0 ; i < nCount ; i++ )
+ {
+ String aTmp;
+ r.ReadByteString( aTmp, eCharSet );
+ aOUSource += aTmp;
+ }
+ break;
+ }
+#endif
case B_PCODE:
if( bBadVer ) break;
pCode = new char[ nLen ];
@@ -292,13 +304,32 @@ BOOL SbiImage::Save( SvStream& r )
nPos = SbiOpenRecord( r, B_SOURCE, 1 );
String aTmp;
sal_Int32 nLen = aOUSource.getLength();
+ const sal_Int32 nMaxUnitSize = STRING_MAXLEN - 1;
if( nLen > STRING_MAXLEN )
- aTmp = aOUSource.copy( 0, STRING_MAXLEN - 1 );
+ aTmp = aOUSource.copy( 0, nMaxUnitSize );
else
aTmp = aOUSource;
r.WriteByteString( aTmp, eCharSet );
//r << aSource;
SbiCloseRecord( r, nPos );
+
+#ifdef EXTENDED_BINARY_MODULES
+ if( nLen > STRING_MAXLEN )
+ {
+ sal_Int32 nRemainingLen = nLen - nMaxUnitSize;
+ UINT16 nUnitCount = UINT16( (nRemainingLen + nMaxUnitSize - 1) / nMaxUnitSize );
+ nPos = SbiOpenRecord( r, B_EXTSOURCE, nUnitCount );
+ for( UINT16 i = 0 ; i < nUnitCount ; i++ )
+ {
+ sal_Int32 nCopyLen =
+ (nRemainingLen > nMaxUnitSize) ? nMaxUnitSize : nRemainingLen;
+ String aTmp = aOUSource.copy( (i+1) * nMaxUnitSize, nCopyLen );
+ nRemainingLen -= nCopyLen;
+ r.WriteByteString( aTmp, eCharSet );
+ }
+ SbiCloseRecord( r, nPos );
+ }
+#endif
}
// Binaere Daten?
if( pCode && SbiGood( r ) )