remove SvStream::operator<< methods

.. and convert the last few places still using those methods.

Change-Id: Id2cd8f9c0dd281df43af439d4fef65881f34a6fd
Reviewed-on: https://gerrit.libreoffice.org/7495
Tested-by: LibreOffice gerrit bot <gerrit@libreoffice.org>
Reviewed-by: Michael Stahl <mstahl@redhat.com>
This commit is contained in:
Noel Grandin 2014-01-17 08:48:50 +02:00 committed by Michael Stahl
parent d803483f6a
commit 16a2e90335
40 changed files with 135 additions and 202 deletions

View File

@ -391,14 +391,14 @@ sal_Bool SbxInfo::LoadData( SvStream& rStrm, sal_uInt16 nVer )
sal_Bool SbxInfo::StoreData( SvStream& rStrm ) const sal_Bool SbxInfo::StoreData( SvStream& rStrm ) const
{ {
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aComment, write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aComment,
RTL_TEXTENCODING_ASCII_US ); RTL_TEXTENCODING_ASCII_US );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aHelpFile, write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aHelpFile,
RTL_TEXTENCODING_ASCII_US); RTL_TEXTENCODING_ASCII_US);
rStrm.WriteUInt32( nHelpId ).WriteUInt16( 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) for(SbxParams::const_iterator i = aParams.begin(); i != aParams.end(); ++i)
{ {
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, i->aName, write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, i->aName,
RTL_TEXTENCODING_ASCII_US); RTL_TEXTENCODING_ASCII_US);
rStrm.WriteUInt16( (sal_uInt16) i->eType ) rStrm.WriteUInt16( (sal_uInt16) i->eType )
.WriteUInt16( (sal_uInt16) i->nFlags ) .WriteUInt16( (sal_uInt16) i->nFlags )

View File

@ -314,7 +314,7 @@ sal_Bool SbxStdCollection::StoreData( SvStream& rStrm ) const
sal_Bool bRes = SbxCollection::StoreData( rStrm ); sal_Bool bRes = SbxCollection::StoreData( rStrm );
if( bRes ) if( bRes )
{ {
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aElemClass, write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aElemClass,
RTL_TEXTENCODING_ASCII_US); RTL_TEXTENCODING_ASCII_US);
rStrm.WriteUChar( bAddRemoveOk ); rStrm.WriteUChar( bAddRemoveOk );
} }

View File

@ -676,8 +676,8 @@ sal_Bool SbxObject::StoreData( SvStream& rStrm ) const
{ {
aDfltProp = pDfltProp->GetName(); aDfltProp = pDfltProp->GetName();
} }
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aClassName, RTL_TEXTENCODING_ASCII_US); write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aClassName, RTL_TEXTENCODING_ASCII_US);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aDfltProp, RTL_TEXTENCODING_ASCII_US); write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aDfltProp, RTL_TEXTENCODING_ASCII_US);
sal_uIntPtr nPos = rStrm.Tell(); sal_uIntPtr nPos = rStrm.Tell();
rStrm.WriteUInt32( (sal_uInt32) 0L ); rStrm.WriteUInt32( (sal_uInt32) 0L );
if( !StorePrivateData( rStrm ) ) if( !StorePrivateData( rStrm ) )
@ -876,7 +876,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
{ {
aLine += " !! Not a Method !!"; aLine += " !! Not a Method !!";
} }
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aLine, RTL_TEXTENCODING_ASCII_US); write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aLine, RTL_TEXTENCODING_ASCII_US);
// Output also the object at object-methods // Output also the object at object-methods
if ( pVar->GetValues_Impl().eType == SbxOBJECT && if ( pVar->GetValues_Impl().eType == SbxOBJECT &&
@ -915,7 +915,7 @@ void SbxObject::Dump( SvStream& rStrm, sal_Bool bFill )
{ {
aLine += " !! Not a Property !!"; aLine += " !! Not a Property !!";
} }
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, aLine, RTL_TEXTENCODING_ASCII_US); write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, aLine, RTL_TEXTENCODING_ASCII_US);
// output also the object at object properties // output also the object at object properties
if ( pVar->GetValues_Impl().eType == SbxOBJECT && if ( pVar->GetValues_Impl().eType == SbxOBJECT &&

View File

@ -1568,12 +1568,12 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
case SbxDATE: case SbxDATE:
// #49935: Save as double, otherwise an error during the read in // #49935: Save as double, otherwise an error during the read in
((SbxValue*)this)->aData.eType = (SbxDataType)( ( nType & 0xF000 ) | SbxDOUBLE ); ((SbxValue*)this)->aData.eType = (SbxDataType)( ( nType & 0xF000 ) | SbxDOUBLE );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(r, GetCoreString(), RTL_TEXTENCODING_ASCII_US); write_uInt16_lenPrefixed_uInt8s_FromOUString(r, GetCoreString(), RTL_TEXTENCODING_ASCII_US);
((SbxValue*)this)->aData.eType = (SbxDataType)nType; ((SbxValue*)this)->aData.eType = (SbxDataType)nType;
break; break;
case SbxSINGLE: case SbxSINGLE:
case SbxDOUBLE: case SbxDOUBLE:
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(r, GetCoreString(), RTL_TEXTENCODING_ASCII_US); write_uInt16_lenPrefixed_uInt8s_FromOUString(r, GetCoreString(), RTL_TEXTENCODING_ASCII_US);
break; break;
case SbxSALUINT64: case SbxSALUINT64:
case SbxSALINT64: case SbxSALINT64:
@ -1590,11 +1590,11 @@ sal_Bool SbxValue::LoadData( SvStream& r, sal_uInt16 )
case SbxSTRING: case SbxSTRING:
if( aData.pOUString ) if( aData.pOUString )
{ {
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(r, *aData.pOUString, RTL_TEXTENCODING_ASCII_US); write_uInt16_lenPrefixed_uInt8s_FromOUString(r, *aData.pOUString, RTL_TEXTENCODING_ASCII_US);
} }
else else
{ {
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(r, OUString(), RTL_TEXTENCODING_ASCII_US); write_uInt16_lenPrefixed_uInt8s_FromOUString(r, OUString(), RTL_TEXTENCODING_ASCII_US);
} }
break; break;
case SbxERROR: case SbxERROR:

View File

@ -644,7 +644,7 @@ sal_Bool SbxVariable::StoreData( SvStream& rStrm ) const
{ {
return sal_False; return sal_False;
} }
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, maName, write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, maName,
RTL_TEXTENCODING_ASCII_US); RTL_TEXTENCODING_ASCII_US);
rStrm.WriteUInt32( (sal_uInt32)nUserData ); rStrm.WriteUInt32( (sal_uInt32)nUserData );
if( pInfo.Is() ) if( pInfo.Is() )

View File

