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 /sc | |
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 'sc')
-rw-r--r-- | sc/source/core/data/documen8.cxx | 2 | ||||
-rw-r--r-- | sc/source/core/data/patattr.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/autoform.cxx | 74 | ||||
-rw-r--r-- | sc/source/core/tool/ddelink.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/tool/rechead.cxx | 10 | ||||
-rw-r--r-- | sc/source/core/tool/zforauto.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xecontent.cxx | 6 | ||||
-rw-r--r-- | sc/source/filter/excel/xeescher.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/excel/xestream.cxx | 22 | ||||
-rw-r--r-- | sc/source/filter/excel/xiescher.cxx | 12 | ||||
-rw-r--r-- | sc/source/filter/excel/xiformula.cxx | 4 | ||||
-rw-r--r-- | sc/source/filter/xcl97/XclImpChangeTrack.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/docshell/impex.cxx | 24 |
13 files changed, 84 insertions, 84 deletions
diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index 41db3c0644e0..4f13f68d8202 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -768,7 +768,7 @@ void ScDocument::SaveDdeLinks(SvStream& rStream) const // Header ScMultipleWriteHeader aHdr( rStream ); - rStream << nDdeCount; + rStream.WriteUInt16( nDdeCount ); // Links speichern diff --git a/sc/source/core/data/patattr.cxx b/sc/source/core/data/patattr.cxx index a6dbe6e6dc12..c8c0b4ecc335 100644 --- a/sc/source/core/data/patattr.cxx +++ b/sc/source/core/data/patattr.cxx @@ -178,7 +178,7 @@ SfxPoolItem* ScPatternAttr::Create( SvStream& rStream, sal_uInt16 /* nVersion */ SvStream& ScPatternAttr::Store(SvStream& rStream, sal_uInt16 /* nItemVersion */) const { - rStream << (sal_Bool)sal_True; + rStream.WriteUChar( (sal_Bool)sal_True ); if ( pStyle ) rStream.WriteUniOrByteString( pStyle->GetName(), rStream.GetStreamCharSet() ); @@ -188,7 +188,7 @@ SvStream& ScPatternAttr::Store(SvStream& rStream, sal_uInt16 /* nItemVersion */) rStream.WriteUniOrByteString( ScGlobal::GetRscString(STR_STYLENAME_STANDARD), rStream.GetStreamCharSet() ); - rStream << (short)SFX_STYLE_FAMILY_PARA; // wg. altem Dateiformat + rStream.WriteInt16( (short)SFX_STYLE_FAMILY_PARA ); // wg. altem Dateiformat GetItemSet().Store( rStream ); diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx index 924458a89187..3e8f9152b338 100644 --- a/sc/source/core/tool/autoform.cxx +++ b/sc/source/core/tool/autoform.cxx @@ -107,7 +107,7 @@ namespace SvStream& operator<<(SvStream &stream, AutoFormatSwBlob &blob) { const sal_uInt64 endOfBlob = stream.Tell() + sizeof(sal_uInt64) + blob.size; - stream << endOfBlob; + stream.WriteUInt64( endOfBlob ); if (blob.size) stream.Write(blob.pData, blob.size); @@ -176,33 +176,33 @@ void ScAfVersions::Load( SvStream& rStream, sal_uInt16 nVer ) void ScAfVersions::Write(SvStream& rStream, sal_uInt16 fileVersion) { - rStream << SvxFontItem(ATTR_FONT).GetVersion(fileVersion); - rStream << SvxFontHeightItem(240, 100, ATTR_FONT_HEIGHT).GetVersion(fileVersion); - rStream << SvxWeightItem(WEIGHT_NORMAL, ATTR_FONT_WEIGHT).GetVersion(fileVersion); - rStream << SvxPostureItem(ITALIC_NONE, ATTR_FONT_POSTURE).GetVersion(fileVersion); - rStream << SvxUnderlineItem(UNDERLINE_NONE, ATTR_FONT_UNDERLINE).GetVersion(fileVersion); - rStream << SvxOverlineItem(UNDERLINE_NONE, ATTR_FONT_OVERLINE).GetVersion(fileVersion); - rStream << SvxCrossedOutItem(STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT).GetVersion(fileVersion); - rStream << SvxContourItem(false, ATTR_FONT_CONTOUR).GetVersion(fileVersion); - rStream << SvxShadowedItem(false, ATTR_FONT_SHADOWED).GetVersion(fileVersion); - rStream << SvxColorItem(ATTR_FONT_COLOR).GetVersion(fileVersion); - rStream << SvxBoxItem(ATTR_BORDER).GetVersion(fileVersion); - rStream << SvxLineItem(SID_FRAME_LINESTYLE).GetVersion(fileVersion); - rStream << SvxBrushItem(ATTR_BACKGROUND).GetVersion(fileVersion); - - rStream << SvxAdjustItem(SVX_ADJUST_LEFT, 0).GetVersion(fileVersion); + rStream.WriteUInt16( SvxFontItem(ATTR_FONT).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxFontHeightItem(240, 100, ATTR_FONT_HEIGHT).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxWeightItem(WEIGHT_NORMAL, ATTR_FONT_WEIGHT).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxPostureItem(ITALIC_NONE, ATTR_FONT_POSTURE).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxUnderlineItem(UNDERLINE_NONE, ATTR_FONT_UNDERLINE).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxOverlineItem(UNDERLINE_NONE, ATTR_FONT_OVERLINE).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxCrossedOutItem(STRIKEOUT_NONE, ATTR_FONT_CROSSEDOUT).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxContourItem(false, ATTR_FONT_CONTOUR).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxShadowedItem(false, ATTR_FONT_SHADOWED).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxColorItem(ATTR_FONT_COLOR).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxBoxItem(ATTR_BORDER).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxLineItem(SID_FRAME_LINESTYLE).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxBrushItem(ATTR_BACKGROUND).GetVersion(fileVersion) ); + + rStream.WriteUInt16( SvxAdjustItem(SVX_ADJUST_LEFT, 0).GetVersion(fileVersion) ); if (fileVersion >= SOFFICE_FILEFORMAT_50) rStream << swVersions; - rStream << SvxHorJustifyItem(SVX_HOR_JUSTIFY_STANDARD, ATTR_HOR_JUSTIFY).GetVersion(fileVersion); - rStream << SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY).GetVersion(fileVersion); - rStream << SvxOrientationItem(SVX_ORIENTATION_STANDARD, 0).GetVersion(fileVersion); - rStream << SvxMarginItem(ATTR_MARGIN).GetVersion(fileVersion); - rStream << SfxBoolItem(ATTR_LINEBREAK).GetVersion(fileVersion); - rStream << SfxInt32Item(ATTR_ROTATE_VALUE).GetVersion(fileVersion); - rStream << SvxRotateModeItem(SVX_ROTATE_MODE_STANDARD,0).GetVersion(fileVersion); + rStream.WriteUInt16( SvxHorJustifyItem(SVX_HOR_JUSTIFY_STANDARD, ATTR_HOR_JUSTIFY).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxVerJustifyItem(SVX_VER_JUSTIFY_STANDARD, ATTR_VER_JUSTIFY).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxOrientationItem(SVX_ORIENTATION_STANDARD, 0).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxMarginItem(ATTR_MARGIN).GetVersion(fileVersion) ); + rStream.WriteUInt16( SfxBoolItem(ATTR_LINEBREAK).GetVersion(fileVersion) ); + rStream.WriteUInt16( SfxInt32Item(ATTR_ROTATE_VALUE).GetVersion(fileVersion) ); + rStream.WriteUInt16( SvxRotateModeItem(SVX_ROTATE_MODE_STANDARD,0).GetVersion(fileVersion) ); - rStream << (sal_uInt16)0; // Num-Format + rStream.WriteUInt16( (sal_uInt16)0 ); // Num-Format } ScAutoFormatDataField::ScAutoFormatDataField() : @@ -792,17 +792,17 @@ bool ScAutoFormatData::Save(SvStream& rStream, sal_uInt16 fileVersion) { sal_uInt16 nVal = AUTOFORMAT_DATA_ID; sal_Bool b; - rStream << nVal; + rStream.WriteUInt16( nVal ); // --- from 680/dr25 on: store strings as UTF-8 write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rStream, aName, RTL_TEXTENCODING_UTF8); - rStream << nStrResId; - rStream << ( b = bIncludeFont ); - rStream << ( b = bIncludeJustify ); - rStream << ( b = bIncludeFrame ); - rStream << ( b = bIncludeBackground ); - rStream << ( b = bIncludeValueFormat ); - rStream << ( b = bIncludeWidthHeight ); + rStream.WriteUInt16( nStrResId ); + rStream.WriteUChar( ( b = bIncludeFont ) ); + rStream.WriteUChar( ( b = bIncludeJustify ) ); + rStream.WriteUChar( ( b = bIncludeFrame ) ); + rStream.WriteUChar( ( b = bIncludeBackground ) ); + rStream.WriteUChar( ( b = bIncludeValueFormat ) ); + rStream.WriteUChar( ( b = bIncludeWidthHeight ) ); if (fileVersion >= SOFFICE_FILEFORMAT_50) rStream << m_swFields; @@ -1084,15 +1084,15 @@ bool ScAutoFormat::Save() // Attention: A common header has to be saved sal_uInt16 nVal = AUTOFORMAT_ID; - rStream << nVal - << (sal_uInt8)2 // Number of chars of the header including this - << (sal_uInt8)::GetSOStoreTextEncoding( - osl_getThreadTextEncoding() ); + rStream.WriteUInt16( nVal ) + .WriteUChar( (sal_uInt8)2 ) // Number of chars of the header including this + .WriteUChar( (sal_uInt8)::GetSOStoreTextEncoding( + osl_getThreadTextEncoding() ) ); m_aVersions.Write(rStream, fileVersion); bRet &= (rStream.GetError() == 0); - rStream << (sal_uInt16)(maData.size() - 1); + rStream.WriteUInt16( (sal_uInt16)(maData.size() - 1) ); bRet &= (rStream.GetError() == 0); MapType::iterator it = maData.begin(), itEnd = maData.end(); if (it != itEnd) diff --git a/sc/source/core/tool/ddelink.cxx b/sc/source/core/tool/ddelink.cxx index d79653ac6966..522ec5ddb9da 100644 --- a/sc/source/core/tool/ddelink.cxx +++ b/sc/source/core/tool/ddelink.cxx @@ -110,10 +110,10 @@ void ScDdeLink::Store( SvStream& rStream, ScMultipleWriteHeader& rHdr ) const rStream.WriteUniOrByteString( aItem, eCharSet ); sal_Bool bHasValue = ( pResult != 0 ); - rStream << bHasValue; + rStream.WriteUChar( bHasValue ); if( rStream.GetVersion() > SOFFICE_FILEFORMAT_40 ) // nicht bei 4.0 Export - rStream << nMode; // seit 388b + rStream.WriteUChar( nMode ); // seit 388b // Links mit Mode != SC_DDE_DEFAULT werden bei 4.0 Export komplett weggelassen // (aus ScDocument::SaveDdeLinks) diff --git a/sc/source/core/tool/rechead.cxx b/sc/source/core/tool/rechead.cxx index 606941aaa6c3..87590aaa3ec9 100644 --- a/sc/source/core/tool/rechead.cxx +++ b/sc/source/core/tool/rechead.cxx @@ -110,7 +110,7 @@ ScMultipleWriteHeader::ScMultipleWriteHeader(SvStream& rNewStream, sal_uInt32 nD aMemStream( 4096, 4096 ) { nDataSize = nDefault; - rStream << nDataSize; + rStream.WriteUInt32( nDataSize ); nDataPos = rStream.Tell(); nEntryStart = nDataPos; @@ -120,8 +120,8 @@ ScMultipleWriteHeader::~ScMultipleWriteHeader() { sal_uLong nDataEnd = rStream.Tell(); - rStream << (sal_uInt16) SCID_SIZES; - rStream << static_cast<sal_uInt32>(aMemStream.Tell()); + rStream.WriteUInt16( (sal_uInt16) SCID_SIZES ); + rStream.WriteUInt32( static_cast<sal_uInt32>(aMemStream.Tell()) ); rStream.Write( aMemStream.GetData(), aMemStream.Tell() ); if ( nDataEnd - nDataPos != nDataSize ) // matched default ? @@ -129,7 +129,7 @@ ScMultipleWriteHeader::~ScMultipleWriteHeader() nDataSize = nDataEnd - nDataPos; sal_uLong nPos = rStream.Tell(); rStream.Seek(nDataPos-sizeof(sal_uInt32)); - rStream << nDataSize; // record size at the beginning + rStream.WriteUInt32( nDataSize ); // record size at the beginning rStream.Seek(nPos); } } @@ -137,7 +137,7 @@ ScMultipleWriteHeader::~ScMultipleWriteHeader() void ScMultipleWriteHeader::EndEntry() { sal_uLong nPos = rStream.Tell(); - aMemStream << static_cast<sal_uInt32>(nPos - nEntryStart); + aMemStream.WriteUInt32( static_cast<sal_uInt32>(nPos - nEntryStart) ); } void ScMultipleWriteHeader::StartEntry() diff --git a/sc/source/core/tool/zforauto.cxx b/sc/source/core/tool/zforauto.cxx index 7dc049b0ef50..27abc627713a 100644 --- a/sc/source/core/tool/zforauto.cxx +++ b/sc/source/core/tool/zforauto.cxx @@ -58,7 +58,7 @@ void ScNumFormatAbbrev::Load( SvStream& rStream, rtl_TextEncoding eByteStrSet ) void ScNumFormatAbbrev::Save( SvStream& rStream, rtl_TextEncoding eByteStrSet ) const { rStream.WriteUniOrByteString( sFormatstring, eByteStrSet ); - rStream << (sal_uInt16) eSysLnge << (sal_uInt16) eLnge; + rStream.WriteUInt16( (sal_uInt16) eSysLnge ).WriteUInt16( (sal_uInt16) eLnge ); } void ScNumFormatAbbrev::PutFormatIndex(sal_uLong nFormat, diff --git a/sc/source/filter/excel/xecontent.cxx b/sc/source/filter/excel/xecontent.cxx index 9be1ad212564..da9a27996cc8 100644 --- a/sc/source/filter/excel/xecontent.cxx +++ b/sc/source/filter/excel/xecontent.cxx @@ -173,9 +173,9 @@ void XclExpSstImpl::Save( XclExpStream& rStrm ) // write bucket info before string to get correct record position sal_uInt32 nStrmPos = static_cast< sal_uInt32 >( rStrm.GetSvStreamPos() ); sal_uInt16 nRecPos = rStrm.GetRawRecPos() + 4; - aExtSst << nStrmPos // stream position - << nRecPos // position from start of SST or CONTINUE - << sal_uInt16( 0 ); // reserved + aExtSst.WriteUInt32( nStrmPos ) // stream position + .WriteUInt16( nRecPos ) // position from start of SST or CONTINUE + .WriteUInt16( sal_uInt16( 0 ) ); // reserved } rStrm << **aIt; diff --git a/sc/source/filter/excel/xeescher.cxx b/sc/source/filter/excel/xeescher.cxx index b72b5ed7c7d4..7d48615272b6 100644 --- a/sc/source/filter/excel/xeescher.cxx +++ b/sc/source/filter/excel/xeescher.cxx @@ -224,7 +224,7 @@ void XclExpDffAnchorBase::SetSdrObject( const SdrObject& rSdrObj ) void XclExpDffAnchorBase::WriteDffData( EscherEx& rEscherEx ) const { rEscherEx.AddAtom( 18, ESCHER_ClientAnchor ); - rEscherEx.GetStream() << mnFlags << maAnchor; + rEscherEx.GetStream().WriteUInt16( mnFlags ) << maAnchor; } void XclExpDffAnchorBase::WriteData( EscherEx& rEscherEx, const Rectangle& rRect ) diff --git a/sc/source/filter/excel/xestream.cxx b/sc/source/filter/excel/xestream.cxx index 795f86ba8a5c..2ad9bef43254 100644 --- a/sc/source/filter/excel/xestream.cxx +++ b/sc/source/filter/excel/xestream.cxx @@ -135,7 +135,7 @@ XclExpStream& XclExpStream::operator<<( sal_Int8 nValue ) if (mbUseEncrypter && HasValidEncrypter()) mxEncrypter->Encrypt(mrStrm, nValue); else - mrStrm << nValue; + mrStrm.WriteSChar( nValue ); return *this; } @@ -145,7 +145,7 @@ XclExpStream& XclExpStream::operator<<( sal_uInt8 nValue ) if (mbUseEncrypter && HasValidEncrypter()) mxEncrypter->Encrypt(mrStrm, nValue); else - mrStrm << nValue; + mrStrm.WriteUChar( nValue ); return *this; } @@ -155,7 +155,7 @@ XclExpStream& XclExpStream::operator<<( sal_Int16 nValue ) if (mbUseEncrypter && HasValidEncrypter()) mxEncrypter->Encrypt(mrStrm, nValue); else - mrStrm << nValue; + mrStrm.WriteInt16( nValue ); return *this; } @@ -165,7 +165,7 @@ XclExpStream& XclExpStream::operator<<( sal_uInt16 nValue ) if (mbUseEncrypter && HasValidEncrypter()) mxEncrypter->Encrypt(mrStrm, nValue); else - mrStrm << nValue; + mrStrm.WriteUInt16( nValue ); return *this; } @@ -175,7 +175,7 @@ XclExpStream& XclExpStream::operator<<( sal_Int32 nValue ) if (mbUseEncrypter && HasValidEncrypter()) mxEncrypter->Encrypt(mrStrm, nValue); else - mrStrm << nValue; + mrStrm.WriteInt32( nValue ); return *this; } @@ -185,7 +185,7 @@ XclExpStream& XclExpStream::operator<<( sal_uInt32 nValue ) if (mbUseEncrypter && HasValidEncrypter()) mxEncrypter->Encrypt(mrStrm, nValue); else - mrStrm << nValue; + mrStrm.WriteUInt32( nValue ); return *this; } @@ -195,7 +195,7 @@ XclExpStream& XclExpStream::operator<<( float fValue ) if (mbUseEncrypter && HasValidEncrypter()) mxEncrypter->Encrypt(mrStrm, fValue); else - mrStrm << fValue; + mrStrm.WriteFloat( fValue ); return *this; } @@ -387,11 +387,11 @@ sal_Size XclExpStream::SetSvStreamPos( sal_Size nPos ) void XclExpStream::InitRecord( sal_uInt16 nRecId ) { mrStrm.Seek( STREAM_SEEK_TO_END ); - mrStrm << nRecId; + mrStrm.WriteUInt16( nRecId ); mnLastSizePos = mrStrm.Tell(); mnHeaderSize = static_cast< sal_uInt16 >( ::std::min< sal_Size >( mnPredictSize, mnCurrMaxSize ) ); - mrStrm << mnHeaderSize; + mrStrm.WriteUInt16( mnHeaderSize ); mnCurrSize = mnSliceSize = 0; } @@ -400,7 +400,7 @@ void XclExpStream::UpdateRecSize() if( mnCurrSize != mnHeaderSize ) { mrStrm.Seek( mnLastSizePos ); - mrStrm << mnCurrSize; + mrStrm.WriteUInt16( mnCurrSize ); } } @@ -458,7 +458,7 @@ void XclExpStream::WriteRawZeroBytes( sal_Size nBytes ) sal_Size nBytesLeft = nBytes; while( nBytesLeft >= sizeof( nData ) ) { - mrStrm << nData; + mrStrm.WriteUInt32( nData ); nBytesLeft -= sizeof( nData ); } if( nBytesLeft ) diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index a739409f5136..8eadc5994065 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -737,11 +737,11 @@ void XclImpDrawObjBase::ConvertFillStyle( SdrObject& rSdrObj, const XclObjFillDa const sal_uInt8* const pnPattern = sppnPatterns[ ::std::min< size_t >( rFillData.mnPattern - 2, SAL_N_ELEMENTS( sppnPatterns ) ) ]; // create 2-colored 8x8 DIB SvMemoryStream aMemStrm; - aMemStrm << sal_uInt32( 12 ) << sal_Int16( 8 ) << sal_Int16( 8 ) << sal_uInt16( 1 ) << sal_uInt16( 1 ); - aMemStrm << sal_uInt8( 0xFF ) << sal_uInt8( 0xFF ) << sal_uInt8( 0xFF ); - aMemStrm << sal_uInt8( 0x00 ) << sal_uInt8( 0x00 ) << sal_uInt8( 0x00 ); + aMemStrm.WriteUInt32( sal_uInt32( 12 ) ).WriteInt16( sal_Int16( 8 ) ).WriteInt16( sal_Int16( 8 ) ).WriteUInt16( sal_uInt16( 1 ) ).WriteUInt16( sal_uInt16( 1 ) ); + aMemStrm.WriteUChar( sal_uInt8( 0xFF ) ).WriteUChar( sal_uInt8( 0xFF ) ).WriteUChar( sal_uInt8( 0xFF ) ); + aMemStrm.WriteUChar( sal_uInt8( 0x00 ) ).WriteUChar( sal_uInt8( 0x00 ) ).WriteUChar( sal_uInt8( 0x00 ) ); for( size_t nIdx = 0; nIdx < 8; ++nIdx ) - aMemStrm << sal_uInt32( pnPattern[ nIdx ] ); // 32-bit little-endian + aMemStrm.WriteUInt32( sal_uInt32( pnPattern[ nIdx ] ) ); // 32-bit little-endian aMemStrm.Seek( STREAM_SEEK_TO_BEGIN ); Bitmap aBitmap; ReadDIB(aBitmap, aMemStrm, false); @@ -3686,7 +3686,7 @@ OUString XclImpDffConverter::ReadHlinkProperty( SvStream& rDffStrm ) const { // create a faked BIFF record that can be read by XclImpStream class SvMemoryStream aMemStream; - aMemStream << sal_uInt16( 0 ) << static_cast< sal_uInt16 >( nBufferSize ); + aMemStream.WriteUInt16( sal_uInt16( 0 ) ).WriteUInt16( static_cast< sal_uInt16 >( nBufferSize ) ); // copy from DFF stream to memory stream ::std::vector< sal_uInt8 > aBuffer( nBufferSize ); @@ -4040,7 +4040,7 @@ void XclImpDrawing::ReadBmp( Graphic& rGraphic, const XclImpRoot& rRoot, XclImpS { rStrm.Ignore( 3 ); aMemStrm.SetNumberFormatInt( NUMBERFORMAT_INT_LITTLEENDIAN ); - aMemStrm << nHdrSize << nWidth << nHeight << nPlanes << nDepth; + aMemStrm.WriteUInt32( nHdrSize ).WriteUInt16( nWidth ).WriteUInt16( nHeight ).WriteUInt16( nPlanes ).WriteUInt16( nDepth ); rStrm.CopyToStream( aMemStrm, rStrm.GetRecLeft() ); } rStrm.PopPosition(); diff --git a/sc/source/filter/excel/xiformula.cxx b/sc/source/filter/excel/xiformula.cxx index cd257ca29c85..894aedce8177 100644 --- a/sc/source/filter/excel/xiformula.cxx +++ b/sc/source/filter/excel/xiformula.cxx @@ -63,7 +63,7 @@ void XclImpFmlaCompImpl::CreateRangeList( if( !rXclTokArr.Empty() ) { SvMemoryStream aMemStrm; - aMemStrm << EXC_ID_EOF << rXclTokArr.GetSize(); + aMemStrm.WriteUInt16( EXC_ID_EOF ).WriteUInt16( rXclTokArr.GetSize() ); aMemStrm.Write( rXclTokArr.GetData(), rXclTokArr.GetSize() ); XclImpStream aFmlaStrm( aMemStrm, GetRoot() ); aFmlaStrm.StartNextRecord(); @@ -79,7 +79,7 @@ const ScTokenArray* XclImpFmlaCompImpl::CreateFormula( // evil hack! are we trying to phase out the old style formula converter ? SvMemoryStream aMemStrm; - aMemStrm << EXC_ID_EOF << rXclTokArr.GetSize(); + aMemStrm.WriteUInt16( EXC_ID_EOF ).WriteUInt16( rXclTokArr.GetSize() ); aMemStrm.Write( rXclTokArr.GetData(), rXclTokArr.GetSize() ); XclImpStream aFmlaStrm( aMemStrm, GetRoot() ); aFmlaStrm.StartNextRecord(); diff --git a/sc/source/filter/xcl97/XclImpChangeTrack.cxx b/sc/source/filter/xcl97/XclImpChangeTrack.cxx index 489286105068..9defd8a98c4f 100644 --- a/sc/source/filter/xcl97/XclImpChangeTrack.cxx +++ b/sc/source/filter/xcl97/XclImpChangeTrack.cxx @@ -189,7 +189,7 @@ void XclImpChangeTrack::ReadFormula( ScTokenArray*& rpTokenArray, const ScAddres // to the Convert() routine (to prevent the construction/destruction of the // converter in each formula) SvMemoryStream aMemStrm; - aMemStrm << (sal_uInt16) 0x0001 << nFmlSize; + aMemStrm.WriteUInt16( (sal_uInt16) 0x0001 ).WriteUInt16( nFmlSize ); size_t nRead = pStrm->CopyToStream( aMemStrm, nFmlSize ); // survive reading invalid streams! diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx index 1ca265e2c6be..93e4bfa327df 100644 --- a/sc/source/ui/docshell/impex.cxx +++ b/sc/source/ui/docshell/impex.cxx @@ -279,7 +279,7 @@ bool ScImportExport::ExportData( const OUString& rMimeType, if( ExportStream( aStrm, OUString(), SotExchange::GetFormatIdFromMimeType( rMimeType ) )) { - aStrm << (sal_uInt8) 0; + aStrm.WriteUChar( (sal_uInt8) 0 ); rValue <<= ::com::sun::star::uno::Sequence< sal_Int8 >( (sal_Int8*)aStrm.GetData(), aStrm.Seek( STREAM_SEEK_TO_END ) ); @@ -333,7 +333,7 @@ bool ScImportExport::ExportString( OUString& rText, sal_uLong nFmt ) // mba: no BaseURL for data exc if( ExportStream( aStrm, OUString(), nFmt ) ) { - aStrm << (sal_Unicode) 0; + aStrm.WriteUInt16( (sal_Unicode) 0 ); aStrm.Seek( STREAM_SEEK_TO_END ); rText = OUString( (const sal_Unicode*) aStrm.GetData() ); @@ -361,7 +361,7 @@ bool ScImportExport::ExportByteString( OString& rText, rtl_TextEncoding eEnc, sa // mba: no BaseURL for data exchange if( ExportStream( aStrm, OUString(), nFmt ) ) { - aStrm << (sal_Char) 0; + aStrm.WriteChar( (sal_Char) 0 ); aStrm.Seek( STREAM_SEEK_TO_END ); // Sicherheits-Check: if( aStrm.Tell() <= (sal_uLong) STRING_MAXLEN ) @@ -470,9 +470,9 @@ bool ScImportExport::ExportStream( SvStream& rStrm, const OUString& rBaseURL, sa WriteUnicodeOrByteString( rStrm, aRefName, true ); WriteUnicodeOrByteString( rStrm, aExtraBits, true ); if ( rStrm.GetStreamCharSet() == RTL_TEXTENCODING_UNICODE ) - rStrm << sal_Unicode(0); + rStrm.WriteUInt16( sal_Unicode(0) ); else - rStrm << sal_Char(0); + rStrm.WriteChar( sal_Char(0) ); return rStrm.GetError() == SVSTREAM_OK; } } @@ -504,18 +504,18 @@ void ScImportExport::WriteUnicodeOrByteString( SvStream& rStrm, const OUString& const sal_Unicode* const pStop = p + rString.getLength(); while ( p < pStop ) { - rStrm << *p; + rStrm.WriteUInt16( *p ); } } if ( bZero ) - rStrm << sal_Unicode(0); + rStrm.WriteUInt16( sal_Unicode(0) ); } else { OString aByteStr(OUStringToOString(rString, eEnc)); - rStrm << aByteStr.getStr(); + rStrm.WriteCharPtr( aByteStr.getStr() ); if ( bZero ) - rStrm << sal_Char(0); + rStrm.WriteChar( sal_Char(0) ); } } @@ -528,13 +528,13 @@ void ScImportExport::WriteUnicodeOrByteEndl( SvStream& rStrm ) switch ( rStrm.GetLineDelimiter() ) { case LINEEND_CR : - rStrm << sal_Unicode('\r'); + rStrm.WriteUInt16( sal_Unicode('\r') ); break; case LINEEND_LF : - rStrm << sal_Unicode('\n'); + rStrm.WriteUInt16( sal_Unicode('\n') ); break; default: - rStrm << sal_Unicode('\r') << sal_Unicode('\n'); + rStrm.WriteUInt16( sal_Unicode('\r') ).WriteUInt16( sal_Unicode('\n') ); } } else |