From 7a242b463132d67a4a2d6e69319e0da367145cc0 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 1 Dec 2014 19:25:13 +0100 Subject: fdo#85496: add some asserts to detect this sort of problem Change-Id: Iff787c8d2a71bc3082192cc98e3d916badee65dd --- editeng/source/editeng/editobj.cxx | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'editeng') diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx index 11e1b22cb7fc..bf316c71b2fe 100644 --- a/editeng/source/editeng/editobj.cxx +++ b/editeng/source/editeng/editobj.cxx @@ -992,6 +992,11 @@ void EditTextObjectImpl::GetAllSections( std::vector& rAttrs ) for (; itCurAttr != aAttrs.end() && itCurAttr->mnParagraph == nPara && itCurAttr->mnEnd <= nEnd; ++itCurAttr) { editeng::Section& rSecAttr = *itCurAttr; + // serious bug: will cause duplicate attributes to be exported + assert(rSecAttr.maAttributes.end() == std::find_if( + rSecAttr.maAttributes.begin(), rSecAttr.maAttributes.end(), + [&pItem](SfxPoolItem const*const pIt) + { return pIt->Which() == pItem->Which(); })); rSecAttr.maAttributes.push_back(pItem); } } -- cgit