@ -641,9 +641,9 @@ const char OHTMLImportExport::sIndentSource[nIndentMax+1] = "\t\t\t\t\t\t\t\t\t\
// Macros for HTML-Export // Macros for HTML-Export
#define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag ) #define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag )
#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag, sal_False ) #define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( (*m_pStream), tag, sal_False )
#define OUT_LF() (*m_pStream) << SAL_NEWLINE_STRING << GetIndentStr() #define OUT_LF() m_pStream->WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() )
#define TAG_ON_LF( tag ) (TAG_ON( tag ) << SAL_NEWLINE_STRING << GetIndentStr()) #define TAG_ON_LF( tag ) (TAG_ON( tag ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ))
#define TAG_OFF_LF( tag ) (TAG_OFF( tag ) << SAL_NEWLINE_STRING << GetIndentStr()) #define TAG_OFF_LF( tag ) (TAG_OFF( tag ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ))
OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataDescriptor, OHTMLImportExport::OHTMLImportExport(const ::svx::ODataAccessDescriptor& _aDataDescriptor,
const Reference< XComponentContext >& _rM, const Reference< XComponentContext >& _rM,

View File

@ -1215,10 +1215,10 @@ void EditTextObjectImpl::StoreData( SvStream& rOStream ) const
// Convert CH_FEATURE to CH_FEATURE_OLD // Convert CH_FEATURE to CH_FEATURE_OLD
OString aText = aBuffer.makeStringAndClear().replace(cFeatureConverted, CH_FEATURE_OLD); OString aText = aBuffer.makeStringAndClear().replace(cFeatureConverted, CH_FEATURE_OLD);
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStream, aText); write_uInt16_lenPrefixed_uInt8s_FromOString(rOStream, aText);
// StyleName and Family... // StyleName and Family...
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStream, rC.GetStyle(), eEncoding); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStream, rC.GetStyle(), eEncoding);
rOStream.WriteUInt16( static_cast<sal_uInt16>(rC.GetFamily()) ); rOStream.WriteUInt16( static_cast<sal_uInt16>(rC.GetFamily()) );
// Paragraph attributes ... // Paragraph attributes ...

View File

@ -847,8 +847,8 @@ uno::Sequence< sal_Int8 > ScannerManager::getDIB() throw()
sal_Int8* pBuf = aRet.getArray(); sal_Int8* pBuf = aRet.getArray();
SvMemoryStream* pMemStm = new SvMemoryStream( (char*) pBuf, sizeof( BITMAPFILEHEADER ), STREAM_WRITE ); SvMemoryStream* pMemStm = new SvMemoryStream( (char*) pBuf, sizeof( BITMAPFILEHEADER ), STREAM_WRITE );
*pMemStm << 'B' << 'M' << (sal_uInt32) 0 << (sal_uInt32) 0; pMemStm->WriteChar( 'B' ).WriteChar( 'M' ).WriteUInt32( 0 ).WriteUInt32( 0 );
*pMemStm << (sal_uInt32) ( sizeof( BITMAPFILEHEADER ) + pBIH->biSize + ( nColEntries * sizeof( RGBQUAD ) ) ); pMemStm->WriteUInt32( sizeof( BITMAPFILEHEADER ) + pBIH->biSize + ( nColEntries * sizeof( RGBQUAD ) ) );
delete pMemStm; delete pMemStm;
memcpy( pBuf + sizeof( BITMAPFILEHEADER ), pBIH, nDIBSize ); memcpy( pBuf + sizeof( BITMAPFILEHEADER ), pBIH, nDIBSize );

View File

@ -63,7 +63,7 @@ public:
sal_Bool IsSet() const { return bSet; } sal_Bool IsSet() const { return bSet; }
friend SvStream& WriteSvint(SvStream & rStm, const Svint & r ) friend SvStream& WriteSvint(SvStream & rStm, const Svint & r )
{ SvUINT32::Write( rStm, (sal_uInt32)r.nVal ); rStm << r.bSet; return rStm; } { SvUINT32::Write( rStm, (sal_uInt32)r.nVal ); rStm.WriteUInt8( r.bSet ); return rStm; }
friend SvStream& operator >> (SvStream & rStm, Svint & r ) friend SvStream& operator >> (SvStream & rStm, Svint & r )
{ r.nVal = (int)SvUINT32::Read( rStm ); rStm >> r.bSet ; return rStm; } { r.nVal = (int)SvUINT32::Read( rStm ); rStm >> r.bSet ; return rStm; }
}; };

View File

@ -214,7 +214,7 @@ sal_Bool SvIdentifier::WriteSvIdl( SvStringHashEntry * pName,
SvStream& WriteSvIdentifier(SvStream & rStm, const SvIdentifier & r ) SvStream& WriteSvIdentifier(SvStream & rStm, const SvIdentifier & r )
{ {
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, r.getString()); write_uInt16_lenPrefixed_uInt8s_FromOString(rStm, r.getString());
return rStm; return rStm;
} }
@ -327,7 +327,7 @@ sal_Bool SvString::WriteSvIdl( SvStringHashEntry * pName, SvStream & rOutStm,
SvStream& WriteSvString(SvStream & rStm, const SvString & r ) SvStream& WriteSvString(SvStream & rStm, const SvString & r )
{ {
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, r.getString()); write_uInt16_lenPrefixed_uInt8s_FromOString(rStm, r.getString());
return rStm; return rStm;
} }

View File

@ -82,9 +82,9 @@ void SvMetaModule::Save( SvPersistStream & rStm )
WriteSvDeclPersistList( rStm, aAttrList ); WriteSvDeclPersistList( rStm, aAttrList );
// browser // browser
rStm.WriteUniOrByteString( aIdlFileName, rStm.GetStreamCharSet() ); rStm.WriteUniOrByteString( aIdlFileName, rStm.GetStreamCharSet() );
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, aHelpFileName.getString()); write_uInt16_lenPrefixed_uInt8s_FromOString(rStm, aHelpFileName.getString());
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, aSlotIdFile.getString()); write_uInt16_lenPrefixed_uInt8s_FromOString(rStm, aSlotIdFile.getString());
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, aModulePrefix.getString()); write_uInt16_lenPrefixed_uInt8s_FromOString(rStm, aModulePrefix.getString());
// write compiler data // write compiler data
sal_uInt16 nCmpLen = 0; sal_uInt16 nCmpLen = 0;

View File

@ -64,7 +64,7 @@ void SvClassElement::Save( SvPersistStream & rStm )
// write data // write data
rStm.WriteUChar( nMask ); rStm.WriteUChar( nMask );
if( nMask & 0x01 ) rStm.WriteUChar( aAutomation ); if( nMask & 0x01 ) rStm.WriteUChar( aAutomation );
if( nMask & 0x02 ) write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, aPrefix); if( nMask & 0x02 ) write_uInt16_lenPrefixed_uInt8s_FromOString(rStm, aPrefix);
if( nMask & 0x04 ) WriteSvPersistBase( rStm, xClass ); if( nMask & 0x04 ) WriteSvPersistBase( rStm, xClass );
} }

