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 /svx | |
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 'svx')
-rw-r--r-- | svx/source/gallery2/codec.cxx | 6 | ||||
-rw-r--r-- | svx/source/gallery2/gallery1.cxx | 2 | ||||
-rw-r--r-- | svx/source/gallery2/galobj.cxx | 6 | ||||
-rw-r--r-- | svx/source/items/algitem.cxx | 8 | ||||
-rw-r--r-- | svx/source/items/grfitem.cxx | 2 | ||||
-rw-r--r-- | svx/source/items/hlnkitem.cxx | 16 | ||||
-rw-r--r-- | svx/source/items/pageitem.cxx | 2 | ||||
-rw-r--r-- | svx/source/sidebar/nbdtmg.cxx | 6 | ||||
-rw-r--r-- | svx/source/svdraw/svdattr.cxx | 10 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 66 | ||||
-rw-r--r-- | svx/source/xoutdev/xexch.cxx | 6 |
11 files changed, 65 insertions, 65 deletions
diff --git a/svx/source/gallery2/codec.cxx b/svx/source/gallery2/codec.cxx index 0643df2bc815..92b0975da1bb 100644 --- a/svx/source/gallery2/codec.cxx +++ b/svx/source/gallery2/codec.cxx @@ -70,8 +70,8 @@ void GalleryCodec::Write( SvStream& rStmToWrite ) const sal_uInt32 nSize = rStmToWrite.Tell(); rStmToWrite.Seek( 0UL ); - rStm << 'S' << 'V' << 'R' << 'L' << 'E' << '2'; - rStm << nSize; + rStm.WriteChar( 'S' ).WriteChar( 'V' ).WriteChar( 'R' ).WriteChar( 'L' ).WriteChar( 'E' ).WriteChar( '2' ); + rStm.WriteUInt32( nSize ); nPos = rStm.Tell(); rStm.SeekRel( 4UL ); @@ -83,7 +83,7 @@ void GalleryCodec::Write( SvStream& rStmToWrite ) nCompSize = rStm.Tell() - nPos - 4UL; rStm.Seek( nPos ); - rStm << nCompSize; + rStm.WriteUInt32( nCompSize ); rStm.Seek( STREAM_SEEK_TO_END ); } diff --git a/svx/source/gallery2/gallery1.cxx b/svx/source/gallery2/gallery1.cxx index 12f2a0a00392..c9c034868070 100644 --- a/svx/source/gallery2/gallery1.cxx +++ b/svx/source/gallery2/gallery1.cxx @@ -246,7 +246,7 @@ void Gallery::ImplLoadSubDirs( const INetURLObject& rBaseURL, sal_Bool& rbDirIsR if( pTestStm ) { - *pTestStm << sal_Int32(1); + pTestStm->WriteInt32( sal_Int32(1) ); if( pTestStm->GetError() ) rbDirIsReadOnly = sal_True; diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index cb4f07a0e228..09bf8b40384b 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -171,8 +171,8 @@ void SgaObject::WriteData( SvStream& rOut, const OUString& rDestDir ) const { static const sal_uInt32 nInventor = COMPAT_FORMAT( 'S', 'G', 'A', '3' ); - rOut << nInventor << (sal_uInt16) 0x0004 << GetVersion() << (sal_uInt16) GetObjKind(); - rOut << bIsThumbBmp; + rOut.WriteUInt32( nInventor ).WriteUInt16( (sal_uInt16) 0x0004 ).WriteUInt16( GetVersion() ).WriteUInt16( (sal_uInt16) GetObjKind() ); + rOut.WriteUChar( bIsThumbBmp ); if( bIsThumbBmp ) { @@ -370,7 +370,7 @@ BitmapEx SgaObjectSound::GetThumbBmp() const void SgaObjectSound::WriteData( SvStream& rOut, const OUString& rDestDir ) const { SgaObject::WriteData( rOut, rDestDir ); - rOut << (sal_uInt16) eSoundType; + rOut.WriteUInt16( (sal_uInt16) eSoundType ); write_lenPrefixed_uInt8s_FromOUString<sal_uInt16>(rOut, aTitle, RTL_TEXTENCODING_UTF8); } diff --git a/svx/source/items/algitem.cxx b/svx/source/items/algitem.cxx index 3c129d6f7f9a..790190f5458f 100644 --- a/svx/source/items/algitem.cxx +++ b/svx/source/items/algitem.cxx @@ -324,10 +324,10 @@ SfxPoolItem* SvxMarginItem::Create( SvStream& rStream, sal_uInt16 ) const SvStream& SvxMarginItem::Store( SvStream &rStream, sal_uInt16 /*nItemVersion*/) const { - rStream << nLeftMargin; - rStream << nTopMargin; - rStream << nRightMargin; - rStream << nBottomMargin; + rStream.WriteInt16( nLeftMargin ); + rStream.WriteInt16( nTopMargin ); + rStream.WriteInt16( nRightMargin ); + rStream.WriteInt16( nBottomMargin ); return rStream; } diff --git a/svx/source/items/grfitem.cxx b/svx/source/items/grfitem.cxx index d63e32e06e59..fa8b5778133c 100644 --- a/svx/source/items/grfitem.cxx +++ b/svx/source/items/grfitem.cxx @@ -80,7 +80,7 @@ SvStream& SvxGrfCrop::Store( SvStream& rStrm, sal_uInt16 nVersion ) const if( GRFCROP_VERSION_SWDEFAULT == nVersion ) top = -top, bottom = -bottom, left = -left, right = -right; - rStrm << top << left << right << bottom; + rStrm.WriteInt32( top ).WriteInt32( left ).WriteInt32( right ).WriteInt32( bottom ); return rStrm; } diff --git a/svx/source/items/hlnkitem.cxx b/svx/source/items/hlnkitem.cxx index 3e4d6923b3b5..65e6bb467af0 100644 --- a/svx/source/items/hlnkitem.cxx +++ b/svx/source/items/hlnkitem.cxx @@ -44,17 +44,17 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ // UNICODE: rStrm << sTarget; rStrm.WriteUniOrByteString(sTarget, rStrm.GetStreamCharSet()); - rStrm << (sal_uInt32) eType; + rStrm.WriteUInt32( (sal_uInt32) eType ); // marker for versioninfo - rStrm << (sal_uInt32) HYPERLINKFF_MARKER; + rStrm.WriteUInt32( (sal_uInt32) HYPERLINKFF_MARKER ); // new data // UNICODE: rStrm << sIntName; rStrm.WriteUniOrByteString(sIntName, rStrm.GetStreamCharSet()); // macro-events - rStrm << nMacroEvents; + rStrm.WriteUInt16( nMacroEvents ); // store macros sal_uInt16 nCnt = pMacroTable ? (sal_uInt16)pMacroTable->size() : 0; @@ -67,7 +67,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ --nCnt; } - rStrm << nCnt; + rStrm.WriteUInt16( nCnt ); if( nCnt ) { @@ -78,7 +78,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ const SvxMacro& rMac = it->second; if( STARBASIC == rMac.GetScriptType() ) { - rStrm << (sal_uInt16)it->first; + rStrm.WriteUInt16( (sal_uInt16)it->first ); // UNICODE: rStrm << pMac->GetLibName(); rStrm.WriteUniOrByteString(rMac.GetLibName(), rStrm.GetStreamCharSet()); @@ -90,7 +90,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ } nCnt = nMax - nCnt; - rStrm << nCnt; + rStrm.WriteUInt16( nCnt ); if( nCnt ) { // 2. ::com::sun::star::script::JavaScript-Macros @@ -100,7 +100,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ const SvxMacro& rMac = it->second; if( STARBASIC != rMac.GetScriptType() ) { - rStrm << (sal_uInt16)it->first; + rStrm.WriteUInt16( (sal_uInt16)it->first ); // UNICODE: rStrm << pMac->GetLibName(); rStrm.WriteUniOrByteString(rMac.GetLibName(), rStrm.GetStreamCharSet()); @@ -108,7 +108,7 @@ SvStream& SvxHyperlinkItem::Store( SvStream& rStrm, sal_uInt16 /*nItemVersion*/ // UNICODE: rStrm << pMac->GetMacName(); rStrm.WriteUniOrByteString(rMac.GetMacName(), rStrm.GetStreamCharSet()); - rStrm << (sal_uInt16)rMac.GetScriptType(); + rStrm.WriteUInt16( (sal_uInt16)rMac.GetScriptType() ); } } } diff --git a/svx/source/items/pageitem.cxx b/svx/source/items/pageitem.cxx index 8f1321e5eee6..a431a9fea121 100644 --- a/svx/source/items/pageitem.cxx +++ b/svx/source/items/pageitem.cxx @@ -264,7 +264,7 @@ SvStream& SvxPageItem::Store( SvStream &rStrm, sal_uInt16 /*nItemVersion*/ ) con // UNICODE: rStrm << aDescName; rStrm.WriteUniOrByteString(aDescName, rStrm.GetStreamCharSet()); - rStrm << (sal_uInt8)eNumType << bLandscape << eUse; + rStrm.WriteUChar( (sal_uInt8)eNumType ).WriteUChar( bLandscape ).WriteUInt16( eUse ); return rStrm; } diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 663c860f1c6c..159c295dcea9 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -224,19 +224,19 @@ void NBOTypeMgrBase::ImplStore(OUString filename) sal_uInt32 nVersion; sal_Int32 nNumIndex; nVersion = DEFAULT_NUMBERING_CACHE_FORMAT_VERSION; - *pOStm << nVersion; + pOStm->WriteUInt32( nVersion ); for(sal_Int32 nItem = 0; nItem < DEFAULT_NUM_VALUSET_COUNT; nItem++ ) { if (IsCustomized(nItem)) { SvxNumRule aDefNumRule( NUM_BULLET_REL_SIZE|NUM_CONTINUOUS|NUM_BULLET_COLOR|NUM_CHAR_TEXT_DISTANCE|NUM_SYMBOL_ALIGNMENT,10, sal_False , SVX_RULETYPE_NUMBERING,SvxNumberFormat::LABEL_ALIGNMENT); sal_uInt16 mLevel = 0x1; - *pOStm << nItem; + pOStm->WriteInt32( nItem ); ApplyNumRule(aDefNumRule,nItem,mLevel,false,true); aDefNumRule.Store(*pOStm); } } nNumIndex = -1; - *pOStm << nNumIndex; //write end flag + pOStm->WriteInt32( nNumIndex ); //write end flag delete pOStm; } eCoreUnit = eOldCoreUnit; diff --git a/svx/source/svdraw/svdattr.cxx b/svx/source/svdraw/svdattr.cxx index bbb1d351c74c..8f701a3b15e0 100644 --- a/svx/source/svdraw/svdattr.cxx +++ b/svx/source/svdraw/svdattr.cxx @@ -697,8 +697,8 @@ SfxPoolItem* SdrFractionItem::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const SvStream& SdrFractionItem::Store(SvStream& rOut, sal_uInt16 /*nItemVers*/) const { - rOut<<sal_Int32(nValue.GetNumerator()); - rOut<<sal_Int32(nValue.GetDenominator()); + rOut.WriteInt32( sal_Int32(nValue.GetNumerator()) ); + rOut.WriteInt32( sal_Int32(nValue.GetDenominator()) ); return rOut; } @@ -1420,7 +1420,7 @@ SvStream& SdrTextFixedCellHeightItem::Store( SvStream& rOut, sal_uInt16 nItemVer if ( nItemVersion ) { sal_Bool bValue = (sal_Bool)GetValue(); - rOut << bValue; + rOut.WriteUChar( bValue ); } return rOut; } @@ -1520,9 +1520,9 @@ SvStream& SdrCustomShapeAdjustmentItem::Store( SvStream& rOut, sal_uInt16 nItemV if ( nItemVersion ) { sal_uInt32 i, nCount = GetCount(); - rOut << nCount; + rOut.WriteUInt32( nCount ); for ( i = 0; i < nCount; i++ ) - rOut << GetValue( i ).nValue; + rOut.WriteUInt32( GetValue( i ).nValue ); } return rOut; } diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index 06325fe4b568..9cc0f5dc5415 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -124,7 +124,7 @@ SfxPoolItem* NameOrIndex::Create(SvStream& rIn, sal_uInt16 /*nVer*/) const SvStream& NameOrIndex::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const { SfxStringItem::Store( rOut, nItemVersion ); - rOut << nPalIndex; + rOut.WriteInt32( nPalIndex ); return rOut; } @@ -720,12 +720,12 @@ SvStream& XLineDashItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const if (!IsIndex()) { - rOut << (sal_Int32) aDash.GetDashStyle(); - rOut << aDash.GetDots(); - rOut << (sal_uInt32) aDash.GetDotLen(); - rOut << aDash.GetDashes(); - rOut << (sal_uInt32) aDash.GetDashLen(); - rOut << (sal_uInt32) aDash.GetDistance(); + rOut.WriteInt32( (sal_Int32) aDash.GetDashStyle() ); + rOut.WriteUInt16( aDash.GetDots() ); + rOut.WriteUInt32( (sal_uInt32) aDash.GetDotLen() ); + rOut.WriteUInt16( aDash.GetDashes() ); + rOut.WriteUInt32( (sal_uInt32) aDash.GetDashLen() ); + rOut.WriteUInt32( (sal_uInt32) aDash.GetDistance() ); } return rOut; @@ -1183,7 +1183,7 @@ namespace void streamOutB2DPolyPolygon(const basegfx::B2DPolyPolygon& rPolyPolygon, SvStream& rOut) { const sal_uInt32 nPolygonCount(rPolyPolygon.count()); - rOut << nPolygonCount; + rOut.WriteUInt32( nPolygonCount ); for(sal_uInt32 a(0L); a < nPolygonCount; a++) { @@ -1191,9 +1191,9 @@ namespace const sal_uInt32 nPointCount(aCandidate.count()); const sal_uInt8 bClosed(aCandidate.isClosed() ? 1 : 0); const sal_uInt8 bControlPoints(aCandidate.areControlPointsUsed() ? 1 : 0); - rOut << nPointCount; - rOut << bClosed; - rOut << bControlPoints; + rOut.WriteUInt32( nPointCount ); + rOut.WriteUChar( bClosed ); + rOut.WriteUChar( bControlPoints ); for(sal_uInt32 b(0L); b < nPointCount; b++) { @@ -1204,7 +1204,7 @@ namespace if(bControlPoints) { const sal_uInt8 bEdgeIsCurve(aCandidate.isPrevControlPointUsed(b) || aCandidate.isNextControlPointUsed(b) ? 1 : 0); - rOut << bEdgeIsCurve; + rOut.WriteUChar( bEdgeIsCurve ); if(bEdgeIsCurve) { @@ -2626,24 +2626,24 @@ SvStream& XFillGradientItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) co if (!IsIndex()) { - rOut << (sal_Int16)aGradient.GetGradientStyle(); + rOut.WriteInt16( (sal_Int16)aGradient.GetGradientStyle() ); sal_uInt16 nTmp; - nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetRed() ); rOut << nTmp; - nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetGreen() ); rOut << nTmp; - nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetBlue() ); rOut << nTmp; - nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetRed() ); rOut << nTmp; - nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetGreen() ); rOut << nTmp; - nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetBlue() ); rOut << nTmp; - - rOut << (sal_Int32) aGradient.GetAngle(); - rOut << aGradient.GetBorder(); - rOut << aGradient.GetXOffset(); - rOut << aGradient.GetYOffset(); - rOut << aGradient.GetStartIntens(); - rOut << aGradient.GetEndIntens(); - rOut << aGradient.GetSteps(); + nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetRed() ); rOut.WriteUInt16( nTmp ); + nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetGreen() ); rOut.WriteUInt16( nTmp ); + nTmp = VCLTOSVCOL( aGradient.GetStartColor().GetBlue() ); rOut.WriteUInt16( nTmp ); + nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetRed() ); rOut.WriteUInt16( nTmp ); + nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetGreen() ); rOut.WriteUInt16( nTmp ); + nTmp = VCLTOSVCOL( aGradient.GetEndColor().GetBlue() ); rOut.WriteUInt16( nTmp ); + + rOut.WriteInt32( (sal_Int32) aGradient.GetAngle() ); + rOut.WriteUInt16( aGradient.GetBorder() ); + rOut.WriteUInt16( aGradient.GetXOffset() ); + rOut.WriteUInt16( aGradient.GetYOffset() ); + rOut.WriteUInt16( aGradient.GetStartIntens() ); + rOut.WriteUInt16( aGradient.GetEndIntens() ); + rOut.WriteUInt16( aGradient.GetSteps() ); } return rOut; @@ -3127,15 +3127,15 @@ SvStream& XFillHatchItem::Store( SvStream& rOut, sal_uInt16 nItemVersion ) const if (!IsIndex()) { - rOut << (sal_Int16)aHatch.GetHatchStyle(); + rOut.WriteInt16( (sal_Int16)aHatch.GetHatchStyle() ); sal_uInt16 nTmp; - nTmp = VCLTOSVCOL( aHatch.GetColor().GetRed() ); rOut << nTmp; - nTmp = VCLTOSVCOL( aHatch.GetColor().GetGreen() ); rOut << nTmp; - nTmp = VCLTOSVCOL( aHatch.GetColor().GetBlue() ); rOut << nTmp; + nTmp = VCLTOSVCOL( aHatch.GetColor().GetRed() ); rOut.WriteUInt16( nTmp ); + nTmp = VCLTOSVCOL( aHatch.GetColor().GetGreen() ); rOut.WriteUInt16( nTmp ); + nTmp = VCLTOSVCOL( aHatch.GetColor().GetBlue() ); rOut.WriteUInt16( nTmp ); - rOut << (sal_Int32) aHatch.GetDistance(); - rOut << (sal_Int32) aHatch.GetAngle(); + rOut.WriteInt32( (sal_Int32) aHatch.GetDistance() ); + rOut.WriteInt32( (sal_Int32) aHatch.GetAngle() ); } return rOut; diff --git a/svx/source/xoutdev/xexch.cxx b/svx/source/xoutdev/xexch.cxx index 76bffee80513..c5c67763a0cc 100644 --- a/svx/source/xoutdev/xexch.cxx +++ b/svx/source/xoutdev/xexch.cxx @@ -59,7 +59,7 @@ SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rData ) sal_uInt32 nItemCount = 0; sal_Size nFirstPos = rOStm.Tell(); - rOStm << nItemCount; + rOStm.WriteUInt32( nItemCount ); while( nWhich ) { @@ -68,7 +68,7 @@ SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rData ) VersionCompat aCompat( rOStm, STREAM_WRITE ); const sal_uInt16 nItemVersion2 = pItem->GetVersion( (sal_uInt16) rOStm.GetVersion() ); - rOStm << nWhich << nItemVersion2; + rOStm.WriteUInt16( nWhich ).WriteUInt16( nItemVersion2 ); pItem->Store( rOStm, nItemVersion2 ); nItemCount++; @@ -79,7 +79,7 @@ SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rData ) const sal_uIntPtr nLastPos = rOStm.Tell(); rOStm.Seek( nFirstPos ); - rOStm << nItemCount; + rOStm.WriteUInt32( nItemCount ); rOStm.Seek( nLastPos ); } |