[Libreoffice-commits] .: binfilter/bf_svtools binfilter/inc

Norbert Thiebaud nthiebaud at kemper.freedesktop.org
Fri Jan 14 14:57:12 PST 2011


 binfilter/bf_svtools/source/filerec/svt_filerec.cxx |   23 ++------------------
 binfilter/inc/bf_svtools/filerec.hxx                |   19 ++++++----------
 2 files changed, 10 insertions(+), 32 deletions(-)

New commits:
commit e14a513898c1dc7725647d9940a3904a7afad504
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Fri Jan 14 16:56:36 2011 -0600

    remove a case of debug-only 3-state pseudo-bolean.

diff --git a/binfilter/bf_svtools/source/filerec/svt_filerec.cxx b/binfilter/bf_svtools/source/filerec/svt_filerec.cxx
index 13d4c22..cbbf903 100644
--- a/binfilter/bf_svtools/source/filerec/svt_filerec.cxx
+++ b/binfilter/bf_svtools/source/filerec/svt_filerec.cxx
@@ -122,26 +122,9 @@ UINT32 SfxMiniRecordWriter::Close
             _pStream->Seek( nEndPos );
 
         // Header wurde JETZT geschrieben
-        _bHeaderOk = TRUE;
+        _bHeaderOk = true;
         return nEndPos;
     }
-#ifdef DBG_UTIL
-    // mu\s Fix-Size-Record gepr"uft werden?
-    else if ( SFX_BOOL_DONTCARE == _bHeaderOk )
-    {
-        // Header auslesen, um Soll-Gr"o\se zu bestimmen
-        UINT32 nEndPos = _pStream->Tell();
-        _pStream->Seek( _nStartPos );
-        UINT32 nHeader;
-        *_pStream >> nHeader;
-        _pStream->Seek( nEndPos );
-
-        // Soll-Gr"o\se mit Ist-Gr"o\se vergleichen
-        DBG_ASSERT( nEndPos - SFX_REC_OFS(nHeader) == _nStartPos + sizeof(UINT32),
-                    "fixed record size incorrect" );
-        DbgOutf( "SfxFileRec: written record until %ul", nEndPos );
-    }
-#endif
 
     // Record war bereits geschlossen
     return 0;
@@ -161,7 +144,7 @@ bool SfxMiniRecordReader::SetHeader_Impl( UINT32 nHeader )
 */
 
 {
-    bool bRet = TRUE;
+    bool bRet = true;
 
     // Record-Ende und Pre-Tag aus dem Header ermitteln
     _nEofRec = _pStream->Tell() + SFX_REC_OFS(nHeader);
@@ -171,7 +154,7 @@ bool SfxMiniRecordReader::SetHeader_Impl( UINT32 nHeader )
     if ( _nPreTag == SFX_REC_PRETAG_EOR )
     {
         _pStream->SetError( ERRCODE_IO_WRONGFORMAT );
-        bRet = FALSE;
+        bRet = false;
     }
     return bRet;
 }
diff --git a/binfilter/inc/bf_svtools/filerec.hxx b/binfilter/inc/bf_svtools/filerec.hxx
index e74a4bd..932cf0f 100644
--- a/binfilter/inc/bf_svtools/filerec.hxx
+++ b/binfilter/inc/bf_svtools/filerec.hxx
@@ -42,8 +42,6 @@ SV_DECL_VARARR( SfxUINT32s, UINT32, 8, 8 )
 
 //------------------------------------------------------------------------
 
-#define SFX_BOOL_DONTCARE				BOOL(2) 	// Don't-Care-Wert f"ur BOOLs
-
 #define SFX_REC_PRETAG_EXT				BYTE(0x00)	// Pre-Tag f"ur Extended-Records
 #define SFX_REC_PRETAG_EOR				BYTE(0xFF)	// Pre-Tag f"ur End-Of-Records
 
@@ -226,10 +224,7 @@ class  SfxMiniRecordWriter
 protected:
     SvStream*		_pStream;	//	<SvStream>, in dem der Record liegt
     UINT32			_nStartPos; //	Start-Position des Gesamt-Records im Stream
-    bool		_bHeaderOk; /*	TRUE, wenn der Header schon geschrieben ist;
-                                    bei DBG_UTIL wird SFX_BOOL_DONTCARE ver-
-                                    wendet, um die Gr"o\se von Fix-Sized-Records
-                                    zu pr"ufen. */
+    bool		_bHeaderOk; /*	TRUE, wenn der Header schon geschrieben ist; */
     BYTE			_nPreTag;	//	in den Header zu schreibendes 'Pre-Tag'
 
 public:
@@ -700,7 +695,7 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter
 
 :   _pStream( pStream ),
     _nStartPos( pStream->Tell() ),
-    _bHeaderOk(FALSE),
+    _bHeaderOk(false),
     _nPreTag( nTag )
 {
     DBG_ASSERT( _nPreTag != 0xFF, "invalid Tag" );
@@ -727,7 +722,7 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter
 :   _pStream( pStream ),
     // _nTag( uninitialized ),
     // _nStarPos( uninitialized ),
-    _bHeaderOk(SFX_BOOL_DONTCARE)
+    _bHeaderOk(true)
 {
     DBG_ASSERT( nTag != 0 && nTag != 0xFF, "invalid Tag" );
     DBG(_nStartPos = pStream->Tell());
@@ -749,7 +744,7 @@ inline SfxMiniRecordWriter::~SfxMiniRecordWriter()
 
 {
     // wurde der Header noch nicht geschrieben oder mu\s er gepr"uft werden
-    if ( !_bHeaderOk DBG(||TRUE) )
+    if ( !_bHeaderOk)
         Close();
 }
 
@@ -773,7 +768,7 @@ inline SvStream& SfxMiniRecordWriter::operator*() const
 inline void	SfxMiniRecordWriter::Reset()
 {
     _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI );
-    _bHeaderOk = FALSE;
+    _bHeaderOk = false;
 }
 
 //=========================================================================
@@ -892,7 +887,7 @@ inline void	SfxSingleRecordWriter::Reset()
 {
     _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI +
                                  SFX_REC_HEADERSIZE_SINGLE );
-    _bHeaderOk = FALSE;
+    _bHeaderOk = false;
 }
 
 //=========================================================================
@@ -1013,7 +1008,7 @@ inline void	SfxMultiFixRecordWriter::Reset()
     _pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI +
                                  SFX_REC_HEADERSIZE_SINGLE +
                                  SFX_REC_HEADERSIZE_MULTI );
-    _bHeaderOk = FALSE;
+    _bHeaderOk = false;
 }
 
 //=========================================================================


More information about the Libreoffice-commits mailing list