summaryrefslogtreecommitdiff
path: root/svl
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-11-01 15:28:13 +0200
committerMichael Stahl <mstahl@redhat.com>2016-11-01 21:36:08 +0000
commit241dca2d8a667da08abbe234ab54ca83b802c768 (patch)
tree69bce2e9fd8c2d6ae45afcc95fa539825a21a213 /svl
parent943e82d8a42859d62619c4203e9bb1d960818be4 (diff)
add an assert to check for ref-counts > 16 bits
after commit 87c518593de59dbf4c0f5f45c720b14a05aeca9e sc: remove antique reference counting hacks from ScDocumentPool In theory, nothing should be trying to save items like this anymore, but lets make the error more obvious in case something is. Change-Id: I89b3637168c072d20e214a8f6338f6336d44d891 Reviewed-on: https://gerrit.libreoffice.org/30467 Reviewed-by: Michael Stahl <mstahl@redhat.com> Tested-by: Michael Stahl <mstahl@redhat.com>
Diffstat (limited to 'svl')
-rw-r--r--svl/source/items/poolio.cxx6
1 files changed, 5 insertions, 1 deletions
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() )