summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-07-24 16:22:29 +0200
committerNoel Grandin <noel@peralex.com>2015-07-27 08:18:16 +0200
commit38ecca9b30e0fc5f7cc6264857f983e40dd58195 (patch)
tree3ad61e6d5cddcf161d27cfe4c6ca85fcf1cab8f6 /svl
parentefac5fa06e2d00bd67c582d8a6b1f1fc69c9b9f5 (diff)
inline a bunch of use-once macros
no point in having a macro unless it's actually going to reduce the number of lines of code Change-Id: Ic8760d6506cf272d7bd088f7b3b4dcbf288099fc
Diffstat (limited to 'svl')
-rw-r--r--svl/source/inc/poolio.hxx26
-rw-r--r--svl/source/items/poolio.cxx25
2 files changed, 22 insertions, 29 deletions
diff --git a/svl/source/inc/poolio.hxx b/svl/source/inc/poolio.hxx
index 8575a2e21b2d..ca51c49ee605 100644
--- a/svl/source/inc/poolio.hxx
+++ b/svl/source/inc/poolio.hxx
@@ -168,32 +168,6 @@ struct SfxItemPool_Impl
};
-#define CHECK_FILEFORMAT( rStream, nTag ) \
- { sal_uInt16 nFileTag; \
- rStream.ReadUInt16( nFileTag ); \
- if ( nTag != nFileTag ) \
- { \
- OSL_FAIL( #nTag ); /*! s.u. */ \
- /*! Set error code and evaluate! */ \
- (rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \
- pImp->bStreaming = false; \
- return rStream; \
- } \
- }
-
-#define CHECK_FILEFORMAT2( rStream, nTag1, nTag2 ) \
- { sal_uInt16 nFileTag; \
- rStream.ReadUInt16( nFileTag ); \
- if ( nTag1 != nFileTag && nTag2 != nFileTag ) \
- { \
- OSL_FAIL( #nTag1 ); /*! s.u. */ \
- /*! Set error code and evaluate! */ \
- (rStream).SetError(SVSTREAM_FILEFORMAT_ERROR); \
- pImp->bStreaming = false; \
- return rStream; \
- } \
- }
-
#define SFX_ITEMPOOL_VER_MAJOR sal_uInt8(2)
#define SFX_ITEMPOOL_VER_MINOR sal_uInt8(0)
diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index 1e0a20ea59ba..1d2e30f1657c 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -501,8 +501,17 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
if ( !pLoadMaster )
{
// Load format version
- CHECK_FILEFORMAT2( rStream,
- SFX_ITEMPOOL_TAG_STARTPOOL_5, SFX_ITEMPOOL_TAG_STARTPOOL_4 );
+ sal_uInt16 nFileTag;
+ rStream.ReadUInt16( nFileTag );
+ if ( SFX_ITEMPOOL_TAG_STARTPOOL_5 != nFileTag && SFX_ITEMPOOL_TAG_STARTPOOL_4 != nFileTag )
+ {
+ OSL_FAIL( "SFX_ITEMPOOL_TAG_STARTPOOL_5" ); /*! s.u. */
+ /*! Set error code and evaluate! */
+ (rStream).SetError(SVSTREAM_FILEFORMAT_ERROR);
+ pImp->bStreaming = false;
+ return rStream;
+ }
+
rStream.ReadUChar( pImp->nMajorVer ).ReadUChar( pImp->nMinorVer );
// Take over format version to MasterPool
@@ -518,7 +527,17 @@ SvStream &SfxItemPool::Load(SvStream &rStream)
}
// Trick for version 1.2: skip data
- CHECK_FILEFORMAT( rStream, SFX_ITEMPOOL_TAG_TRICK4OLD );
+ sal_uInt16 nFileTag2;
+ rStream.ReadUInt16( nFileTag2 );
+ if ( SFX_ITEMPOOL_TAG_TRICK4OLD != nFileTag2 )
+ {
+ OSL_FAIL( "SFX_ITEMPOOL_TAG_TRICK4OLD" ); /*! s.u. */
+ /*! Set error code and evaluate! */
+ (rStream).SetError(SVSTREAM_FILEFORMAT_ERROR);
+ pImp->bStreaming = false;
+ return rStream;
+ }
+
rStream.SeekRel( 4 ); // Hack: Skip data due to SfxStyleSheetPool bug
}