diff options
author | Caolán McNamara <caolanm@redhat.com> | 2011-06-13 21:57:36 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-06-14 09:56:45 +0100 |
commit | 77e481f59551f98dbe1de884016892b95226e3b6 (patch) | |
tree | f685253a49bb7b485d90882422cf0c22a505540d /tools | |
parent | 94cc09fbd030c03eba8b41314cb5bf0356faaad7 (diff) |
Precision unused
Diffstat (limited to 'tools')
-rw-r--r-- | tools/inc/tools/stream.hxx | 15 | ||||
-rw-r--r-- | tools/source/stream/stream.cxx | 40 |
2 files changed, 15 insertions, 40 deletions
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx index 418f932fefb4..e2199dbd62a7 100644 --- a/tools/inc/tools/stream.hxx +++ b/tools/inc/tools/stream.hxx @@ -271,10 +271,16 @@ private: // Formatierung von Strings char cFiller; - sal_uInt8 nPrecision; sal_uInt8 nWidth; - sal_uInt8 nPrintfParams; - ByteString aFormatString; + + enum PrintfParams + { + SPECIAL_PARAM_NONE = 0, // Format-Str, Number + SPECIAL_PARAM_WIDTH = 1 // Format-Str, Width, Number + }; + + PrintfParams ePrintfParams; + ByteString aFormatString; // Userdata long nVersion; // for external use @@ -390,9 +396,6 @@ public: SvStream& WriteByteString( const UniString& rStr ) { return WriteByteString( rStr, GetStreamCharSet() ); } SvStream& WriteByteString( const ByteString& rStr ); - void SetPrecision( sal_uInt8 nPrec ) - { nPrecision = nPrec; CreateFormatString(); } - sal_uInt8 GetPrecision() const { return nPrecision; } void SetWidth( sal_uInt8 nWid) { nWidth = nWid; CreateFormatString(); } sal_uInt8 GetWidth() const { return nWidth; } diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx index 6a71571ec9db..ff0f2eeb518b 100644 --- a/tools/source/stream/stream.cxx +++ b/tools/source/stream/stream.cxx @@ -61,14 +61,6 @@ DBG_NAME( Stream ) // ----------------------------------------------------------------------- -// sprintf Param-Mode -#define SPECIAL_PARAM_NONE 0 // Format-Str, Number -#define SPECIAL_PARAM_WIDTH 1 // Format-Str, Width, Number -#define SPECIAL_PARAM_PRECISION 2 // Format-Str, Precision, Number -#define SPECIAL_PARAM_BOTH 3 // Format-Str, Width, Precision, Number - -// ----------------------------------------------------------------------- - // !!! Nicht inline, wenn Operatoren <<,>> inline sind inline static void SwapUShort( sal_uInt16& r ) { r = SWAPSHORT(r); } @@ -466,7 +458,6 @@ void SvStream::ImpInit() eIOMode = STREAM_IO_DONTKNOW; nBufFree = 0; - nPrecision = 0; // all significant digits nWidth = 0; // default width cFiller = ' '; eStreamMode = 0; @@ -1960,23 +1951,14 @@ void SvStream::RefreshBuffer() void SvStream::CreateFormatString() { aFormatString = '%'; - nPrintfParams = SPECIAL_PARAM_NONE; + ePrintfParams = SPECIAL_PARAM_NONE; if( nWidth ) { if( cFiller != ' ' ) aFormatString += '0'; aFormatString += '*'; - nPrintfParams = SPECIAL_PARAM_WIDTH; - } - - if( nPrecision ) - { - aFormatString += ".*"; - if( nWidth ) - nPrintfParams = SPECIAL_PARAM_BOTH; - else - nPrintfParams = SPECIAL_PARAM_PRECISION; + ePrintfParams = SPECIAL_PARAM_WIDTH; } } @@ -1991,8 +1973,8 @@ SvStream& SvStream::WriteNumber( sal_Int32 nInt32 ) char buffer[256+12]; ByteString aFStr( aFormatString); aFStr += SAL_PRIdINT32; - sal_Size nLen; - switch ( nPrintfParams ) + sal_Size nLen = 0; + switch ( ePrintfParams ) { case SPECIAL_PARAM_NONE : nLen = sprintf(buffer, aFStr.GetBuffer(), nInt32); @@ -2000,11 +1982,6 @@ SvStream& SvStream::WriteNumber( sal_Int32 nInt32 ) case SPECIAL_PARAM_WIDTH : nLen = sprintf(buffer, aFStr.GetBuffer(), nWidth, nInt32); break; - case SPECIAL_PARAM_PRECISION : - nLen = sprintf(buffer, aFStr.GetBuffer(), nPrecision, nInt32); - break; - default: - nLen = sprintf(buffer, aFStr.GetBuffer(), nWidth, nPrecision, nInt32); } Write( buffer, nLen ); return *this; @@ -2015,8 +1992,8 @@ SvStream& SvStream::WriteNumber( sal_uInt32 nUInt32 ) char buffer[256+12]; ByteString aFStr( aFormatString); aFStr += SAL_PRIuUINT32; - sal_Size nLen; - switch ( nPrintfParams ) + sal_Size nLen = 0; + switch ( ePrintfParams ) { case SPECIAL_PARAM_NONE : nLen = sprintf(buffer, aFStr.GetBuffer(), nUInt32); @@ -2024,11 +2001,6 @@ SvStream& SvStream::WriteNumber( sal_uInt32 nUInt32 ) case SPECIAL_PARAM_WIDTH : nLen = sprintf(buffer, aFStr.GetBuffer(), nWidth, nUInt32); break; - case SPECIAL_PARAM_PRECISION : - nLen = sprintf(buffer, aFStr.GetBuffer(), nPrecision, nUInt32); - break; - default: - nLen = sprintf(buffer,aFStr.GetBuffer(), nWidth, nPrecision, nUInt32); } Write( buffer, nLen ); return *this; |