diff options
author | Noel Grandin <noel@peralex.com> | 2014-01-08 08:48:26 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-01-10 13:26:24 +0000 |
commit | b69864f3f8c9be2e1f28f4b422074d2040b084a0 (patch) | |
tree | 93d51bc91257472198beffccb92188ceee61667d /basic | |
parent | de84529b55f5b295b089043a7119d6b0d8b92408 (diff) |
re-write SvStream operator<< to non-overloaded methods
This is the actual re-write.
Use a clang rewriter to rewrite SvStream::operator<< to methods
like WriteuInt32.
Note that the rewriter is not perfect, and I hand-tweaked the output.
In particular, I had to adjust places doing things like
(*this) << 1;
Change-Id: I5923eda3f4ebaa8b452b6ef109e726e116235a2a
Reviewed-on: https://gerrit.libreoffice.org/7342
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'basic')
-rw-r--r-- | basic/source/classes/image.cxx | 24 | ||||
-rw-r--r-- | basic/source/classes/sb.cxx | 2 | ||||
-rw-r--r-- | basic/source/classes/sbxmod.cxx | 16 | ||||
-rw-r--r-- | basic/source/runtime/iosys.cxx | 2 | ||||
-rw-r--r-- | basic/source/runtime/methods1.cxx | 26 | ||||
-rw-r--r-- | basic/source/sbx/sbxarray.cxx | 8 | ||||
-rw-r--r-- | basic/source/sbx/sbxbase.cxx | 20 | ||||
-rw-r--r-- | basic/source/sbx/sbxcoll.cxx | 2 | ||||
-rw-r--r-- | basic/source/sbx/sbxobj.cxx | 48 | ||||
-rw-r--r-- | basic/source/sbx/sbxvalue.cxx | 30 | ||||
-rw-r--r-- | basic/source/sbx/sbxvar.cxx | 22 |
11 files changed, 100 insertions, 100 deletions
diff --git a/basic/source/classes/image.cxx b/basic/source/classes/image.cxx index 66d79853c799..2cf81ae6e3b3 100644 --- a/basic/source/classes/image.cxx +++ b/basic/source/classes/image.cxx @@ -84,7 +84,7 @@ bool SbiGood( SvStream& r ) sal_uIntPtr SbiOpenRecord( SvStream& r, sal_uInt16 nSignature, sal_uInt16 nElem ) { sal_uIntPtr nPos = r.Tell(); - r << nSignature << (sal_Int32) 0 << nElem; + r.WriteUInt16( nSignature ).WriteInt32( (sal_Int32) 0 ).WriteUInt16( nElem ); return nPos; } @@ -93,7 +93,7 @@ void SbiCloseRecord( SvStream& r, sal_uIntPtr nOff ) { sal_uIntPtr nPos = r.Tell(); r.Seek( nOff + 2 ); - r << (sal_Int32) ( nPos - nOff - 8 ); + r.WriteInt32( (sal_Int32) ( nPos - nOff - 8 ) ); r.Seek( nPos ); } @@ -258,18 +258,18 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) eCharSet = GetSOStoreTextEncoding( eCharSet ); if ( bLegacy ) { - r << (sal_Int32) B_LEGACYVERSION; + r.WriteInt32( (sal_Int32) B_LEGACYVERSION ); } else { - r << (sal_Int32) B_CURVERSION; + r.WriteInt32( (sal_Int32) B_CURVERSION ); } - r << (sal_Int32) eCharSet - << (sal_Int32) nDimBase - << (sal_Int16) nFlags - << (sal_Int16) 0 - << (sal_Int32) 0 - << (sal_Int32) 0; + r .WriteInt32( (sal_Int32) eCharSet ) + .WriteInt32( (sal_Int32) nDimBase ) + .WriteInt16( (sal_Int16) nFlags ) + .WriteInt16( (sal_Int16) 0 ) + .WriteInt32( (sal_Int32) 0 ) + .WriteInt32( (sal_Int32) 0 ); // Name? if( !aName.isEmpty() && SbiGood( r ) ) @@ -321,7 +321,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) for( i = 0; i < nStrings && SbiGood( r ); i++ ) { - r << (sal_uInt32) pStringOff[ i ]; + r.WriteUInt32( (sal_uInt32) pStringOff[ i ] ); } // Then the String-Block char* pByteStrings = new char[ nStringSize ]; @@ -331,7 +331,7 @@ bool SbiImage::Save( SvStream& r, sal_uInt32 nVer ) OString aStr(OUStringToOString(OUString(pStrings + nOff), eCharSet)); memcpy( pByteStrings + nOff, aStr.getStr(), (aStr.getLength() + 1) * sizeof( char ) ); } - r << (sal_uInt32) nStringSize; + r.WriteUInt32( (sal_uInt32) nStringSize ); r.Write( pByteStrings, nStringSize ); delete[] pByteStrings; diff --git a/basic/source/classes/sb.cxx b/basic/source/classes/sb.cxx index 0e60e1b65fd0..84dac3f2c794 100644 --- a/basic/source/classes/sb.cxx +++ b/basic/source/classes/sb.cxx @@ -1932,7 +1932,7 @@ sal_Bool StarBASIC::StoreData( SvStream& r ) const { return sal_False; } - r << (sal_uInt16) pModules->Count(); + r.WriteUInt16( (sal_uInt16) pModules->Count() ); for( sal_uInt16 i = 0; i < pModules->Count(); i++ ) { SbModule* p = (SbModule*) pModules->Get( i ); diff --git a/basic/source/classes/sbxmod.cxx b/basic/source/classes/sbxmod.cxx index a3be564ab57a..9f283d5ce35b 100644 --- a/basic/source/classes/sbxmod.cxx +++ b/basic/source/classes/sbxmod.cxx @@ -1722,7 +1722,7 @@ sal_Bool SbModule::StoreData( SvStream& rStrm ) const pImage->aOUSource = aOUSource; pImage->aComment = aComment; pImage->aName = GetName(); - rStrm << (sal_uInt8) 1; + rStrm.WriteUChar( (sal_uInt8) 1 ); // # PCode is saved only for legacy formats only // It should be noted that it probably isn't necessary // It would be better not to store the image ( more flexible with @@ -1739,7 +1739,7 @@ sal_Bool SbModule::StoreData( SvStream& rStrm ) const aImg.aOUSource = aOUSource; aImg.aComment = aComment; aImg.aName = GetName(); - rStrm << (sal_uInt8) 1; + rStrm.WriteUChar( (sal_uInt8) 1 ); return aImg.Save( rStrm ); } } @@ -1862,7 +1862,7 @@ sal_Bool SbModule::StoreBinaryData( SvStream& rStrm, sal_uInt16 nVer ) pImage->aComment = aComment; pImage->aName = GetName(); - rStrm << (sal_uInt8) 1; + rStrm.WriteUChar( (sal_uInt8) 1 ); if ( nVer ) bRet = pImage->Save( rStrm, B_EXT_IMG_VERSION ); else @@ -2090,11 +2090,11 @@ sal_Bool SbMethod::StoreData( SvStream& rStrm ) const { if( !SbxMethod::StoreData( rStrm ) ) return sal_False; - rStrm << (sal_Int16) nDebugFlags - << (sal_Int16) nLine1 - << (sal_Int16) nLine2 - << (sal_Int16) nStart - << (sal_uInt8) bInvalid; + rStrm.WriteInt16( (sal_Int16) nDebugFlags ) + .WriteInt16( (sal_Int16) nLine1 ) + .WriteInt16( (sal_Int16) nLine2 ) + .WriteInt16( (sal_Int16) nStart ) + .WriteUChar( (sal_uInt8) bInvalid ); return sal_True; } diff --git a/basic/source/runtime/iosys.cxx b/basic/source/runtime/iosys.cxx index 511eb1176986..3e4b9bc79968 100644 --- a/basic/source/runtime/iosys.cxx +++ b/basic/source/runtime/iosys.cxx @@ -688,7 +688,7 @@ void SbiStream::ExpandFile() char c = 0; while( nDiff-- ) { - *pStrm << c; + pStrm->WriteChar( c ); } } else diff --git a/basic/source/runtime/methods1.cxx b/basic/source/runtime/methods1.cxx index bf5ea9624696..294584e5324e 100644 --- a/basic/source/runtime/methods1.cxx +++ b/basic/source/runtime/methods1.cxx @@ -993,9 +993,9 @@ static sal_Bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, case SbxBYTE: if( bIsVariant ) { - *pStrm << (sal_uInt16)SbxBYTE; // VarType Id + pStrm->WriteUInt16( (sal_uInt16)SbxBYTE ); // VarType Id } - *pStrm << rVar.GetByte(); + pStrm->WriteUChar( rVar.GetByte() ); break; case SbxEMPTY: @@ -1007,33 +1007,33 @@ static sal_Bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, case SbxUINT: if( bIsVariant ) { - *pStrm << (sal_uInt16)SbxINTEGER; // VarType Id + pStrm->WriteUInt16( (sal_uInt16)SbxINTEGER ); // VarType Id } - *pStrm << rVar.GetInteger(); + pStrm->WriteInt16( rVar.GetInteger() ); break; case SbxLONG: case SbxULONG: if( bIsVariant ) { - *pStrm << (sal_uInt16)SbxLONG; // VarType Id + pStrm->WriteUInt16( (sal_uInt16)SbxLONG ); // VarType Id } - *pStrm << rVar.GetLong(); + pStrm->WriteInt32( rVar.GetLong() ); break; case SbxSALINT64: case SbxSALUINT64: if( bIsVariant ) { - *pStrm << (sal_uInt16)SbxSALINT64; // VarType Id + pStrm->WriteUInt16( (sal_uInt16)SbxSALINT64 ); // VarType Id } - *pStrm << (sal_uInt64)rVar.GetInt64(); + pStrm->WriteUInt64( (sal_uInt64)rVar.GetInt64() ); break; case SbxSINGLE: if( bIsVariant ) { - *pStrm << (sal_uInt16)eType; // VarType Id + pStrm->WriteUInt16( (sal_uInt16)eType ); // VarType Id } - *pStrm << rVar.GetSingle(); + pStrm->WriteFloat( rVar.GetSingle() ); break; case SbxDOUBLE: @@ -1041,7 +1041,7 @@ static sal_Bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, case SbxDATE: if( bIsVariant ) { - *pStrm << (sal_uInt16)eType; // VarType Id + pStrm->WriteUInt16( (sal_uInt16)eType ); // VarType Id } *pStrm << rVar.GetDouble(); break; @@ -1054,7 +1054,7 @@ static sal_Bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, { if( bIsVariant ) { - *pStrm << (sal_uInt16)SbxSTRING; + pStrm->WriteUInt16( (sal_uInt16)SbxSTRING ); } pStrm->WriteUniOrByteString( rStr, osl_getThreadTextEncoding() ); } @@ -1063,7 +1063,7 @@ static sal_Bool lcl_WriteSbxVariable( const SbxVariable& rVar, SvStream* pStrm, // without any length information! without end-identifier! // What does that mean for Unicode?! Choosing conversion to ByteString... OString aByteStr(OUStringToOString(rStr, osl_getThreadTextEncoding())); - *pStrm << (const char*)aByteStr.getStr(); + pStrm->WriteCharPtr( (const char*)aByteStr.getStr() ); } } break; diff --git a/basic/source/sbx/sbxarray.cxx b/basic/source/sbx/sbxarray.cxx index ded3f2e3e42f..a25e46e24f3b 100644 --- a/basic/source/sbx/sbxarray.cxx +++ b/basic/source/sbx/sbxarray.cxx @@ -565,14 +565,14 @@ sal_Bool SbxArray::StoreData( SvStream& rStrm ) const if( p && !( p->GetFlags() & SBX_DONTSTORE ) ) nElem++; } - rStrm << (sal_uInt16) nElem; + rStrm.WriteUInt16( (sal_uInt16) nElem ); for( n = 0; n < pData->size(); n++ ) { SbxVariableRef* pRef = (*pData)[n]; SbxVariable* p = *pRef; if( p && !( p->GetFlags() & SBX_DONTSTORE ) ) { - rStrm << (sal_uInt16) n; + rStrm.WriteUInt16( (sal_uInt16) n ); if( !p->Store( rStrm ) ) return sal_False; } @@ -830,12 +830,12 @@ sal_Bool SbxDimArray::LoadData( SvStream& rStrm, sal_uInt16 nVer ) sal_Bool SbxDimArray::StoreData( SvStream& rStrm ) const { - rStrm << (sal_Int16) nDim; + rStrm.WriteInt16( (sal_Int16) nDim ); for( short i = 0; i < nDim; i++ ) { short lb, ub; GetDim( i, lb, ub ); - rStrm << (sal_Int16) lb << (sal_Int16) ub; + rStrm.WriteInt16( (sal_Int16) lb ).WriteInt16( (sal_Int16) ub ); } return SbxArray::StoreData( rStrm ); } diff --git a/basic/source/sbx/sbxbase.cxx b/basic/source/sbx/sbxbase.cxx index cc95d5b29fa8..05b84b2bdb1b 100644 --- a/basic/source/sbx/sbxbase.cxx +++ b/basic/source/sbx/sbxbase.cxx @@ -273,16 +273,16 @@ sal_Bool SbxBase::Store( SvStream& rStrm ) DBG_CHKTHIS( SbxBase, 0 ); if( !( nFlags & SBX_DONTSTORE ) ) { - rStrm << (sal_uInt32) GetCreator() - << (sal_uInt16) GetSbxId() - << (sal_uInt16) GetFlags() - << (sal_uInt16) GetVersion(); + rStrm.WriteUInt32( (sal_uInt32) GetCreator() ) + .WriteUInt16( (sal_uInt16) GetSbxId() ) + .WriteUInt16( (sal_uInt16) GetFlags() ) + .WriteUInt16( (sal_uInt16) GetVersion() ); sal_uIntPtr nOldPos = rStrm.Tell(); - rStrm << (sal_uInt32) 0L; + rStrm.WriteUInt32( (sal_uInt32) 0L ); sal_Bool bRes = StoreData( rStrm ); sal_uIntPtr nNewPos = rStrm.Tell(); rStrm.Seek( nOldPos ); - rStrm << (sal_uInt32) ( nNewPos - nOldPos ); + rStrm.WriteUInt32( (sal_uInt32) ( nNewPos - nOldPos ) ); rStrm.Seek( nNewPos ); if( rStrm.GetError() != SVSTREAM_OK ) bRes = sal_False; @@ -395,14 +395,14 @@ sal_Bool SbxInfo::StoreData( SvStream& rStrm ) const RTL_TEXTENCODING_ASCII_US ); write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aHelpFile, RTL_TEXTENCODING_ASCII_US); - rStrm << nHelpId << static_cast<sal_uInt16>(aParams.size()); + rStrm.WriteUInt32( nHelpId ).WriteUInt16( static_cast<sal_uInt16>(aParams.size()) ); for(SbxParams::const_iterator i = aParams.begin(); i != aParams.end(); ++i) { write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, i->aName, RTL_TEXTENCODING_ASCII_US); - rStrm << (sal_uInt16) i->eType - << (sal_uInt16) i->nFlags - << (sal_uInt32) i->nUserData; + rStrm.WriteUInt16( (sal_uInt16) i->eType ) + .WriteUInt16( (sal_uInt16) i->nFlags ) + .WriteUInt32( (sal_uInt32) i->nUserData ); } return sal_True; } diff --git a/basic/source/sbx/sbxcoll.cxx b/basic/source/sbx/sbxcoll.cxx index 581d98d2a976..d92b0f3f9d1a 100644 --- a/basic/source/sbx/sbxcoll.cxx +++ b/basic/source/sbx/sbxcoll.cxx @@ -316,7 +316,7 @@ sal_Bool SbxStdCollection::StoreData( SvStream& rStrm ) const { write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aElemClass, RTL_TEXTENCODING_ASCII_US); - rStrm << bAddRemoveOk; + rStrm.WriteUChar( bAddRemoveOk ); } return bRes; } diff --git a/basic/source/sbx/sbxobj.cxx b/basic/source/sbx/sbxobj.cxx index 46244abd3be7..5a0750f2161e 100644 --- a/basic/source/sbx/sbxobj.cxx +++ b/basic/source/sbx/sbxobj.cxx @@ -679,14 +679,14 @@ sal_Bool SbxObject::StoreData( SvStream& rStrm ) const write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aClassName, RTL_TEXTENCODING_ASCII_US); write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aDfltProp, RTL_TEXTENCODING_ASCII_US); sal_uIntPtr nPos = rStrm.Tell(); - rStrm << (sal_uInt32) 0L; + rStrm.WriteUInt32( (sal_uInt32) 0L ); if( !StorePrivateData( rStrm ) ) { return sal_False; } sal_uIntPtr nNew = rStrm.Tell(); rStrm.Seek( nPos ); - rStrm << (sal_uInt32) ( nNew - nPos ); + rStrm.WriteUInt32( (sal_uInt32) ( nNew - nPos ) ); rStrm.Seek( nNew ); if( !pMethods->Store( rStrm ) ) { @@ -809,7 +809,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill ) static sal_uInt16 nLevel = 0; if ( nLevel > 10 ) { - rStrm << "<too deep>" << endl; + rStrm.WriteCharPtr( "<too deep>" ) << endl; return; } ++nLevel; @@ -826,38 +826,38 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill ) // Output the data of the object itself OString aNameStr(OUStringToOString(GetName(), RTL_TEXTENCODING_ASCII_US)); OString aClassNameStr(OUStringToOString(aClassName, RTL_TEXTENCODING_ASCII_US)); - rStrm << "Object( " - << OString::number(reinterpret_cast<sal_Int64>(this)).getStr()<< "=='" - << ( aNameStr.isEmpty() ? "<unnamed>" : aNameStr.getStr() ) << "', " - << "of class '" << aClassNameStr.getStr() << "', " - << "counts " - << OString::number(GetRefCount()).getStr() - << " refs, "; + rStrm.WriteCharPtr( "Object( " ) + .WriteCharPtr( OString::number(reinterpret_cast<sal_Int64>(this)).getStr() ).WriteCharPtr( "=='" ) + .WriteCharPtr( aNameStr.isEmpty() ? "<unnamed>" : aNameStr.getStr() ).WriteCharPtr( "', " ) + .WriteCharPtr( "of class '" ).WriteCharPtr( aClassNameStr.getStr() ).WriteCharPtr( "', " ) + .WriteCharPtr( "counts " ) + .WriteCharPtr( OString::number(GetRefCount()).getStr() ) + .WriteCharPtr( " refs, " ); if ( GetParent() ) { OString aParentNameStr(OUStringToOString(GetName(), RTL_TEXTENCODING_ASCII_US)); - rStrm << "in parent " - << OString::number(reinterpret_cast<sal_Int64>(GetParent())).getStr() - << "=='" << ( aParentNameStr.isEmpty() ? "<unnamed>" : aParentNameStr.getStr() ) << "'"; + rStrm.WriteCharPtr( "in parent " ) + .WriteCharPtr( OString::number(reinterpret_cast<sal_Int64>(GetParent())).getStr() ) + .WriteCharPtr( "=='" ).WriteCharPtr( aParentNameStr.isEmpty() ? "<unnamed>" : aParentNameStr.getStr() ).WriteCharPtr( "'" ); } else { - rStrm << "no parent "; + rStrm.WriteCharPtr( "no parent " ); } - rStrm << " )" << endl; + rStrm.WriteCharPtr( " )" ) << endl; OString aIndentNameStr(OUStringToOString(aIndent, RTL_TEXTENCODING_ASCII_US)); - rStrm << aIndentNameStr.getStr() << "{" << endl; + rStrm.WriteCharPtr( aIndentNameStr.getStr() ).WriteCharPtr( "{" ) << endl; // Flags OUString aAttrs; if( CollectAttrs( this, aAttrs ) ) { OString aAttrStr(OUStringToOString(aAttrs, RTL_TEXTENCODING_ASCII_US)); - rStrm << aIndentNameStr.getStr() << "- Flags: " << aAttrStr.getStr() << endl; + rStrm.WriteCharPtr( aIndentNameStr.getStr() ).WriteCharPtr( "- Flags: " ).WriteCharPtr( aAttrStr.getStr() ) << endl; } // Methods - rStrm << aIndentNameStr.getStr() << "- Methods:" << endl; + rStrm.WriteCharPtr( aIndentNameStr.getStr() ).WriteCharPtr( "- Methods:" ) << endl; for( sal_uInt16 i = 0; i < pMethods->Count(); i++ ) { SbxVariableRef& r = pMethods->GetRef( i ); @@ -884,7 +884,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill ) pVar->GetValues_Impl().pObj != this && pVar->GetValues_Impl().pObj != GetParent() ) { - rStrm << " contains "; + rStrm.WriteCharPtr( " contains " ); ((SbxObject*) pVar->GetValues_Impl().pObj)->Dump( rStrm, bFill ); } else @@ -895,7 +895,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill ) } // Properties - rStrm << aIndentNameStr.getStr() << "- Properties:" << endl; + rStrm.WriteCharPtr( aIndentNameStr.getStr() ).WriteCharPtr( "- Properties:" ) << endl; { for( sal_uInt16 i = 0; i < pProps->Count(); i++ ) { @@ -923,7 +923,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill ) pVar->GetValues_Impl().pObj != this && pVar->GetValues_Impl().pObj != GetParent() ) { - rStrm << " contains "; + rStrm.WriteCharPtr( " contains " ); ((SbxObject*) pVar->GetValues_Impl().pObj)->Dump( rStrm, bFill ); } else @@ -935,7 +935,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill ) } // Objects - rStrm << aIndentNameStr.getStr() << "- Objects:" << endl; + rStrm.WriteCharPtr( aIndentNameStr.getStr() ).WriteCharPtr( "- Objects:" ) << endl; { for( sal_uInt16 i = 0; i < pObjs->Count(); i++ ) { @@ -943,7 +943,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill ) SbxVariable* pVar = r; if ( pVar ) { - rStrm << aIndentNameStr.getStr() << " - Sub"; + rStrm.WriteCharPtr( aIndentNameStr.getStr() ).WriteCharPtr( " - Sub" ); if ( pVar->ISA(SbxObject) ) { ((SbxObject*) pVar)->Dump( rStrm, bFill ); @@ -956,7 +956,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill ) } } - rStrm << aIndentNameStr.getStr() << "}" << endl << endl; + rStrm.WriteCharPtr( aIndentNameStr.getStr() ).WriteCharPtr( "}" ) << endl << endl; --nLevel; } diff --git a/basic/source/sbx/sbxvalue.cxx b/basic/source/sbx/sbxvalue.cxx index 816cb9bcadfb..019834fa35eb 100644 --- a/basic/source/sbx/sbxvalue.cxx +++ b/basic/source/sbx/sbxvalue.cxx @@ -1557,14 +1557,14 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) sal_Bool SbxValue::StoreData( SvStream& r ) const { sal_uInt16 nType = sal::static_int_cast< sal_uInt16 >(aData.eType); - r << nType; + r.WriteUInt16( nType ); switch( nType & 0x0FFF ) { case SbxBOOL: case SbxINTEGER: - r << aData.nInteger; break; + r.WriteInt16( aData.nInteger ); break; case SbxLONG: - r << aData.nLong; break; + r.WriteInt32( aData.nLong ); break; case SbxDATE: // #49935: Save as double, otherwise an error during the read in ((SbxValue*)this)->aData.eType = (SbxDataType)( ( nType & 0xF000 ) | SbxDOUBLE ); @@ -1578,13 +1578,13 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) case SbxSALUINT64: case SbxSALINT64: // see comment in SbxValue::StoreData - r << aData.uInt64; + r.WriteUInt64( aData.uInt64 ); break; case SbxCURRENCY: { sal_Int32 tmpHi = ( (aData.nInt64 >> 32) & 0xFFFFFFFF ); sal_Int32 tmpLo = ( sal_Int32 )aData.nInt64; - r << tmpHi << tmpLo; + r.WriteInt32( tmpHi ).WriteInt32( tmpLo ); break; } case SbxSTRING: @@ -1599,42 +1599,42 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) break; case SbxERROR: case SbxUSHORT: - r << aData.nUShort; break; + r.WriteUInt16( aData.nUShort ); break; case SbxOBJECT: // to save itself as Objectptr does not work! if( aData.pObj ) { if( PTR_CAST(SbxValue,aData.pObj) != this ) { - r << (sal_uInt8) 1; + r.WriteUChar( (sal_uInt8) 1 ); return aData.pObj->Store( r ); } else - r << (sal_uInt8) 2; + r.WriteUChar( (sal_uInt8) 2 ); } else - r << (sal_uInt8) 0; + r.WriteUChar( (sal_uInt8) 0 ); break; case SbxCHAR: { char c = sal::static_int_cast< char >(aData.nChar); - r << c; + r.WriteChar( c ); break; } case SbxBYTE: - r << aData.nByte; break; + r.WriteUChar( aData.nByte ); break; case SbxULONG: - r << aData.nULong; break; + r.WriteUInt32( aData.nULong ); break; case SbxINT: { sal_uInt8 n = SAL_TYPES_SIZEOFINT; - r << n << (sal_Int32)aData.nInt; + r.WriteUChar( n ).WriteInt32( (sal_Int32)aData.nInt ); break; } case SbxUINT: { sal_uInt8 n = SAL_TYPES_SIZEOFINT; - r << n << (sal_uInt32)aData.nUInt; + r.WriteUChar( n ).WriteUInt32( (sal_uInt32)aData.nUInt ); break; } case SbxEMPTY: @@ -1642,7 +1642,7 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 ) case SbxVOID: break; case SbxDATAOBJECT: - r << aData.nLong; + r.WriteInt32( aData.nLong ); break; // #78919 For backwards compatibility case SbxWSTRING: diff --git a/basic/source/sbx/sbxvar.cxx b/basic/source/sbx/sbxvar.cxx index 1ea22a8d3713..d20ab4a1bc56 100644 --- a/basic/source/sbx/sbxvar.cxx +++ b/basic/source/sbx/sbxvar.cxx @@ -618,7 +618,7 @@ sal_Bool SbxVariable::LoadData( SvStream& rStrm, sal_uInt16 nVer ) sal_Bool SbxVariable::StoreData( SvStream& rStrm ) const { - rStrm << (sal_uInt8) 0xFF; // Marker + rStrm.WriteUChar( (sal_uInt8) 0xFF ); // Marker sal_Bool bValStore; if( this->IsA( TYPE(SbxMethod) ) ) { @@ -646,15 +646,15 @@ sal_Bool SbxVariable::StoreData( SvStream& rStrm ) const } write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, maName, RTL_TEXTENCODING_ASCII_US); - rStrm << (sal_uInt32)nUserData; + rStrm.WriteUInt32( (sal_uInt32)nUserData ); if( pInfo.Is() ) { - rStrm << (sal_uInt8) 2; // Version 2: with UserData! + rStrm.WriteUChar( (sal_uInt8) 2 ); // Version 2: with UserData! pInfo->StoreData( rStrm ); } else { - rStrm << (sal_uInt8) 0; + rStrm.WriteUChar( (sal_uInt8) 0 ); } // Save private data only, if it is a SbxVariable if( GetClass() == SbxCLASS_VARIABLE ) @@ -736,19 +736,19 @@ void SbxAlias::SFX_NOTIFY( SfxBroadcaster&, const TypeId&, void SbxVariable::Dump( SvStream& rStrm, sal_Bool bFill ) { OString aBNameStr(OUStringToOString(GetName( SbxNAME_SHORT_TYPES ), RTL_TEXTENCODING_ASCII_US)); - rStrm << "Variable( " - << OString::number(reinterpret_cast<sal_Int64>(this)).getStr() << "==" - << aBNameStr.getStr(); + rStrm.WriteCharPtr( "Variable( " ) + .WriteCharPtr( OString::number(reinterpret_cast<sal_Int64>(this)).getStr() ).WriteCharPtr( "==" ) + .WriteCharPtr( aBNameStr.getStr() ); OString aBParentNameStr(OUStringToOString(GetParent()->GetName(), RTL_TEXTENCODING_ASCII_US)); if ( GetParent() ) { - rStrm << " in parent '" << aBParentNameStr.getStr() << "'"; + rStrm.WriteCharPtr( " in parent '" ).WriteCharPtr( aBParentNameStr.getStr() ).WriteCharPtr( "'" ); } else { - rStrm << " no parent"; + rStrm.WriteCharPtr( " no parent" ); } - rStrm << " ) "; + rStrm.WriteCharPtr( " ) " ); // output also the object at object-vars if ( GetValues_Impl().eType == SbxOBJECT && @@ -756,7 +756,7 @@ void SbxVariable::Dump( SvStream& rStrm, sal_Bool bFill ) GetValues_Impl().pObj != this && GetValues_Impl().pObj != GetParent() ) { - rStrm << " contains "; + rStrm.WriteCharPtr( " contains " ); ((SbxObject*) GetValues_Impl().pObj)->Dump( rStrm, bFill ); } else |