summaryrefslogtreecommitdiff
path: root/sc/source/filter/ftools
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2016-04-23 20:23:29 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-27 07:21:45 +0000
commit9eb2e683ab051edd0bce18841f0ac05df5038854 (patch)
tree71e7a4d4b8389c09ff17024fceaed94668751082 /sc/source/filter/ftools
parentfd964e3b9f60bf2043fdc39ab8161a586049b481 (diff)
tdf#34465 remove calls to SfxItemSet::Put(const SfxPoolItem&, sal_uInt16)
and put an assert in SfxPoolItem::SetWhich() so nothing new creeps in. Change-Id: I6497650fa61ffb2b6941ffff2d471c8f117be1df Reviewed-on: https://gerrit.libreoffice.org/24324 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sc/source/filter/ftools')
-rw-r--r--sc/source/filter/ftools/ftools.cxx5
1 files changed, 4 insertions, 1 deletions
diff --git a/sc/source/filter/ftools/ftools.cxx b/sc/source/filter/ftools/ftools.cxx
index e40967b1e143..19616c52b664 100644
--- a/sc/source/filter/ftools/ftools.cxx
+++ b/sc/source/filter/ftools/ftools.cxx
@@ -217,7 +217,10 @@ bool ScfTools::CheckItems( const SfxItemSet& rItemSet, const sal_uInt16* pnWhich
void ScfTools::PutItem( SfxItemSet& rItemSet, const SfxPoolItem& rItem, sal_uInt16 nWhichId, bool bSkipPoolDef )
{
if( !bSkipPoolDef || (rItem != rItemSet.GetPool()->GetDefaultItem( nWhichId )) )
- rItemSet.Put( rItem, nWhichId );
+ {
+ std::unique_ptr<SfxPoolItem> pNewItem(rItem.CloneSetWhich(nWhichId));
+ rItemSet.Put( *pNewItem );
+ }
}
void ScfTools::PutItem( SfxItemSet& rItemSet, const SfxPoolItem& rItem, bool bSkipPoolDef )