View File

@ -1784,7 +1784,7 @@ void SvMetaEnumValue::Save( SvPersistStream & rStm )
// write data // write data
rStm.WriteUChar( nMask ); rStm.WriteUChar( nMask );
if( nMask & 0x01 ) write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, aEnumValue); if( nMask & 0x01 ) write_uInt16_lenPrefixed_uInt8s_FromOString(rStm, aEnumValue);
} }
sal_Bool SvMetaEnumValue::ReadSvIdl( SvIdlDataBase & rBase, sal_Bool SvMetaEnumValue::ReadSvIdl( SvIdlDataBase & rBase,
@ -1843,7 +1843,7 @@ void SvMetaTypeEnum::Save( SvPersistStream & rStm )
// write data // write data
rStm.WriteUChar( nMask ); rStm.WriteUChar( nMask );
if( nMask & 0x01 ) WriteSvDeclPersistList( rStm, aEnumValueList ); if( nMask & 0x01 ) WriteSvDeclPersistList( rStm, aEnumValueList );
if( nMask & 0x02 ) write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStm, aPrefix); if( nMask & 0x02 ) write_uInt16_lenPrefixed_uInt8s_FromOString(rStm, aPrefix);
} }
namespace namespace

View File

@ -601,7 +601,7 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter( SvStream* pStream, sal_uInt8 nT
DBG(_nStartPos = pStream->Tell()); DBG(_nStartPos = pStream->Tell());
DBG( DbgOutf( "SfxFileRec: writing record to %ul", _nStartPos ) ); DBG( DbgOutf( "SfxFileRec: writing record to %ul", _nStartPos ) );
*pStream << ( ( nTag << 24 ) | nSize ); pStream->WriteUInt32( ( nTag << 24 ) | nSize );
} }
/** The destructor closes the record automatically if not done earlier */ /** The destructor closes the record automatically if not done earlier */

View File

@ -65,8 +65,8 @@ public:
friend SvStream& WriteINetMessageHeader( friend SvStream& WriteINetMessageHeader(
SvStream& rStrm, const INetMessageHeader& rHdr) SvStream& rStrm, const INetMessageHeader& rHdr)
{ {
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStrm, rHdr.m_aName); write_uInt16_lenPrefixed_uInt8s_FromOString(rStrm, rHdr.m_aName);
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStrm, rHdr.m_aValue); write_uInt16_lenPrefixed_uInt8s_FromOString(rStrm, rHdr.m_aValue);
return rStrm; return rStrm;
} }

View File

@ -315,36 +315,6 @@ public:
SvStream& operator>>( double& rDouble ); SvStream& operator>>( double& rDouble );
SvStream& operator>>( SvStream& rStream ); SvStream& operator>>( SvStream& rStream );
SvStream& operator<<( sal_uInt16 nUInt16 )
{ return WriteUInt16(nUInt16); }
SvStream& operator<<( sal_uInt32 nUInt32 )
{ return WriteUInt32(nUInt32); }
SvStream& operator<<( sal_uInt64 nuInt64 )
{ return WriteUInt64(nuInt64); }
SvStream& operator<<( sal_Int16 nInt16 )
{ return WriteInt16(nInt16); }
SvStream& operator<<( sal_Int32 nInt32 )
{ return WriteInt32(nInt32); }
SvStream& operator<<( sal_Int64 nInt64 ) SAL_DELETED_FUNCTION;
SvStream& operator<<( bool b )
{ return operator<<(static_cast< sal_Bool >(b)); }
SvStream& operator<<( signed char nChar )
{ return WriteSChar(nChar); }
SvStream& operator<<( char nChar )
{ return WriteChar(nChar); }
SvStream& operator<<( unsigned char nChar )
{ return WriteUChar(nChar); }
SvStream& operator<<( float nFloat )
{ return WriteFloat(nFloat); }
SvStream& operator<<( const double& rDouble )
{ return WriteDouble(rDouble); }
SvStream& operator<<( const char* pBuf )
{ return WriteCharPtr(pBuf); }
SvStream& operator<<( const unsigned char* pBuf )
{ return WriteUCharPtr(pBuf); }
SvStream& operator<<( SvStream& rStream )
{ return WriteStream(rStream); }
SvStream& WriteUInt16( sal_uInt16 nUInt16 ); SvStream& WriteUInt16( sal_uInt16 nUInt16 );
SvStream& WriteUInt32( sal_uInt32 nUInt32 ); SvStream& WriteUInt32( sal_uInt32 nUInt32 );
SvStream& WriteUInt64( sal_uInt64 nuInt64 ); SvStream& WriteUInt64( sal_uInt64 nuInt64 );
@ -577,39 +547,6 @@ TOOLS_DLLPUBLIC inline sal_Size write_uInt16s_FromOUString(SvStream& rStrm,
return write_uInt16s_FromOUString(rStrm, rStr, rStr.getLength()); return write_uInt16s_FromOUString(rStrm, rStr, rStr.getLength());
} }
namespace streamdetail
{
/// Attempt to write a pascal-style length (of type prefix) prefixed
/// sequence of units from a string-type, returned value is number of bytes
/// written (including byte-count of prefix)
template<typename prefix, typename S, sal_Size (*writeOper)(SvStream&, const S&, sal_Size)>
sal_Size write_lenPrefixed_seq_From_str(SvStream& rStrm, const S &rStr)
{
sal_Size nWritten = 0;
prefix nUnits = std::min<sal_Size>(rStr.getLength(), std::numeric_limits<prefix>::max());
SAL_WARN_IF(static_cast<sal_Size>(nUnits) != static_cast<sal_Size>(rStr.getLength()),
"tools.stream",
"string too long for prefix count to fit in output type");
rStrm << nUnits;
if (rStrm.good())
{
nWritten += sizeof(prefix);
nWritten += writeOper(rStrm, rStr, nUnits);
}
return nWritten;
}
}
/// Attempt to write a pascal-style length (of type prefix) prefixed sequence
/// of 16bit units from an OUString, returned value is number of bytes written
/// (including byte-count of prefix)
template<typename prefix>
sal_Size write_lenPrefixed_uInt16s_FromOUString(SvStream& rStrm,
const OUString &rStr)
{
return streamdetail::write_lenPrefixed_seq_From_str<prefix, OUString, write_uInt16s_FromOUString>(rStrm, rStr);
}
/// Attempt to write a pascal-style length (of type prefix) prefixed sequence /// Attempt to write a pascal-style length (of type prefix) prefixed sequence
/// of 16bit units from an OUString, returned value is number of bytes written /// of 16bit units from an OUString, returned value is number of bytes written
/// (including byte-count of prefix) /// (including byte-count of prefix)
@ -666,27 +603,6 @@ TOOLS_DLLPUBLIC inline sal_Size write_uInt8s_FromOString(SvStream& rStrm, const
return write_uInt8s_FromOString(rStrm, rStr, rStr.getLength()); return write_uInt8s_FromOString(rStrm, rStr, rStr.getLength());
} }
/// Attempt to write a pascal-style length (of type prefix) prefixed sequence
/// of 8bit units from an OString, returned value is number of bytes written
/// (including byte-count of prefix)
template<typename prefix>
sal_Size write_lenPrefixed_uInt8s_FromOString(SvStream& rStrm,
const OString &rStr)
{
return streamdetail::write_lenPrefixed_seq_From_str<prefix, OString, write_uInt8s_FromOString>(rStrm, rStr);
}
/// Attempt to write a pascal-style length (of type prefix) prefixed sequence
/// of 8bit units from an OUString, returned value is number of bytes written
/// (including byte-count of prefix)
template<typename prefix>
sal_Size write_lenPrefixed_uInt8s_FromOUString(SvStream& rStrm,
const OUString &rStr,
rtl_TextEncoding eEnc)
{
return write_lenPrefixed_uInt8s_FromOString<prefix>(rStrm, OUStringToOString(rStr, eEnc));
}
/// Attempt to write a pascal-style length (of type prefix) prefixed /// Attempt to write a pascal-style length (of type prefix) prefixed
/// sequence of units from a string-type, returned value is number of bytes /// sequence of units from a string-type, returned value is number of bytes
/// written (including byte-count of prefix) /// written (including byte-count of prefix)

