summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2011-12-21 10:30:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2011-12-21 10:30:10 +0000
commit6708977331c933b3483b9fe5f66d981b51fd8d49 (patch)
tree150a2ad7ed1b49df70ee7c814edf60d5147c043d /vcl
parentfffae28952f20fed693df4de8b8645cf0aedabfa (diff)
needs more work first
This reverts commit 92f396733ebc518bcb7a9eae2dd3169d333b82b9.
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/gdi/animate.cxx6
-rw-r--r--vcl/source/gdi/cvtsvm.cxx11
-rw-r--r--vcl/source/gdi/jobset.cxx18
-rw-r--r--vcl/source/gdi/metaact.cxx9
4 files changed, 21 insertions, 23 deletions
diff --git a/vcl/source/gdi/animate.cxx b/vcl/source/gdi/animate.cxx
index 636df96a6c66..30a23372661c 100644
--- a/vcl/source/gdi/animate.cxx
+++ b/vcl/source/gdi/animate.cxx
@@ -795,6 +795,7 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
if( nCount )
{
+ const ByteString aDummyStr;
const sal_uInt32 nDummy32 = 0UL;
// Falls keine BitmapEx gesetzt wurde, schreiben wir
@@ -824,7 +825,7 @@ SvStream& operator<<( SvStream& rOStm, const Animation& rAnimation )
rOStm << nDummy32; // unbenutzt
rOStm << nDummy32; // unbenutzt
rOStm << nDummy32; // unbenutzt
- write_lenPrefixed_uInt8s_FromOString(rOStm, rtl::OString()); // dummy
+ rOStm.WriteByteString(aDummyStr); // unbenutzt
rOStm << nRest; // Anzahl der Strukturen, die noch _folgen_
}
}
@@ -871,6 +872,7 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
{
AnimationBitmap aAnimBmp;
BitmapEx aBmpEx;
+ ByteString aDummyStr;
sal_uInt32 nTmp32;
sal_uInt16 nTmp16;
sal_uInt8 cTmp;
@@ -888,7 +890,7 @@ SvStream& operator>>( SvStream& rIStm, Animation& rAnimation )
rIStm >> nTmp32; // unbenutzt
rIStm >> nTmp32; // unbenutzt
rIStm >> nTmp32; // unbenutzt
- read_lenPrefixed_uInt8s_ToOString(rIStm); // unbenutzt
+ rIStm.ReadByteString(aDummyStr); // unbenutzt
rIStm >> nTmp16; // Rest zu lesen
rAnimation.Insert( aAnimBmp );
diff --git a/vcl/source/gdi/cvtsvm.cxx b/vcl/source/gdi/cvtsvm.cxx
index 738a5907172b..7efd1f6f6e82 100644
--- a/vcl/source/gdi/cvtsvm.cxx
+++ b/vcl/source/gdi/cvtsvm.cxx
@@ -877,7 +877,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
rIStm >> aPt >> nIndex >> nLen >> nTmp;
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
{
- rtl::OString aByteStr = read_uInt8s_ToOString(rIStm, nTmp);
+ rtl::OString aByteStr = read_uInt8s_AsOString(rIStm, nTmp);
sal_uInt8 nTerminator = 0;
rIStm >> nTerminator;
DBG_ASSERT( nTerminator == 0, "expected string to be NULL terminated" );
@@ -899,7 +899,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
rIStm >> aPt >> nIndex >> nLen >> nTmp >> nAryLen;
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_UINT16 - 1 ) ) )
{
- rtl::OString aByteStr = read_uInt8s_ToOString(rIStm, nTmp);
+ rtl::OString aByteStr = read_uInt8s_AsOString(rIStm, nTmp);
sal_uInt8 nTerminator = 0;
rIStm >> nTerminator;
DBG_ASSERT( nTerminator == 0, "expected string to be NULL terminated" );
@@ -962,7 +962,7 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
rIStm >> aPt >> nIndex >> nLen >> nTmp >> nWidth;
if ( nTmp && ( static_cast< sal_uInt32 >( nTmp ) < ( SAL_MAX_INT16 - 1 ) ) )
{
- rtl::OString aByteStr = read_uInt8s_ToOString(rIStm, nTmp);
+ rtl::OString aByteStr = read_uInt8s_AsOString(rIStm, nTmp);
sal_uInt8 nTerminator = 0;
rIStm >> nTerminator;
DBG_ASSERT( nTerminator == 0, "expected string to be NULL terminated" );
@@ -1322,12 +1322,13 @@ void SVMConverter::ImplConvertFromSVM1( SvStream& rIStm, GDIMetaFile& rMtf )
case( GDI_COMMENT_COMMENT ):
{
+ ByteString aComment;
sal_Int32 nValue;
sal_uInt32 nDataSize;
sal_uInt8* pData;
sal_Int32 nFollowingActionCount;
- rtl::OString aComment = read_lenPrefixed_uInt8s_ToOString(rIStm);
+ rIStm.ReadByteString(aComment);
rIStm >> nValue >> nDataSize;
if( nDataSize )
@@ -2412,7 +2413,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
rOStm.SeekRel( 4 );
// write data
- write_lenPrefixed_uInt8s_FromOString(rOStm, pA->GetComment());
+ rOStm.WriteByteString(pA->GetComment());
rOStm << pA->GetValue() << nDataSize;
if( nDataSize )
diff --git a/vcl/source/gdi/jobset.cxx b/vcl/source/gdi/jobset.cxx
index 796659cfdaa5..14b86b236068 100644
--- a/vcl/source/gdi/jobset.cxx
+++ b/vcl/source/gdi/jobset.cxx
@@ -410,21 +410,13 @@ SvStream& operator<<( SvStream& rOStream, const JobSetup& rJobSetup )
rOStream.WriteByteString( it->first, RTL_TEXTENCODING_UTF8 );
rOStream.WriteByteString( it->second, RTL_TEXTENCODING_UTF8 );
}
- write_lenPrefixed_uInt8s_FromOString(rOStream, "COMPAT_DUPLEX_MODE");
+ rOStream.WriteByteString( "COMPAT_DUPLEX_MODE" ) ;
switch( pJobData->meDuplexMode )
{
- case DUPLEX_UNKNOWN:
- write_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_UNKNOWN");
- break;
- case DUPLEX_OFF:
- write_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_OFF");
- break;
- case DUPLEX_SHORTEDGE:
- write_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_SHORTEDGE");
- break;
- case DUPLEX_LONGEDGE:
- write_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_LONGEDGE");
- break;
+ case DUPLEX_UNKNOWN: rOStream.WriteByteString( "DUPLEX_UNKNOWN" );break;
+ case DUPLEX_OFF: rOStream.WriteByteString( "DUPLEX_OFF" );break;
+ case DUPLEX_SHORTEDGE: rOStream.WriteByteString( "DUPLEX_SHORTEDGE" );break;
+ case DUPLEX_LONGEDGE: rOStream.WriteByteString( "DUPLEX_LONGEDGE" );break;
}
nLen = sal::static_int_cast<sal_uInt16>(rOStream.Tell() - nPos);
rOStream.Seek( nPos );
diff --git a/vcl/source/gdi/metaact.cxx b/vcl/source/gdi/metaact.cxx
index 9961705cbb6c..a0b6c3b27c6b 100644
--- a/vcl/source/gdi/metaact.cxx
+++ b/vcl/source/gdi/metaact.cxx
@@ -4198,7 +4198,7 @@ sal_Bool MetaCommentAction::Compare( const MetaAction& rMetaAction ) const
void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{
WRITE_BASE_COMPAT( rOStm, 1, pData );
- write_lenPrefixed_uInt8s_FromOString(rOStm, maComment);
+ rOStm.WriteByteString(maComment);
rOStm << mnValue << mnDataSize;
if ( mnDataSize )
@@ -4210,10 +4210,13 @@ void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
void MetaCommentAction::Read( SvStream& rIStm, ImplMetaReadData* )
{
COMPAT( rIStm );
- maComment = read_lenPrefixed_uInt8s_ToOString(rIStm);
+ ByteString sTmp;
+ rIStm.ReadByteString(sTmp);
+ maComment = sTmp;
rIStm >> mnValue >> mnDataSize;
- delete[] mpData;
+ if( mpData )
+ delete[] mpData;
if( mnDataSize )
{