diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx index c695bb92788b..4f474ec787c3 100644 --- a/svl/source/items/poolio.cxx +++ b/svl/source/items/poolio.cxx @@ -258,9 +258,13 @@ SvStream &SfxItemPool::Store(SvStream &rStream) const rStream.WriteUInt16( convertSfxItemKindToUInt16(pItem->GetKind()) ); else { - rStream.WriteUInt16( pItem->GetRefCount() ); if( pItem->GetRefCount() > SFX_ITEMS_OLD_MAXREF ) + { + assert(!"refcount does not fit into 16-bits"); rStream.SetError( ERRCODE_IO_NOTSTORABLEINBINARYFORMAT ); + } + else + rStream.WriteUInt16( pItem->GetRefCount() ); } if ( !rStream.GetError() )