View File

@ -133,7 +133,7 @@ inline ScAddress ScBigAddress::MakeAddress() const
inline SvStream& WriteScBigAddress( SvStream& rStream, const ScBigAddress& rAdr ) inline SvStream& WriteScBigAddress( SvStream& rStream, const ScBigAddress& rAdr )
{ {
rStream << rAdr.nCol << rAdr.nRow << rAdr.nTab; rStream.WriteInt32( rAdr.nCol ).WriteInt32( rAdr.nRow ).WriteInt32( rAdr.nTab );
return rStream; return rStream;
} }

View File

@ -794,7 +794,7 @@ bool ScAutoFormatData::Save(SvStream& rStream, sal_uInt16 fileVersion)
bool b; bool b;
rStream.WriteUInt16( nVal ); rStream.WriteUInt16( nVal );
// --- from 680/dr25 on: store strings as UTF-8 // --- from 680/dr25 on: store strings as UTF-8
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStream, aName, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rStream, aName, RTL_TEXTENCODING_UTF8);
rStream.WriteUInt16( nStrResId ); rStream.WriteUInt16( nStrResId );
rStream.WriteUChar( ( b = bIncludeFont ) ); rStream.WriteUChar( ( b = bIncludeFont ) );

View File

@ -224,7 +224,8 @@ void XclExpDffAnchorBase::SetSdrObject( const SdrObject& rSdrObj )
void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const
{ {
rEscherEx.AddAtom( 18, ESCHER_ClientAnchor ); rEscherEx.AddAtom( 18, ESCHER_ClientAnchor );
rEscherEx.GetStream().WriteUInt16( mnFlags ) << maAnchor; rEscherEx.GetStream().WriteUInt16( mnFlags );
WriteXclObjAnchor( rEscherEx.GetStream(), maAnchor );
} }
void XclExpDffAnchorBase::WriteData( EscherEx& rEscherEx, const Rectangle& rRect ) void XclExpDffAnchorBase::WriteData( EscherEx& rEscherEx, const Rectangle& rRect )

View File

@ -116,15 +116,15 @@ const sal_Char ScHTMLExport::sIndentSource[nIndentMax+1] =
#define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag ) #define TAG_ON( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag )
#define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag, false ) #define TAG_OFF( tag ) HTMLOutFuncs::Out_AsciiTag( rStrm, tag, false )
#define OUT_STR( str ) HTMLOutFuncs::Out_String( rStrm, str, eDestEnc, &aNonConvertibleChars ) #define OUT_STR( str ) HTMLOutFuncs::Out_String( rStrm, str, eDestEnc, &aNonConvertibleChars )
#define OUT_LF() rStrm << SAL_NEWLINE_STRING << GetIndentStr() #define OUT_LF() rStrm.WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() )
#define TAG_ON_LF( tag ) (TAG_ON( tag ) << SAL_NEWLINE_STRING << GetIndentStr()) #define TAG_ON_LF( tag ) (TAG_ON( tag ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ))
#define TAG_OFF_LF( tag ) (TAG_OFF( tag ) << SAL_NEWLINE_STRING << GetIndentStr()) #define TAG_OFF_LF( tag ) (TAG_OFF( tag ).WriteCharPtr( SAL_NEWLINE_STRING ).WriteCharPtr( GetIndentStr() ))
#define OUT_HR() TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_horzrule ) #define OUT_HR() TAG_ON_LF( OOO_STRING_SVTOOLS_HTML_horzrule )
#define OUT_COMMENT( comment ) (rStrm << sMyBegComment, OUT_STR( comment ) \ #define OUT_COMMENT( comment ) (rStrm.WriteCharPtr( sMyBegComment ), OUT_STR( comment ) \
<< sMyEndComment << SAL_NEWLINE_STRING \ .WriteCharPtr( sMyEndComment ).WriteCharPtr( SAL_NEWLINE_STRING ) \
<< GetIndentStr()) .WriteCharPtr( GetIndentStr() ))
#define OUT_SP_CSTR_ASS( s ) rStrm << ' ' << s << '=' #define OUT_SP_CSTR_ASS( s ) rStrm.WriteChar( ' ').WriteCharPtr( s ).WriteChar( '=' )
#define GLOBSTR(id) ScGlobal::GetRscString( id ) #define GLOBSTR(id) ScGlobal::GetRscString( id )

View File

@ -333,6 +333,15 @@ StreamType& operator<<( StreamType& rStrm, const XclObjAnchor& rAnchor )
<< static_cast<sal_uInt16>(rAnchor.maLast.mnRow) << static_cast<sal_uInt16>(rAnchor.mnBY); << static_cast<sal_uInt16>(rAnchor.maLast.mnRow) << static_cast<sal_uInt16>(rAnchor.mnBY);
} }
inline SvStream& WriteXclObjAnchor( SvStream& rStrm, const XclObjAnchor& rAnchor )
{
return rStrm
.WriteUInt16( rAnchor.maFirst.mnCol ).WriteUInt16( rAnchor.mnLX )
.WriteUInt16( rAnchor.maFirst.mnRow ).WriteUInt16( rAnchor.mnTY )
.WriteUInt16( rAnchor.maLast.mnCol ).WriteUInt16( rAnchor.mnRX )
.WriteUInt16( rAnchor.maLast.mnRow).WriteUInt16(rAnchor.mnBY);
}
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
struct XclObjLineData struct XclObjLineData

