summaryrefslogtreecommitdiff
path: root/editeng
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 /editeng
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 'editeng')
-rw-r--r--editeng/source/editeng/editdoc.cxx9
-rw-r--r--editeng/source/editeng/editview.cxx9
-rw-r--r--editeng/source/outliner/outlvw.cxx4
-rw-r--r--editeng/source/uno/unoipset.cxx3
4 files changed, 14 insertions, 11 deletions
diff --git a/editeng/source/editeng/editdoc.cxx b/editeng/source/editeng/editdoc.cxx
index c7b202733b74..78fa1f03b063 100644
--- a/editeng/source/editeng/editdoc.cxx
+++ b/editeng/source/editeng/editdoc.cxx
@@ -949,14 +949,15 @@ void ConvertAndPutItems( SfxItemSet& rDest, const SfxItemSet& rSource, const Map
if ( eSourceUnit != eDestUnit )
{
SfxPoolItem* pItem = rSource.Get( nSourceWhich ).Clone();
-// pItem->SetWhich( nWhich );
ConvertItem( *pItem, eSourceUnit, eDestUnit );
- rDest.Put( *pItem, nWhich );
+ pItem->SetWhich(nWhich);
+ rDest.Put( *pItem );
delete pItem;
}
else
{
- rDest.Put( rSource.Get( nSourceWhich ), nWhich );
+ std::unique_ptr<SfxPoolItem> pNewItem(rSource.Get( nSourceWhich ).CloneSetWhich(nWhich));
+ rDest.Put( *pNewItem );
}
}
}
@@ -2322,7 +2323,7 @@ EditPaM EditDoc::InsertParaBreak( EditPaM aPaM, bool bKeepEndingAttribs )
ContentAttribs aContentAttribs( aPaM.GetNode()->GetContentAttribs() );
// for a new paragraph we like to have the bullet/numbering visible by default
- aContentAttribs.GetItems().Put( SfxBoolItem( EE_PARA_BULLETSTATE, true), EE_PARA_BULLETSTATE );
+ aContentAttribs.GetItems().Put( SfxBoolItem( EE_PARA_BULLETSTATE, true) );
// ContentNode constructor copies also the paragraph attributes
ContentNode* pNode = new ContentNode( aStr, aContentAttribs );
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 3c0852ea8168..e9a36bf7144a 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -1121,9 +1121,9 @@ static void ChangeFontSizeImpl( EditView* pEditView, bool bGrow, const ESelectio
if( EditView::ChangeFontSize( bGrow, aSet, pFontList ) )
{
SfxItemSet aNewSet( pEditView->GetEmptyItemSet() );
- aNewSet.Put( aSet.Get( EE_CHAR_FONTHEIGHT ), EE_CHAR_FONTHEIGHT );
- aNewSet.Put( aSet.Get( EE_CHAR_FONTHEIGHT_CJK ), EE_CHAR_FONTHEIGHT_CJK );
- aNewSet.Put( aSet.Get( EE_CHAR_FONTHEIGHT_CTL ), EE_CHAR_FONTHEIGHT_CTL );
+ aNewSet.Put( aSet.Get( EE_CHAR_FONTHEIGHT ) );
+ aNewSet.Put( aSet.Get( EE_CHAR_FONTHEIGHT_CJK ) );
+ aNewSet.Put( aSet.Get( EE_CHAR_FONTHEIGHT_CTL ) );
pEditView->SetAttribs( aNewSet );
}
}
@@ -1258,7 +1258,8 @@ bool EditView::ChangeFontSize( bool bGrow, SfxItemSet& rSet, const FontList* pFo
if( nHeight != (long)aFontHeightItem.GetHeight() )
{
aFontHeightItem.SetHeight( nHeight );
- rSet.Put( aFontHeightItem, *pWhich );
+ std::unique_ptr<SfxPoolItem> pNewItem(aFontHeightItem.CloneSetWhich(*pWhich));
+ rSet.Put( *pNewItem );
bRet = true;
}
}
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index 5f5a8d1b3df3..a64d85bc74e2 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -881,7 +881,7 @@ void OutlinerView::ToggleBullets()
{
SfxItemSet aAttrs( pOwner->GetParaAttribs( nPara ) );
SvxNumRule aNewNumRule( *pDefaultBulletNumRule );
- aAttrs.Put( SvxNumBulletItem( aNewNumRule ), EE_PARA_NUMBULLET );
+ aAttrs.Put( SvxNumBulletItem( aNewNumRule, EE_PARA_NUMBULLET ) );
pOwner->SetParaAttribs( nPara, aAttrs );
}
}
@@ -1089,7 +1089,7 @@ void OutlinerView::ApplyBulletsNumbering(
}
}
- aAttrs.Put(SvxNumBulletItem(aNewRule), EE_PARA_NUMBULLET);
+ aAttrs.Put(SvxNumBulletItem(aNewRule, EE_PARA_NUMBULLET));
}
}
pOwner->SetParaAttribs(nPara, aAttrs);
diff --git a/editeng/source/uno/unoipset.cxx b/editeng/source/uno/unoipset.cxx
index dc3f77477a42..40677da3d197 100644
--- a/editeng/source/uno/unoipset.cxx
+++ b/editeng/source/uno/unoipset.cxx
@@ -181,7 +181,8 @@ void SvxItemPropertySet::setPropertyValue( const SfxItemPropertySimpleEntry* pMa
if( pNewItem->PutValue( aValue, nMemberId ) )
{
// Set new item in item set
- rSet.Put( *pNewItem, pMap->nWID );
+ pNewItem->SetWhich( pMap->nWID );
+ rSet.Put( *pNewItem );
}
delete pNewItem;
}