diff options
author | Noel Grandin <noel@peralex.com> | 2014-02-05 10:41:04 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2014-02-12 15:31:40 +0000 |
commit | 15535e32ddcfee451d4dbc9be9de0b8c9f9d78d4 (patch) | |
tree | db4badc477cea1ecd51f5fab82ce0f24ae20f155 /tools | |
parent | 7accbd8c0d7f1d0b87748f0de599c4d8b469a61e (diff) |
convert SvStream::operator>> methods to ReadXXX methods
First, I updated the clang rewriter to do the conversion.
Then I lightly hand-tweaked the output for the few places where
the rewriter messed up, mostly when dealing with calls on "this".
Change-Id: I40a6a977959cd97415c678eafc8507de8aa3b1a9
Reviewed-on: https://gerrit.libreoffice.org/7879
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/qa/cppunit/test_stream.cxx | 8 | ||||
-rw-r--r-- | tools/source/generic/color.cxx | 10 | ||||
-rw-r--r-- | tools/source/generic/fract.cxx | 4 | ||||
-rw-r--r-- | tools/source/generic/gen.cxx | 4 | ||||
-rw-r--r-- | tools/source/generic/poly.cxx | 6 | ||||
-rw-r--r-- | tools/source/generic/poly2.cxx | 4 | ||||
-rw-r--r-- | tools/source/inet/inetmsg.cxx | 10 | ||||
-rw-r--r-- | tools/source/ref/globname.cxx | 6 | ||||
-rw-r--r-- | tools/source/ref/pstm.cxx | 22 | ||||
-rw-r--r-- | tools/source/stream/stream.cxx | 26 | ||||
-rw-r--r-- | tools/source/stream/vcompat.cxx | 4 | ||||
-rw-r--r-- | tools/source/zcodec/zcodec.cxx | 12 |
12 files changed, 58 insertions, 58 deletions
diff --git a/tools/qa/cppunit/test_stream.cxx b/tools/qa/cppunit/test_stream.cxx index 677e698de23d..8389bcc1fb33 100644 --- a/tools/qa/cppunit/test_stream.cxx +++ b/tools/qa/cppunit/test_stream.cxx @@ -49,7 +49,7 @@ namespace CPPUNIT_ASSERT(std_a == 'f'); char tools_a(78); - aMemStream >> tools_a; + aMemStream.ReadChar( tools_a ); CPPUNIT_ASSERT(tools_a == 'f'); iss.seekg(0, std::ios_base::end); @@ -75,7 +75,7 @@ namespace CPPUNIT_ASSERT(iss.rdstate() == (std::ios::failbit|std::ios::eofbit)); tools_a = 78; - aMemStream >> tools_a; + aMemStream.ReadChar( tools_a ); //so, now eof is set CPPUNIT_ASSERT(aMemStream.eof()); //a failed read doesn't change the data, it remains unchanged @@ -92,7 +92,7 @@ namespace aMemStream.SeekRel(-1); CPPUNIT_ASSERT(!aMemStream.eof()); CPPUNIT_ASSERT(aMemStream.good()); - aMemStream >> tools_b; + aMemStream.ReadUInt16( tools_b ); CPPUNIT_ASSERT(!aMemStream.good()); CPPUNIT_ASSERT(aMemStream.eof()); CPPUNIT_ASSERT(tools_b == 0x1122); @@ -105,7 +105,7 @@ namespace aMemStream.Seek(0); CPPUNIT_ASSERT(aMemStream.good()); - aMemStream >> tools_a; + aMemStream.ReadChar( tools_a ); CPPUNIT_ASSERT(tools_a == 'f'); //failbit is rather subtle wrt e.g seeks diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx index 2c3fc5ade570..909a4e82470f 100644 --- a/tools/source/generic/color.cxx +++ b/tools/source/generic/color.cxx @@ -215,7 +215,7 @@ ColorData Color::HSBtoRGB( sal_uInt16 nHue, sal_uInt16 nSat, sal_uInt16 nBri ) SvStream& Color::Read( SvStream& rIStm, bool bNewFormat ) { if ( bNewFormat ) - rIStm >> mnColor; + rIStm.ReadUInt32( mnColor ); else ReadColor( rIStm, *this ); @@ -240,7 +240,7 @@ SvStream& ReadColor( SvStream& rIStream, Color& rColor ) sal_uInt16 nColorName; - rIStream >> nColorName; + rIStream.ReadUInt16( nColorName ); if ( nColorName & COL_NAME_USER ) { @@ -248,9 +248,9 @@ SvStream& ReadColor( SvStream& rIStream, Color& rColor ) sal_uInt16 nGreen; sal_uInt16 nBlue; - rIStream >> nRed; - rIStream >> nGreen; - rIStream >> nBlue; + rIStream.ReadUInt16( nRed ); + rIStream.ReadUInt16( nGreen ); + rIStream.ReadUInt16( nBlue ); rColor.mnColor = RGB_COLORDATA( nRed>>8, nGreen>>8, nBlue>>8 ); } diff --git a/tools/source/generic/fract.cxx b/tools/source/generic/fract.cxx index 0bfae055ac81..feee316a50e7 100644 --- a/tools/source/generic/fract.cxx +++ b/tools/source/generic/fract.cxx @@ -486,9 +486,9 @@ SvStream& ReadFraction( SvStream& rIStream, Fraction& rFract ) { //fdo#39428 SvStream no longer supports operator>>(long&) sal_Int32 nTmp(0); - rIStream >> nTmp; + rIStream.ReadInt32( nTmp ); rFract.nNumerator = nTmp; - rIStream >> nTmp; + rIStream.ReadInt32( nTmp ); rFract.nDenominator = nTmp; return rIStream; } diff --git a/tools/source/generic/gen.cxx b/tools/source/generic/gen.cxx index 0a49fd40bb5f..723f9137c15e 100644 --- a/tools/source/generic/gen.cxx +++ b/tools/source/generic/gen.cxx @@ -27,7 +27,7 @@ SvStream& ReadPair( SvStream& rIStream, Pair& rPair ) //39428 SvStream no longer supports operator>>(long&) sal_Int32 nTmpA(0), nTmpB(0); - rIStream >> nTmpA >> nTmpB; + rIStream.ReadInt32( nTmpA ).ReadInt32( nTmpB ); rPair.nA = nTmpA; rPair.nB = nTmpB; @@ -176,7 +176,7 @@ SvStream& ReadRectangle( SvStream& rIStream, Rectangle& rRect ) //fdo#39428 SvStream no longer supports operator>>(long&) sal_Int32 nTmpL(0), nTmpT(0), nTmpR(0), nTmpB(0); - rIStream >> nTmpL >> nTmpT >> nTmpR >> nTmpB; + rIStream.ReadInt32( nTmpL ).ReadInt32( nTmpT ).ReadInt32( nTmpR ).ReadInt32( nTmpB ); rRect.nLeft = nTmpL; rRect.nTop = nTmpT; diff --git a/tools/source/generic/poly.cxx b/tools/source/generic/poly.cxx index 2da3bb396694..3a25b9b7796d 100644 --- a/tools/source/generic/poly.cxx +++ b/tools/source/generic/poly.cxx @@ -1509,7 +1509,7 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly ) sal_uInt16 nPoints; // read all points and create array - rIStream >> nPoints; + rIStream.ReadUInt16( nPoints ); if ( rPoly.mpImplPolygon->mnRefCount != 1 ) { if ( rPoly.mpImplPolygon->mnRefCount ) @@ -1535,7 +1535,7 @@ SvStream& ReadPolygon( SvStream& rIStream, Polygon& rPoly ) { //fdo#39428 SvStream no longer supports operator>>(long&) sal_Int32 nTmpX(0), nTmpY(0); - rIStream >> nTmpX >> nTmpY; + rIStream.ReadInt32( nTmpX ).ReadInt32( nTmpY ); rPoly.mpImplPolygon->mpPointAry[i].X() = nTmpX; rPoly.mpImplPolygon->mpPointAry[i].Y() = nTmpY; } @@ -1591,7 +1591,7 @@ void Polygon::ImplRead( SvStream& rIStream ) sal_uInt8 bHasPolyFlags; ReadPolygon( rIStream, *this ); - rIStream >> bHasPolyFlags; + rIStream.ReadUChar( bHasPolyFlags ); if ( bHasPolyFlags ) { diff --git a/tools/source/generic/poly2.cxx b/tools/source/generic/poly2.cxx index c168196ee2ff..24a5f8522686 100644 --- a/tools/source/generic/poly2.cxx +++ b/tools/source/generic/poly2.cxx @@ -561,7 +561,7 @@ SvStream& ReadPolyPolygon( SvStream& rIStream, PolyPolygon& rPolyPoly ) sal_uInt16 nPolyCount; // read number of polygons - rIStream >> nPolyCount; + rIStream.ReadUInt16( nPolyCount ); if( nPolyCount ) { @@ -610,7 +610,7 @@ void PolyPolygon::Read( SvStream& rIStream ) sal_uInt16 nPolyCount; // Read number of polygons - rIStream >> nPolyCount; + rIStream.ReadUInt16( nPolyCount ); if( nPolyCount ) { diff --git a/tools/source/inet/inetmsg.cxx b/tools/source/inet/inetmsg.cxx index 7bc94e5ecb0d..9d982e0bd4a5 100644 --- a/tools/source/inet/inetmsg.cxx +++ b/tools/source/inet/inetmsg.cxx @@ -124,12 +124,12 @@ SvStream& INetMessage::operator>> (SvStream& rStrm) sal_uInt32 nTemp; // Copy. - rStrm >> nTemp; + rStrm.ReadUInt32( nTemp ); m_nDocSize = nTemp; m_aDocName = read_lenPrefixed_uInt8s_ToOUString<sal_uInt16>(rStrm, RTL_TEXTENCODING_UTF8); sal_uIntPtr i, n = 0; - rStrm >> nTemp; + rStrm.ReadUInt32( nTemp ); n = nTemp; for (i = 0; i < n; i++) @@ -623,7 +623,7 @@ SvStream& INetRFC822Message::operator>> (SvStream& rStrm) sal_uInt32 nTemp; for (sal_uInt16 i = 0; i < INETMSG_RFC822_NUMHDR; i++) { - rStrm >> nTemp; + rStrm.ReadUInt32( nTemp ); m_nIndex[i] = nTemp; } @@ -1031,13 +1031,13 @@ SvStream& INetMIMEMessage::operator>> (SvStream& rStrm) sal_uInt32 nTemp; for (sal_uInt16 i = 0; i < INETMSG_MIME_NUMHDR; i++) { - rStrm >> nTemp; + rStrm.ReadUInt32( nTemp ); m_nIndex[i] = nTemp; } m_aBoundary = read_lenPrefixed_uInt8s_ToOString<sal_uInt16>(rStrm); - rStrm >> nTemp; + rStrm.ReadUInt32( nTemp ); return rStrm; } diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx index f23b1ea6ca7d..3fe206497344 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -142,14 +142,14 @@ SvStream& operator >> ( SvStream& rStr, SvGlobalName & rObj ) rObj.NewImp(); // copy if necessary sal_uInt32 a; - rStr >> a; + rStr.ReadUInt32( a ); memcpy(rObj.pImp->szData, &a, sizeof(sal_uInt32)); sal_uInt16 b; - rStr >> b; + rStr.ReadUInt16( b ); memcpy(rObj.pImp->szData+4, &b, sizeof(sal_uInt16)); - rStr >> b; + rStr.ReadUInt16( b ); memcpy(rObj.pImp->szData+6, &b, sizeof(sal_uInt16)); rStr.Read( (sal_Char *)&rObj.pImp->szData[ 8 ], 8 ); diff --git a/tools/source/ref/pstm.cxx b/tools/source/ref/pstm.cxx index 2f20664b56c6..c9d172768186 100644 --- a/tools/source/ref/pstm.cxx +++ b/tools/source/ref/pstm.cxx @@ -86,7 +86,7 @@ void TOOLS_DLLPUBLIC WritePersistListObjects(const SvPersistListWriteable& rList void TOOLS_DLLPUBLIC ReadObjects( SvPersistListReadable& rLst, SvPersistStream & rStm ) { sal_uInt8 nVer; - rStm >> nVer; + rStm.ReadUChar( nVer ); if( (nVer & ~PERSIST_LIST_DBGUTIL) != PERSIST_LIST_VER ) { @@ -99,7 +99,7 @@ void TOOLS_DLLPUBLIC ReadObjects( SvPersistListReadable& rLst, SvPersistStream & nObjLen = rStm.ReadLen( &nObjPos ); sal_uInt32 nCount; - rStm >> nCount; + rStm.ReadUInt32( nCount ); for( sal_uIntPtr n = 0; n < nCount && rStm.GetError() == SVSTREAM_OK; n++ ) { SvPersistBase * pObj; @@ -269,25 +269,25 @@ sal_uInt32 SvPersistStream::ReadCompressed( SvStream & rStm ) { sal_uInt32 nRet(0); sal_uInt8 nMask; - rStm >> nMask; + rStm.ReadUChar( nMask ); if( nMask & LEN_1 ) nRet = ~LEN_1 & nMask; else if( nMask & LEN_2 ) { nRet = ~LEN_2 & nMask; nRet <<= 8; - rStm >> nMask; + rStm.ReadUChar( nMask ); nRet |= nMask; } else if( nMask & LEN_4 ) { nRet = ~LEN_4 & nMask; nRet <<= 8; - rStm >> nMask; + rStm.ReadUChar( nMask ); nRet |= nMask; nRet <<= 16; sal_uInt16 n; - rStm >> n; + rStm.ReadUInt16( n ); nRet |= n; } else if( nMask & LEN_5 ) @@ -297,7 +297,7 @@ sal_uInt32 SvPersistStream::ReadCompressed( SvStream & rStm ) rStm.SetError( SVSTREAM_FILEFORMAT_ERROR ); OSL_FAIL( "format error" ); } - rStm >> nRet; + rStm.ReadUInt32( nRet ); } else { @@ -418,7 +418,7 @@ void SvPersistStream::WriteLen( sal_uInt32 nObjPos ) sal_uInt32 SvPersistStream::ReadLen( sal_uInt32 * pTestPos ) { sal_uInt32 nLen; - *this >> nLen; + ReadUInt32( nLen ); if( pTestPos ) *pTestPos = Tell(); return nLen; @@ -484,7 +484,7 @@ static void ReadId ) { nClassId = 0; - rStm >> nHdr; + rStm.ReadUChar( nHdr ); if( nHdr & P_ID_0 ) nId = 0; else @@ -696,11 +696,11 @@ SvStream& operator >> rThis.SetStream( &rStm ); sal_uInt8 nVers; - rThis >> nVers; // Version + rThis.ReadUChar( nVers ); // Version if( 0 == nVers ) { sal_uInt32 nCount = 0; - rThis >> nCount; + rThis.ReadUInt32( nCount ); for( sal_uInt32 i = 0; i < nCount; i++ ) { SvPersistBase * pEle; diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index ccb25d3d17f4..bcd73c52ce2d 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -813,7 +813,7 @@ bool SvStream::StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet ) bool bTryUtf8 = false; sal_uInt16 nFlag; sal_sSize nBack = sizeof(nFlag); - *this >> nFlag; + this->ReadUInt16( nFlag ); switch ( nFlag ) { case 0xfeff : @@ -850,7 +850,7 @@ bool SvStream::StartReadingUnicodeText( rtl_TextEncoding eReadBomCharSet ) { unsigned char nChar; nBack += sizeof(nChar); - *this >> nChar; + this->ReadUChar( nChar ); if (nChar == 0xbf) nBack = 0; // it is UTF-8 } @@ -879,7 +879,7 @@ sal_Size SvStream::SeekRel( sal_sSize nPos ) return Seek( nActualPos ); } -SvStream& SvStream::operator>>(sal_uInt16& r) +SvStream& SvStream::ReadUInt16(sal_uInt16& r) { sal_uInt16 n = 0; READNUMBER_WITHOUT_SWAP(sal_uInt16, n) @@ -892,7 +892,7 @@ SvStream& SvStream::operator>>(sal_uInt16& r) return *this; } -SvStream& SvStream::operator>>(sal_uInt32& r) +SvStream& SvStream::ReadUInt32(sal_uInt32& r) { sal_uInt32 n = 0; READNUMBER_WITHOUT_SWAP(sal_uInt32, n) @@ -905,7 +905,7 @@ SvStream& SvStream::operator>>(sal_uInt32& r) return *this; } -SvStream& SvStream::operator>>(sal_uInt64& r) +SvStream& SvStream::ReadUInt64(sal_uInt64& r) { sal_uInt64 n = 0; READNUMBER_WITHOUT_SWAP(sal_uInt64, n) @@ -918,7 +918,7 @@ SvStream& SvStream::operator>>(sal_uInt64& r) return *this; } -SvStream& SvStream::operator>>(sal_Int16& r) +SvStream& SvStream::ReadInt16(sal_Int16& r) { sal_Int16 n = 0; READNUMBER_WITHOUT_SWAP(sal_Int16, n) @@ -931,7 +931,7 @@ SvStream& SvStream::operator>>(sal_Int16& r) return *this; } -SvStream& SvStream::operator>>(sal_Int32& r) +SvStream& SvStream::ReadInt32(sal_Int32& r) { sal_Int32 n = 0; READNUMBER_WITHOUT_SWAP(sal_Int32, n) @@ -957,7 +957,7 @@ SvStream& SvStream::ReadInt64(sal_Int64& r) return *this; } -SvStream& SvStream::operator>>( signed char& r ) +SvStream& SvStream::ReadSChar( signed char& r ) { if( (bIoRead || !bIsConsistent) && sizeof(signed char) <= nBufFree ) @@ -974,7 +974,7 @@ SvStream& SvStream::operator>>( signed char& r ) // Special treatment for Chars due to PutBack -SvStream& SvStream::operator>>( char& r ) +SvStream& SvStream::ReadChar( char& r ) { if( (bIoRead || !bIsConsistent) && sizeof(char) <= nBufFree ) @@ -989,7 +989,7 @@ SvStream& SvStream::operator>>( char& r ) return *this; } -SvStream& SvStream::operator>>( unsigned char& r ) +SvStream& SvStream::ReadUChar( unsigned char& r ) { if( (bIoRead || !bIsConsistent) && sizeof(char) <= nBufFree ) @@ -1004,7 +1004,7 @@ SvStream& SvStream::operator>>( unsigned char& r ) return *this; } -SvStream& SvStream::operator>>(float& r) +SvStream& SvStream::ReadFloat(float& r) { float n = 0; READNUMBER_WITHOUT_SWAP(float, n) @@ -1019,7 +1019,7 @@ SvStream& SvStream::operator>>(float& r) return *this; } -SvStream& SvStream::operator>>(double& r) +SvStream& SvStream::ReadDouble(double& r) { double n = 0; READNUMBER_WITHOUT_SWAP(double, n) @@ -1034,7 +1034,7 @@ SvStream& SvStream::operator>>(double& r) return *this; } -SvStream& SvStream::operator>> ( SvStream& rStream ) +SvStream& SvStream::ReadStream( SvStream& rStream ) { const sal_uInt32 cBufLen = 0x8000; char* pBuf = new char[ cBufLen ]; diff --git a/tools/source/stream/vcompat.cxx b/tools/source/stream/vcompat.cxx index 63575a951aa0..afd3fe545195 100644 --- a/tools/source/stream/vcompat.cxx +++ b/tools/source/stream/vcompat.cxx @@ -37,8 +37,8 @@ VersionCompat::VersionCompat( SvStream& rStm, sal_uInt16 nStreamMode, sal_uInt16 } else { - *mpRWStm >> mnVersion; - *mpRWStm >> mnTotalSize; + mpRWStm->ReadUInt16( mnVersion ); + mpRWStm->ReadUInt32( mnTotalSize ); mnCompatPos = mpRWStm->Tell(); } } diff --git a/tools/source/zcodec/zcodec.cxx b/tools/source/zcodec/zcodec.cxx index 0d0ad2be93e0..fe2e573699b1 100644 --- a/tools/source/zcodec/zcodec.cxx +++ b/tools/source/zcodec/zcodec.cxx @@ -347,12 +347,12 @@ void ZCodec::ImplInitBuf ( bool nIOFlag ) sal_uInt8 n1, n2, j, nMethod, nFlags; for ( int i = 0; i < 2; i++ ) // gz - magic number { - *mpIStm >> j; + mpIStm->ReadUChar( j ); if ( j != gz_magic[ i ] ) mbStatus = false; } - *mpIStm >> nMethod; - *mpIStm >> nFlags; + mpIStm->ReadUChar( nMethod ); + mpIStm->ReadUChar( nFlags ); if ( nMethod != Z_DEFLATED ) mbStatus = false; if ( ( nFlags & GZ_RESERVED ) != 0 ) @@ -362,7 +362,7 @@ void ZCodec::ImplInitBuf ( bool nIOFlag ) /* skip the extra field */ if ( nFlags & GZ_EXTRA_FIELD ) { - *mpIStm >> n1 >> n2; + mpIStm->ReadUChar( n1 ).ReadUChar( n2 ); mpIStm->SeekRel( n1 + ( n2 << 8 ) ); } /* skip the original file name */ @@ -370,7 +370,7 @@ void ZCodec::ImplInitBuf ( bool nIOFlag ) { do { - *mpIStm >> j; + mpIStm->ReadUChar( j ); } while ( j && !mpIStm->IsEof() ); } @@ -379,7 +379,7 @@ void ZCodec::ImplInitBuf ( bool nIOFlag ) { do { - *mpIStm >> j; + mpIStm->ReadUChar( j ); } while ( j && !mpIStm->IsEof() ); } |