View File

@ -301,23 +301,23 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes
SdIOCompat aIO(rOut, STREAM_WRITE, 0); SdIOCompat aIO(rOut, STREAM_WRITE, 0);
// Name // Name
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aDesignName, write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aDesignName,
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
rOut.WriteUInt16( (sal_uInt16)rDesign.m_eMode ); rOut.WriteUInt16( (sal_uInt16)rDesign.m_eMode );
rOut.WriteUChar( rDesign.m_bContentPage ); rOut.WriteUChar( rDesign.m_bContentPage );
rOut.WriteUChar( rDesign.m_bNotes ); rOut.WriteUChar( rDesign.m_bNotes );
rOut.WriteUInt16( rDesign.m_nResolution ); rOut.WriteUInt16( rDesign.m_nResolution );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aCompression, write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCompression,
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
rOut.WriteUInt16( (sal_uInt16)rDesign.m_eFormat ); rOut.WriteUInt16( (sal_uInt16)rDesign.m_eFormat );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aAuthor, write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aAuthor,
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aEMail, write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aEMail,
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aWWW, write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aWWW,
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aMisc, write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aMisc,
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
rOut.WriteUChar( rDesign.m_bDownload ); rOut.WriteUChar( rDesign.m_bDownload );
rOut.WriteUChar( rDesign.m_bCreated ); // not used rOut.WriteUChar( rDesign.m_bCreated ); // not used
@ -332,9 +332,9 @@ SvStream& WriteSdPublishingDesign(SvStream& rOut, const SdPublishingDesign& rDes
rOut.WriteUChar( rDesign.m_bUseColor ); rOut.WriteUChar( rDesign.m_bUseColor );
rOut.WriteUInt16( (sal_uInt16)rDesign.m_eScript ); rOut.WriteUInt16( (sal_uInt16)rDesign.m_eScript );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aURL, write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aURL,
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, rDesign.m_aCGI, write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, rDesign.m_aCGI,
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
rOut.WriteUChar( rDesign.m_bAutoSlide ); rOut.WriteUChar( rDesign.m_bAutoSlide );

View File

@ -3228,7 +3228,7 @@ OUString UCBStorage::CreateLinkFile( const OUString& rName )
// store it as key/value pair // store it as key/value pair
OUString aLink = "ContentURL=" + aURL; OUString aLink = "ContentURL=" + aURL;
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(*pStream, aLink, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(*pStream, aLink, RTL_TEXTENCODING_UTF8);
pStream->Flush(); pStream->Flush();
// move the stream to its desired location // move the stream to its desired location

View File

@ -58,14 +58,14 @@ public:
} }
inline void Write(SvStorageStream *pS) inline void Write(SvStorageStream *pS)
{ {
*pS << nCBHdr; pS->WriteUInt16( nCBHdr );
*pS << nVersion; pS->WriteUInt32( nVersion );
*pS << nCf; pS->WriteUInt16( nCf );
*pS << nCBObject; pS->WriteUInt32( nCBObject );
*pS << nReserved1; pS->WriteUInt32( nReserved1 );
*pS << nReserved2; pS->WriteUInt32( nReserved2 );
*pS << nReserved3; pS->WriteUInt32( nReserved3 );
*pS << nReserved4; pS->WriteUInt32( nReserved4 );
} }
}; };

View File

@ -1139,7 +1139,7 @@ SvStream& WriteGraphicObject( SvStream& rOStm, const GraphicObject& rGraphicObj
rOStm.WriteUChar( bLink ); rOStm.WriteUChar( bLink );
if( bLink ) if( bLink )
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStm, rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, rGraphicObj.GetLink(), RTL_TEXTENCODING_UTF8);
return rOStm; return rOStm;
} }

View File

@ -88,16 +88,16 @@ void IMapObject::Write( SvStream& rOStm, const OUString& rBaseURL ) const
const OString aRelURL = OUStringToOString( const OString aRelURL = OUStringToOString(
URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), eEncoding); URIHelper::simpleNormalizedMakeRelative(rBaseURL, aURL), eEncoding);
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStm, aRelURL); write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, aRelURL);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStm, aAltText, eEncoding); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aAltText, eEncoding);
rOStm.WriteUChar( bActive ); rOStm.WriteUChar( bActive );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStm, aTarget, eEncoding); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aTarget, eEncoding);
pCompat = new IMapCompat( rOStm, STREAM_WRITE ); pCompat = new IMapCompat( rOStm, STREAM_WRITE );
WriteIMapObject( rOStm ); WriteIMapObject( rOStm );
aEventList.Write( rOStm ); // V4 aEventList.Write( rOStm ); // V4
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStm, aName, eEncoding); // V5 write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aName, eEncoding); // V5
delete pCompat; delete pCompat;
} }
@ -949,10 +949,10 @@ void ImageMap::Write( SvStream& rOStm, const OUString& rBaseURL ) const
// write MagicCode // write MagicCode
rOStm.WriteCharPtr( IMAPMAGIC ); rOStm.WriteCharPtr( IMAPMAGIC );
rOStm.WriteUInt16( GetVersion() ); rOStm.WriteUInt16( GetVersion() );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStm, aImageName, eEncoding); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aImageName, eEncoding);
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStm, OString()); //dummy write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, OString()); //dummy
rOStm.WriteUInt16( nCount ); rOStm.WriteUInt16( nCount );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStm, aImageName, eEncoding); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aImageName, eEncoding);
pCompat = new IMapCompat( rOStm, STREAM_WRITE ); pCompat = new IMapCompat( rOStm, STREAM_WRITE );

View File

