[Libreoffice-commits] .: svl/inc svl/source
Norbert Thiebaud
nthiebaud at kemper.freedesktop.org
Fri Jan 14 05:49:04 PST 2011
svl/inc/svl/filerec.hxx | 19 +++++++------------
svl/source/filerec/filerec.cxx | 19 +------------------
2 files changed, 8 insertions(+), 30 deletions(-)
New commits:
commit 7c9cd0fae50a8b201e40c26bd85449db5c21fdb0
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Fri Jan 14 07:48:54 2011 -0600
remove a debug-only 3-state confusing pseudo-boolean...
diff --git a/svl/inc/svl/filerec.hxx b/svl/inc/svl/filerec.hxx
index 42644da..b2fdb8a 100644
--- a/svl/inc/svl/filerec.hxx
+++ b/svl/inc/svl/filerec.hxx
@@ -40,8 +40,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
@@ -224,10 +222,7 @@ class SVL_DLLPUBLIC 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:
@@ -709,7 +704,7 @@ inline SfxMiniRecordWriter::SfxMiniRecordWriter
: _pStream( pStream ),
_nStartPos( pStream->Tell() ),
- _bHeaderOk(FALSE),
+ _bHeaderOk(false),
_nPreTag( nTag )
{
DBG_ASSERT( _nPreTag != 0xFF, "invalid Tag" );
@@ -736,7 +731,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());
@@ -758,7 +753,7 @@ inline SfxMiniRecordWriter::~SfxMiniRecordWriter()
{
// wurde der Header noch nicht geschrieben oder mu\s er gepr"uft werden
- if ( !_bHeaderOk DBG(||TRUE) )
+ if ( !_bHeaderOk )
Close();
}
@@ -782,7 +777,7 @@ inline SvStream& SfxMiniRecordWriter::operator*() const
inline void SfxMiniRecordWriter::Reset()
{
_pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI );
- _bHeaderOk = FALSE;
+ _bHeaderOk = false;
}
//=========================================================================
@@ -901,7 +896,7 @@ inline void SfxSingleRecordWriter::Reset()
{
_pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI +
SFX_REC_HEADERSIZE_SINGLE );
- _bHeaderOk = FALSE;
+ _bHeaderOk = false;
}
//=========================================================================
@@ -1022,7 +1017,7 @@ inline void SfxMultiFixRecordWriter::Reset()
_pStream->Seek( _nStartPos + SFX_REC_HEADERSIZE_MINI +
SFX_REC_HEADERSIZE_SINGLE +
SFX_REC_HEADERSIZE_MULTI );
- _bHeaderOk = FALSE;
+ _bHeaderOk = false;
}
//=========================================================================
diff --git a/svl/source/filerec/filerec.cxx b/svl/source/filerec/filerec.cxx
index 3d6a08c..ecfbf6f 100644
--- a/svl/source/filerec/filerec.cxx
+++ b/svl/source/filerec/filerec.cxx
@@ -119,26 +119,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;
More information about the Libreoffice-commits
mailing list