From 666e9661d4740aad282364dc7f6275c6af2894df Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Sun, 12 Jun 2011 23:56:25 +0100 Subject: [PATCH] Remove dodgy and unused ReadNumber --- tools/inc/tools/stream.hxx | 48 ------------------- tools/source/stream/stream.cxx | 84 ---------------------------------- 2 files changed, 132 deletions(-) diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx index 55749fac7fb3..9775e6e00549 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -411,14 +411,6 @@ public: { nJustification = nJus; CreateFormatString(); } sal_uInt8 GetJustification() const { return nJustification; } - SvStream& ReadNumber( short& rShort ); - SvStream& ReadNumber( sal_uInt16& rUInt16 ); - SvStream& ReadNumber( long& rLong ); - SvStream& ReadNumber( sal_uInt32& rUInt32 ); - SvStream& ReadNumber( int& rInt ); - SvStream& ReadNumber( float& rFloat ); - SvStream& ReadNumber( double& rDouble ); - SvStream& WriteNumber( short nShort ); SvStream& WriteNumber( sal_uInt16 nUInt16 ); SvStream& WriteNumber( long nLong ); @@ -575,38 +567,6 @@ inline SvStream& operator<<( SvStream& rStr, SvStrPtr f ) return rStr; } -inline SvStream& SvStream::ReadNumber( short& rShort ) -{ - long nTmp; - ReadNumber( nTmp ); - rShort = (short)nTmp; - return *this; -} - -inline SvStream& SvStream::ReadNumber( sal_uInt16& rUShort ) -{ - sal_uInt32 nTmp; - ReadNumber( nTmp ); - rUShort = (sal_uInt16)nTmp; - return *this; -} - -inline SvStream& SvStream::ReadNumber( int& rInt ) -{ - long nTmp; - ReadNumber( nTmp ); - rInt = (int)nTmp; - return *this; -} - -inline SvStream& SvStream::ReadNumber( float& rFloat ) -{ - double nTmp; - ReadNumber( nTmp ); - rFloat = (float)nTmp; - return *this; -} - inline SvStream& SvStream::WriteNumber( short nShort ) { WriteNumber( (long)nShort ); @@ -625,14 +585,6 @@ inline SvStream& SvStream::WriteNumber( int nInt ) return *this; } -/* -inline SvStream& SvStream::WriteNumber( unsigned int nUInt ) -{ - WriteNumber( (sal_uIntPtr)nUInt ); - return *this; -} -*/ - inline SvStream& SvStream::WriteNumber( float nFloat ) { double nTemp = nFloat; diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 4941e9fe79ce..d9c5928e4ad9 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -1987,90 +1987,6 @@ void SvStream::CreateFormatString() } } -/************************************************************************* -|* -|* Stream::ReadNumber() -|* -*************************************************************************/ - -#define BUFSIZE_LONG 21 // log( 2 hoch 64 ) + 1 - -SvStream& SvStream::ReadNumber( long& rLong ) -{ - EatWhite(); - if( bIsEof || nError ) - { - SetError( SVSTREAM_GENERALERROR ); - return *this; - } - sal_Size nFPtr = Tell(); - char buf[ BUFSIZE_LONG ]; - memset( buf, 0, BUFSIZE_LONG ); - sal_Size nTemp = Read( buf, BUFSIZE_LONG-1 ); - if( !nTemp || nError ) - { - SetError( SVSTREAM_GENERALERROR ); - return *this; - } - char *pEndPtr; - rLong = strtol( buf, &pEndPtr, (int)nRadix ); - nFPtr += ( (sal_Size)pEndPtr - (sal_Size)(&(buf[0])) ); - Seek( nFPtr ); - bIsEof = sal_False; - return *this; -} - -SvStream& SvStream::ReadNumber( sal_uInt32& rUInt32 ) -{ - EatWhite(); - if( bIsEof || nError ) - { - SetError( SVSTREAM_GENERALERROR ); - return *this; - } - sal_Size nFPtr = Tell(); - char buf[ BUFSIZE_LONG ]; - memset( buf, 0, BUFSIZE_LONG ); - sal_Size nTemp = Read( buf, BUFSIZE_LONG-1 ); - if( !nTemp || nError ) - { - SetError( SVSTREAM_GENERALERROR ); - return *this; - } - char *pEndPtr; - rUInt32 = strtoul( buf, &pEndPtr, (int)nRadix ); - nFPtr += ( (sal_uIntPtr)pEndPtr - (sal_uIntPtr)buf ); - Seek( nFPtr ); - bIsEof = sal_False; - return *this; -} - -SvStream& SvStream::ReadNumber( double& rDouble ) -{ - EatWhite(); - if( bIsEof || nError ) - { - SetError( SVSTREAM_GENERALERROR ); - return *this; - } - sal_Size nFPtr = Tell(); - char buf[ BUFSIZE_LONG ]; - memset( buf, 0, BUFSIZE_LONG ); - sal_Size nTemp = Read( buf, BUFSIZE_LONG-1 ); - if( !nTemp || nError ) - { - SetError( SVSTREAM_GENERALERROR ); - return *this; - } - char *pEndPtr; - rDouble = strtod( buf, &pEndPtr ); - nFPtr += ( (sal_Size)pEndPtr - (sal_Size)buf ); - Seek( nFPtr ); - bIsEof = sal_False; - return *this; -} - - /************************************************************************* |* |* Stream::WriteNumber()