@ -192,7 +192,7 @@ void SgaObject::WriteData( SvStream& rOut, const OUString& rDestDir ) const
OUString aURLWithoutDestDir = aURL.GetMainURL( INetURLObject::NO_DECODE ); OUString aURLWithoutDestDir = aURL.GetMainURL( INetURLObject::NO_DECODE );
aURLWithoutDestDir = aURLWithoutDestDir.replaceFirst(rDestDir, ""); aURLWithoutDestDir = aURLWithoutDestDir.replaceFirst(rDestDir, "");
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, aURLWithoutDestDir, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, aURLWithoutDestDir, RTL_TEXTENCODING_UTF8);
} }
void SgaObject::ReadData(SvStream& rIn, sal_uInt16& rReadVersion ) void SgaObject::ReadData(SvStream& rIn, sal_uInt16& rReadVersion )
@ -299,8 +299,8 @@ void SgaObjectBmp::WriteData( SvStream& rOut, const OUString& rDestDir ) const
SgaObject::WriteData( rOut, rDestDir ); SgaObject::WriteData( rOut, rDestDir );
char aDummy[ 10 ]; char aDummy[ 10 ];
rOut.Write( aDummy, 10 ); rOut.Write( aDummy, 10 );
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOut, OString()); //dummy write_uInt16_lenPrefixed_uInt8s_FromOString(rOut, OString()); //dummy
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, aTitle, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8);
} }
void SgaObjectBmp::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) void SgaObjectBmp::ReadData( SvStream& rIn, sal_uInt16& rReadVersion )
@ -371,7 +371,7 @@ void SgaObjectSound::WriteData( SvStream& rOut, const OUString& rDestDir ) const
{ {
SgaObject::WriteData( rOut, rDestDir ); SgaObject::WriteData( rOut, rDestDir );
rOut.WriteUInt16( (sal_uInt16) eSoundType ); rOut.WriteUInt16( (sal_uInt16) eSoundType );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, aTitle, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8);
} }
void SgaObjectSound::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) void SgaObjectSound::ReadData( SvStream& rIn, sal_uInt16& rReadVersion )
@ -530,7 +530,7 @@ sal_Bool SgaObjectSvDraw::CreateThumb( const FmFormModel& rModel )
void SgaObjectSvDraw::WriteData( SvStream& rOut, const OUString& rDestDir ) const void SgaObjectSvDraw::WriteData( SvStream& rOut, const OUString& rDestDir ) const
{ {
SgaObject::WriteData( rOut, rDestDir ); SgaObject::WriteData( rOut, rDestDir );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, aTitle, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOut, aTitle, RTL_TEXTENCODING_UTF8);
} }
void SgaObjectSvDraw::ReadData( SvStream& rIn, sal_uInt16& rReadVersion ) void SgaObjectSvDraw::ReadData( SvStream& rIn, sal_uInt16& rReadVersion )

View File

@ -1295,7 +1295,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const
sal_Bool bRel; sal_Bool bRel;
rOStm.WriteUInt16( (sal_uInt16) 0x0004 ); rOStm.WriteUInt16( (sal_uInt16) 0x0004 );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStm, GetRealName(), RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, GetRealName(), RTL_TEXTENCODING_UTF8);
rOStm.WriteUInt32( nCount ).WriteUInt16( (sal_uInt16) osl_getThreadTextEncoding() ); rOStm.WriteUInt32( nCount ).WriteUInt16( (sal_uInt16) osl_getThreadTextEncoding() );
for( sal_uInt32 i = 0; i < nCount; i++ ) for( sal_uInt32 i = 0; i < nCount; i++ )
@ -1347,7 +1347,7 @@ SvStream& GalleryTheme::WriteData( SvStream& rOStm ) const
} }
rOStm.WriteUChar( bRel ); rOStm.WriteUChar( bRel );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStm, aPath, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStm, aPath, RTL_TEXTENCODING_UTF8);
rOStm.WriteUInt32( pObj->nOffset ).WriteUInt16( (sal_uInt16) pObj->eObjKind ); rOStm.WriteUInt32( pObj->nOffset ).WriteUInt16( (sal_uInt16) pObj->eObjKind );
} }

View File

@ -534,7 +534,7 @@ sal_Bool SwBoxAutoFmt::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
aRotateMode.Store( rStream, aRotateMode.GetVersion(fileVersion) ); aRotateMode.Store( rStream, aRotateMode.GetVersion(fileVersion) );
// --- from 680/dr25 on: store strings as UTF-8 // --- from 680/dr25 on: store strings as UTF-8
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStream, sNumFmtString, write_uInt16_lenPrefixed_uInt8s_FromOUString(rStream, sNumFmtString,
RTL_TEXTENCODING_UTF8); RTL_TEXTENCODING_UTF8);
rStream.WriteUInt16( (sal_uInt16)eSysLanguage ).WriteUInt16( (sal_uInt16)eNumFmtLanguage ); rStream.WriteUInt16( (sal_uInt16)eSysLanguage ).WriteUInt16( (sal_uInt16)eNumFmtLanguage );
@ -966,7 +966,7 @@ sal_Bool SwTableAutoFmt::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
sal_Bool b; sal_Bool b;
rStream.WriteUInt16( nVal ); rStream.WriteUInt16( nVal );
// --- from 680/dr25 on: store strings as UTF-8 // --- from 680/dr25 on: store strings as UTF-8
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStream, m_aName, write_uInt16_lenPrefixed_uInt8s_FromOUString(rStream, m_aName,
RTL_TEXTENCODING_UTF8 ); RTL_TEXTENCODING_UTF8 );
rStream.WriteUInt16( nStrResId ); rStream.WriteUInt16( nStrResId );
rStream.WriteUChar( ( b = bInclFont ) ); rStream.WriteUChar( ( b = bInclFont ) );

View File

@ -1087,14 +1087,21 @@ inline void SvStatistics::PrintOn( SvStream &rOS ) const //$ ostream
if( IsEmpty() ) if( IsEmpty() )
return; return;
rOS << "{ SV called:" << '\n'; rOS.WriteCharPtr( "{ SV called:\n" );
if( nGetTextSize ) if( nGetTextSize )
rOS << "\tnGetTextSize: " << nGetTextSize << '\n'; if( nDrawText ) rOS.WriteCharPtr( "\tnGetTextSize: " ).WriteUInt16( nGetTextSize ).WriteChar( '\n' );
rOS << "\tnDrawText: " << nDrawText << '\n'; if( nGetStretchTextSize ) if( nDrawText )
rOS << "\tnGetStretchTextSize: " << nGetStretchTextSize << '\n'; if( nDrawStretchText ) rOS.WriteCharPtr( "\tnDrawText: " ).WriteUInt16( nDrawText ).WriteChar( '\n' );
rOS << "\tnDrawStretchText: " << nDrawStretchText << '\n'; if( nChangeFont ) if( nGetStretchTextSize )
rOS << "\tnChangeFont: " << nChangeFont << '\n'; if( nGetFontMetric ) rOS.WriteCharPtr( "\tnGetStretchTextSize: " ).WriteUInt16( nGetStretchTextSize ).WriteChar( '\n' );
rOS << "\tnGetFontMetric: " << nGetFontMetric << '\n'; rOS << "}" << '\n'; } if( nDrawStretchText )
rOS.WriteCharPtr( "\tnDrawStretchText: " ).WriteUInt16( nDrawStretchText ).WriteChar( '\n' );
if( nChangeFont )
rOS.WriteCharPtr( "\tnChangeFont: " ).WriteUInt16( nChangeFont ).WriteChar( '\n' );
if( nGetFontMetric )
rOS.WriteCharPtr( "\tnGetFontMetric: " ).WriteUInt16( nGetFontMetric ).WriteChar( '\n' );
rOS.WriteCharPtr( "}\n" );
}
#else #else
#define SV_STAT(nWhich) #define SV_STAT(nWhich)
#endif /* DBG_UTIL */ #endif /* DBG_UTIL */

View File

@ -1191,7 +1191,7 @@ SvStream& SwFmtVertOrient::Store(SvStream &rStream, sal_uInt16 /*version*/) cons
#if SAL_TYPES_SIZEOFLONG == 8 #if SAL_TYPES_SIZEOFLONG == 8
rStream.WriteInt64(nYPos); rStream.WriteInt64(nYPos);
#else #else
rStream << static_cast<sal_Int32>(nYPos); rStream.WriteInt32(nYPos);
#endif #endif
rStream.WriteInt16( eOrient ).WriteInt16( eRelation ); rStream.WriteInt16( eOrient ).WriteInt16( eRelation );
return rStream; return rStream;

View File

@ -895,10 +895,10 @@ public:
static sal_uLong FillUntil( SvStream& rStrm, sal_uLong nEndPos = 0 ); static sal_uLong FillUntil( SvStream& rStrm, sal_uLong nEndPos = 0 );
static void FillCount( SvStream& rStrm, sal_uLong nCount ); static void FillCount( SvStream& rStrm, sal_uLong nCount );
static void WriteShort( SvStream& rStrm, sal_Int16 nVal ) { rStrm << nVal; } static void WriteShort( SvStream& rStrm, sal_Int16 nVal ) { rStrm.WriteInt16( nVal ); }
static void WriteShort( SvStream& rStrm, sal_uLong nPos, sal_Int16 nVal ); static void WriteShort( SvStream& rStrm, sal_uLong nPos, sal_Int16 nVal );
static void WriteLong( SvStream& rStrm, sal_Int32 nVal ) { rStrm << nVal; } static void WriteLong( SvStream& rStrm, sal_Int32 nVal ) { rStrm.WriteInt32( nVal ); }
static void WriteLong( SvStream& rStrm, sal_uLong nPos, sal_Int32 nVal ); static void WriteLong( SvStream& rStrm, sal_uLong nPos, sal_Int32 nVal );
static void WriteString16(SvStream& rStrm, const OUString& rStr, static void WriteString16(SvStream& rStrm, const OUString& rStr,

View File

@ -103,7 +103,7 @@ sal_uIntPtr INetMessage::SetHeaderField (
SvStream& INetMessage::operator<< (SvStream& rStrm) const SvStream& INetMessage::operator<< (SvStream& rStrm) const
{ {
rStrm.WriteUInt32( static_cast<sal_uInt32>(m_nDocSize) ); rStrm.WriteUInt32( static_cast<sal_uInt32>(m_nDocSize) );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStrm, m_aDocName, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rStrm, m_aDocName, RTL_TEXTENCODING_UTF8);
sal_uIntPtr i, n = m_aHeaderList.size(); sal_uIntPtr i, n = m_aHeaderList.size();
rStrm.WriteUInt32( static_cast<sal_uInt32>(n) ); rStrm.WriteUInt32( static_cast<sal_uInt32>(n) );
@ -1018,7 +1018,7 @@ SvStream& INetMIMEMessage::operator<< (SvStream& rStrm) const
for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++) for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++)
rStrm.WriteUInt32( static_cast<sal_uInt32>(m_nIndex[i]) ); rStrm.WriteUInt32( static_cast<sal_uInt32>(m_nIndex[i]) );
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rStrm, m_aBoundary); write_uInt16_lenPrefixed_uInt8s_FromOString(rStrm, m_aBoundary);
rStrm.WriteUInt32( static_cast<sal_uInt32>(aChildren.size()) ); rStrm.WriteUInt32( static_cast<sal_uInt32>(aChildren.size()) );
return rStrm; return rStrm;

View File

@ -825,7 +825,7 @@ void WMFWriter::TrueTextOut(const Point & rPoint, const OString& rString)
{ {
WriteRecordHeader(0,W_META_TEXTOUT); WriteRecordHeader(0,W_META_TEXTOUT);
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(*pWMF, rString); write_uInt16_lenPrefixed_uInt8s_FromOString(*pWMF, rString);
sal_Int32 nLen = rString.getLength(); sal_Int32 nLen = rString.getLength();
if ((nLen&1)!=0) pWMF->WriteUChar( (sal_uInt8)0 ); if ((nLen&1)!=0) pWMF->WriteUChar( (sal_uInt8)0 );
WritePointYX(rPoint); WritePointYX(rPoint);

View File

@ -730,7 +730,7 @@ SvStream& WriteAnimation( SvStream& rOStm, const Animation& rAnimation )
rOStm.WriteUInt32( nDummy32 ); // Unused rOStm.WriteUInt32( nDummy32 ); // Unused
rOStm.WriteUInt32( nDummy32 ); // Unused rOStm.WriteUInt32( nDummy32 ); // Unused
rOStm.WriteUInt32( nDummy32 ); // Unused rOStm.WriteUInt32( nDummy32 ); // Unused
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStm, OString()); // dummy write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, OString()); // dummy
rOStm.WriteUInt16( nRest ); // Count of remaining structures rOStm.WriteUInt16( nRest ); // Count of remaining structures
} }
} }

View File

@ -2395,7 +2395,7 @@ sal_uLong SVMConverter::ImplWriteActions( SvStream& rOStm, GDIMetaFile& rMtf,
rOStm.SeekRel( 4 ); rOStm.SeekRel( 4 );
// write data // write data
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStm, pA->GetComment()); write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, pA->GetComment());
rOStm.WriteInt32( pA->GetValue() ).WriteUInt32( nDataSize ); rOStm.WriteInt32( pA->GetValue() ).WriteUInt32( nDataSize );
if( nDataSize ) if( nDataSize )

View File

@ -354,23 +354,23 @@ SvStream& WriteJobSetup( SvStream& rOStream, const JobSetup& rJobSetup )
::boost::unordered_map< OUString, OUString, OUStringHash >::const_iterator it; ::boost::unordered_map< OUString, OUString, OUStringHash >::const_iterator it;
for( it = pJobData->maValueMap.begin(); it != pJobData->maValueMap.end(); ++it ) for( it = pJobData->maValueMap.begin(); it != pJobData->maValueMap.end(); ++it )
{ {
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStream, it->first, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStream, it->first, RTL_TEXTENCODING_UTF8);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStream, it->second, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStream, it->second, RTL_TEXTENCODING_UTF8);
} }
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStream, "COMPAT_DUPLEX_MODE"); write_uInt16_lenPrefixed_uInt8s_FromOString(rOStream, "COMPAT_DUPLEX_MODE");
switch( pJobData->meDuplexMode ) switch( pJobData->meDuplexMode )
{ {
case DUPLEX_UNKNOWN: case DUPLEX_UNKNOWN:
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStream, "DUPLEX_UNKNOWN"); write_uInt16_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_UNKNOWN");
break; break;
case DUPLEX_OFF: case DUPLEX_OFF:
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStream, "DUPLEX_OFF"); write_uInt16_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_OFF");
break; break;
case DUPLEX_SHORTEDGE: case DUPLEX_SHORTEDGE:
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStream, "DUPLEX_SHORTEDGE"); write_uInt16_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_SHORTEDGE");
break; break;
case DUPLEX_LONGEDGE: case DUPLEX_LONGEDGE:
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStream, "DUPLEX_LONGEDGE"); write_uInt16_lenPrefixed_uInt8s_FromOString(rOStream, "DUPLEX_LONGEDGE");
break; break;
} }
nLen = sal::static_int_cast<sal_uInt16>(rOStream.Tell() - nPos); nLen = sal::static_int_cast<sal_uInt16>(rOStream.Tell() - nPos);

View File

@ -1254,7 +1254,7 @@ void MetaTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
rOStm.WriteInt32(mnIndex); rOStm.WriteInt32(mnIndex);
rOStm.WriteInt32(mnLen); rOStm.WriteInt32(mnLen);
write_lenPrefixed_uInt16s_FromOUString<sal_uInt16>(rOStm, maStr); // version 2 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm, maStr); // version 2
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -1395,7 +1395,7 @@ void MetaTextArrayAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
for (sal_Int32 i = 0; i < nAryLen; ++i) for (sal_Int32 i = 0; i < nAryLen; ++i)
rOStm.WriteInt32( mpDXAry[ i ] ); rOStm.WriteInt32( mpDXAry[ i ] );
write_lenPrefixed_uInt16s_FromOUString<sal_uInt16>(rOStm, maStr); // version 2 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm, maStr); // version 2
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -1529,7 +1529,7 @@ void MetaStretchTextAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
rOStm.WriteInt32( mnIndex ); rOStm.WriteInt32( mnIndex );
rOStm.WriteInt32( mnLen ); rOStm.WriteInt32( mnLen );
write_lenPrefixed_uInt16s_FromOUString<sal_uInt16>(rOStm, maStr); // version 2 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm, maStr); // version 2
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -1610,7 +1610,7 @@ void MetaTextRectAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet ); rOStm.WriteUniOrByteString( maStr, pData->meActualCharSet );
rOStm.WriteUInt16( mnStyle ); rOStm.WriteUInt16( mnStyle );
write_lenPrefixed_uInt16s_FromOUString<sal_uInt16>(rOStm, maStr); // version 2 write_uInt16_lenPrefixed_uInt16s_FromOUString(rOStm, maStr); // version 2
} }
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
@ -4186,7 +4186,7 @@ sal_Bool MetaCommentAction::Compare( const MetaAction& rMetaAction ) const
void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData ) void MetaCommentAction::Write( SvStream& rOStm, ImplMetaWriteData* pData )
{ {
WRITE_BASE_COMPAT( rOStm, 1, pData ); WRITE_BASE_COMPAT( rOStm, 1, pData );
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(rOStm, maComment); write_uInt16_lenPrefixed_uInt8s_FromOString(rOStm, maComment);
rOStm.WriteInt32( mnValue ).WriteUInt32( mnDataSize ); rOStm.WriteInt32( mnValue ).WriteUInt32( mnDataSize );
if ( mnDataSize ) if ( mnDataSize )

View File

@ -253,10 +253,10 @@ SvStream& WriteQueueInfo( SvStream& rOStream, const QueueInfo& rInfo )
{ {
VersionCompat aCompat( rOStream, STREAM_WRITE, 1 ); VersionCompat aCompat( rOStream, STREAM_WRITE, 1 );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStream, rInfo.maPrinterName, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStream, rInfo.maPrinterName, RTL_TEXTENCODING_UTF8);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStream, rInfo.maDriver, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStream, rInfo.maDriver, RTL_TEXTENCODING_UTF8);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStream, rInfo.maLocation, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStream, rInfo.maLocation, RTL_TEXTENCODING_UTF8);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOStream, rInfo.maComment, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(rOStream, rInfo.maComment, RTL_TEXTENCODING_UTF8);
rOStream.WriteUInt32( rInfo.mnStatus ); rOStream.WriteUInt32( rInfo.mnStatus );
rOStream.WriteUInt32( rInfo.mnJobs ); rOStream.WriteUInt32( rInfo.mnJobs );

View File

@ -163,7 +163,7 @@ ImplFontAttrCache::~ImplFontAttrCache()
if ( aCacheFile.IsWritable() ) if ( aCacheFile.IsWritable() )
{ {
sal_uInt32 nCacheMagic = ImplFontAttrCache::MAGIC; sal_uInt32 nCacheMagic = ImplFontAttrCache::MAGIC;
aCacheFile << nCacheMagic; aCacheFile.WriteUInt32( nCacheMagic );
// write the cache entries to the file // write the cache entries to the file
FontAttrMap::const_iterator aIter = aFontAttributes.begin(); FontAttrMap::const_iterator aIter = aFontAttributes.begin();
@ -171,22 +171,22 @@ ImplFontAttrCache::~ImplFontAttrCache()
{ {
const OUString rFontFileURL( (*aIter).first ); const OUString rFontFileURL( (*aIter).first );
const ImplDevFontAttributes& rDFA( (*aIter).second ); const ImplDevFontAttributes& rDFA( (*aIter).second );
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(aCacheFile, rFontFileURL, RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(aCacheFile, rFontFileURL, RTL_TEXTENCODING_UTF8);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(aCacheFile, rDFA.GetFamilyName(), RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(aCacheFile, rDFA.GetFamilyName(), RTL_TEXTENCODING_UTF8);
aCacheFile << static_cast<short>(rDFA.GetWeight()); aCacheFile.WriteInt16(rDFA.GetWeight());
aCacheFile << static_cast<short>(rDFA.GetSlant()); aCacheFile.WriteInt16(rDFA.GetSlant());
aCacheFile << static_cast<short>(rDFA.GetPitch()); aCacheFile.WriteInt16(rDFA.GetPitch());
aCacheFile << static_cast<short>(rDFA.GetWidthType()); aCacheFile.WriteInt16(rDFA.GetWidthType());
aCacheFile << static_cast<short>(rDFA.GetFamilyType()); aCacheFile.WriteInt16(rDFA.GetFamilyType());
aCacheFile << static_cast<short>(rDFA.IsSymbolFont() != false); aCacheFile.WriteInt16(rDFA.IsSymbolFont() != false);
write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(aCacheFile, rDFA.GetStyleName(), RTL_TEXTENCODING_UTF8); write_uInt16_lenPrefixed_uInt8s_FromOUString(aCacheFile, rDFA.GetStyleName(), RTL_TEXTENCODING_UTF8);
++aIter; ++aIter;
} }
// EOF Marker // EOF Marker
write_lenPrefixed_uInt8s_FromOString<sal_uInt16>(aCacheFile, OString()); write_uInt16_lenPrefixed_uInt8s_FromOString(aCacheFile, OString());
} }
} }
} }