summaryrefslogtreecommitdiff
path: root/sc
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
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')
-rw-r--r--sc/source/core/data/stlpool.cxx12
-rw-r--r--sc/source/core/data/stlsheet.cxx8
-rw-r--r--sc/source/core/tool/autoform.cxx24
-rw-r--r--sc/source/filter/excel/xlroot.cxx9
-rw-r--r--sc/source/filter/ftools/ftools.cxx5
-rw-r--r--sc/source/filter/rtf/eeimpars.cxx28
-rw-r--r--sc/source/filter/starcalc/scflt.cxx16
-rw-r--r--sc/source/ui/Accessibility/AccessibleText.cxx9
-rw-r--r--sc/source/ui/app/inputwin.cxx35
-rw-r--r--sc/source/ui/dbgui/csvgrid.cxx21
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx4
-rw-r--r--sc/source/ui/pagedlg/tphfedit.cxx9
-rw-r--r--sc/source/ui/unoobj/textuno.cxx9
-rw-r--r--sc/source/ui/view/formatsh.cxx3
-rw-r--r--sc/source/ui/view/printfun.cxx9
-rw-r--r--sc/source/ui/view/viewutil.cxx5
16 files changed, 140 insertions, 66 deletions
diff --git a/sc/source/core/data/stlpool.cxx b/sc/source/core/data/stlpool.cxx
index c9acb13effe8..ec06c0887308 100644
--- a/sc/source/core/data/stlpool.cxx
+++ b/sc/source/core/data/stlpool.cxx
@@ -329,8 +329,10 @@ void ScStyleSheetPool::CreateStandardStyles()
// distance to header/footer for the sheet
pHFSetItem = new SvxSetItem( static_cast<const SvxSetItem&>(pSet->Get( ATTR_PAGE_HEADERSET ) ) );
- pSet->Put( *pHFSetItem, ATTR_PAGE_HEADERSET );
- pSet->Put( *pHFSetItem, ATTR_PAGE_FOOTERSET );
+ pHFSetItem->SetWhich(ATTR_PAGE_HEADERSET);
+ pSet->Put( *pHFSetItem );
+ pHFSetItem->SetWhich(ATTR_PAGE_FOOTERSET);
+ pSet->Put( *pHFSetItem );
delete pHFSetItem;
// Header:
@@ -387,8 +389,10 @@ void ScStyleSheetPool::CreateStandardStyles()
pHFSet->Put( SvxBrushItem( aColGrey, ATTR_BACKGROUND ) );
pHFSet->Put( aBoxItem );
pHFSet->Put( aBoxInfoItem );
- pSet->Put( *pHFSetItem, ATTR_PAGE_HEADERSET );
- pSet->Put( *pHFSetItem, ATTR_PAGE_FOOTERSET );
+ pHFSetItem->SetWhich(ATTR_PAGE_HEADERSET);
+ pSet->Put( *pHFSetItem );
+ pHFSetItem->SetWhich(ATTR_PAGE_FOOTERSET);
+ pSet->Put( *pHFSetItem );
delete pHFSetItem;
// Footer:
diff --git a/sc/source/core/data/stlsheet.cxx b/sc/source/core/data/stlsheet.cxx
index 77078ead7652..30f302df011b 100644
--- a/sc/source/core/data/stlsheet.cxx
+++ b/sc/source/core/data/stlsheet.cxx
@@ -192,8 +192,10 @@ SfxItemSet& ScStyleSheet::GetItemSet()
rHFSet.Put( aHFDistItem );
rHFSet.Put( SvxLRSpaceItem( 0,0,0,0, ATTR_LRSPACE ) ); // Set border to Null
- pSet->Put( aHFSetItem, ATTR_PAGE_HEADERSET );
- pSet->Put( aHFSetItem, ATTR_PAGE_FOOTERSET );
+ aHFSetItem.SetWhich(ATTR_PAGE_HEADERSET);
+ pSet->Put( aHFSetItem );
+ aHFSetItem.SetWhich(ATTR_PAGE_FOOTERSET);
+ pSet->Put( aHFSetItem );
pSet->Put( aBoxInfoItem ); // Do not overwrite PoolDefault
// due to format templates
@@ -204,7 +206,7 @@ SfxItemSet& ScStyleSheet::GetItemSet()
// The page default depends on the system language.
SvxFrameDirection eDirection = ScGlobal::IsSystemRTL() ?
FRMDIR_HORI_RIGHT_TOP : FRMDIR_HORI_LEFT_TOP;
- pSet->Put( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ), ATTR_WRITINGDIR );
+ pSet->Put( SvxFrameDirectionItem( eDirection, ATTR_WRITINGDIR ) );
rItemPool.SetPoolDefaultItem( aPageItem );
rItemPool.SetPoolDefaultItem( aPaperSizeItem );
diff --git a/sc/source/core/tool/autoform.cxx b/sc/source/core/tool/autoform.cxx
index 69dfd23b3309..5f03d87da5b5 100644
--- a/sc/source/core/tool/autoform.cxx
+++ b/sc/source/core/tool/autoform.cxx
@@ -657,9 +657,15 @@ void ScAutoFormatData::FillToItemSet( sal_uInt16 nIndex, SfxItemSet& rItemSet, S
}
else
{
- rItemSet.Put( rField.GetHeight(), ATTR_CJK_FONT_HEIGHT );
- rItemSet.Put( rField.GetWeight(), ATTR_CJK_FONT_WEIGHT );
- rItemSet.Put( rField.GetPosture(), ATTR_CJK_FONT_POSTURE );
+ SvxFontHeightItem aFontHeightItem(rField.GetHeight());
+ aFontHeightItem.SetWhich(ATTR_CJK_FONT_HEIGHT);
+ rItemSet.Put( aFontHeightItem );
+ SvxWeightItem aWeightItem(rField.GetWeight());
+ aWeightItem.SetWhich(ATTR_CJK_FONT_WEIGHT);
+ rItemSet.Put( aWeightItem );
+ SvxPostureItem aPostureItem(rField.GetPosture());
+ aPostureItem.SetWhich(ATTR_CJK_FONT_POSTURE);
+ rItemSet.Put( aPostureItem );
}
// do not insert empty CTL font
const SvxFontItem& rCTLFont = rField.GetCTLFont();
@@ -672,9 +678,15 @@ void ScAutoFormatData::FillToItemSet( sal_uInt16 nIndex, SfxItemSet& rItemSet, S
}
else
{
- rItemSet.Put( rField.GetHeight(), ATTR_CTL_FONT_HEIGHT );
- rItemSet.Put( rField.GetWeight(), ATTR_CTL_FONT_WEIGHT );
- rItemSet.Put( rField.GetPosture(), ATTR_CTL_FONT_POSTURE );
+ SvxFontHeightItem aFontHeightItem(rField.GetHeight());
+ aFontHeightItem.SetWhich(ATTR_CTL_FONT_HEIGHT);
+ rItemSet.Put( aFontHeightItem );
+ SvxWeightItem aWeightItem(rField.GetWeight());
+ aWeightItem.SetWhich(ATTR_CTL_FONT_WEIGHT);
+ rItemSet.Put( aWeightItem );
+ SvxPostureItem aPostureItem(rField.GetPosture());
+ aPostureItem.SetWhich(ATTR_CTL_FONT_POSTURE);
+ rItemSet.Put( aPostureItem );
}
rItemSet.Put( rField.GetUnderline() );
rItemSet.Put( rField.GetOverline() );
diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx
index 46d9d28c2ad8..80a9a63f033c 100644
--- a/sc/source/filter/excel/xlroot.cxx
+++ b/sc/source/filter/excel/xlroot.cxx
@@ -369,9 +369,12 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const
SfxItemSet aItemSet( *GetDoc().GetPool(), ATTR_PATTERN_START, ATTR_PATTERN_END );
ScPatternAttr::FillToEditItemSet( *pEditSet, aItemSet );
// FillToEditItemSet() adjusts font height to 1/100th mm, we need twips
- pEditSet->Put( aItemSet.Get( ATTR_FONT_HEIGHT ), EE_CHAR_FONTHEIGHT );
- pEditSet->Put( aItemSet.Get( ATTR_CJK_FONT_HEIGHT ), EE_CHAR_FONTHEIGHT_CJK );
- pEditSet->Put( aItemSet.Get( ATTR_CTL_FONT_HEIGHT ), EE_CHAR_FONTHEIGHT_CTL );
+ std::unique_ptr<SfxPoolItem> pNewItem( aItemSet.Get( ATTR_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT));
+ pEditSet->Put( *pNewItem );
+ pNewItem.reset( aItemSet.Get( ATTR_CJK_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK));
+ pEditSet->Put( *pNewItem );
+ pNewItem.reset( aItemSet.Get( ATTR_CTL_FONT_HEIGHT ).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL));
+ pEditSet->Put( *pNewItem );
rEE.SetDefaults( pEditSet ); // takes ownership
}
return *mrData.mxHFEditEngine;
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 )
diff --git a/sc/source/filter/rtf/eeimpars.cxx b/sc/source/filter/rtf/eeimpars.cxx
index 77e0c9bc0d2d..da9bb2f23753 100644
--- a/sc/source/filter/rtf/eeimpars.cxx
+++ b/sc/source/filter/rtf/eeimpars.cxx
@@ -267,17 +267,29 @@ void ScEEImport::WriteToDocument( bool bSizeColsRows, double nOutputFactor, SvNu
if ( nScriptType & nScript )
{
if ( pFont )
- rSet.Put( *pFont, ScGlobal::GetScriptedWhichID(
- nScript, ATTR_FONT ));
+ {
+ std::unique_ptr<SfxPoolItem> pNewItem(pFont->CloneSetWhich(
+ ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT )));
+ rSet.Put( *pNewItem );
+ }
if ( pHeight )
- rSet.Put( *pHeight, ScGlobal::GetScriptedWhichID(
- nScript, ATTR_FONT_HEIGHT ));
+ {
+ std::unique_ptr<SfxPoolItem> pNewItem(pHeight->CloneSetWhich(
+ ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT_HEIGHT )));
+ rSet.Put( *pNewItem );
+ }
if ( pWeight )
- rSet.Put( *pWeight, ScGlobal::GetScriptedWhichID(
- nScript, ATTR_FONT_WEIGHT ));
+ {
+ std::unique_ptr<SfxPoolItem> pNewItem(pWeight->CloneSetWhich(
+ ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT_WEIGHT )));
+ rSet.Put( *pNewItem );
+ }
if ( pPosture )
- rSet.Put( *pPosture, ScGlobal::GetScriptedWhichID(
- nScript, ATTR_FONT_POSTURE ));
+ {
+ std::unique_ptr<SfxPoolItem> pNewItem(pPosture->CloneSetWhich(
+ ScGlobal::GetScriptedWhichID(nScript, ATTR_FONT_POSTURE )));
+ rSet.Put( *pNewItem );
+ }
}
}
}
diff --git a/sc/source/filter/starcalc/scflt.cxx b/sc/source/filter/starcalc/scflt.cxx
index bfac4b03da1f..0d7f37c0028a 100644
--- a/sc/source/filter/starcalc/scflt.cxx
+++ b/sc/source/filter/starcalc/scflt.cxx
@@ -715,23 +715,21 @@ void Sc10PageCollection::PutToDoc( ScDocument* pDoc )
aEditAttribs.Put( SvxFontItem(
eFam,
SC10TOSTRING( pHeadFootLine->LogFont.lfFaceName ), EMPTY_OUSTRING,
- PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ),
- EE_CHAR_FONTINFO );
- aEditAttribs.Put( SvxFontHeightItem( std::abs( pHeadFootLine->LogFont.lfHeight ), 100, EE_CHAR_FONTHEIGHT ),
- EE_CHAR_FONTHEIGHT);
+ PITCH_DONTKNOW, RTL_TEXTENCODING_DONTKNOW, EE_CHAR_FONTINFO ) );
+ aEditAttribs.Put( SvxFontHeightItem( std::abs( pHeadFootLine->LogFont.lfHeight ), 100, EE_CHAR_FONTHEIGHT ) );
Sc10Color nColor = pHeadFootLine->TextColor;
Color TextColor( nColor.Red, nColor.Green, nColor.Blue );
- aEditAttribs.Put(SvxColorItem(TextColor, EE_CHAR_COLOR), EE_CHAR_COLOR);
+ aEditAttribs.Put(SvxColorItem(TextColor, EE_CHAR_COLOR));
// FontAttr
if (pHeadFootLine->LogFont.lfWeight != fwNormal)
- aEditAttribs.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT), EE_CHAR_WEIGHT);
+ aEditAttribs.Put(SvxWeightItem(WEIGHT_BOLD, EE_CHAR_WEIGHT));
if (pHeadFootLine->LogFont.lfItalic != 0)
- aEditAttribs.Put(SvxPostureItem(ITALIC_NORMAL, EE_CHAR_ITALIC), EE_CHAR_ITALIC);
+ aEditAttribs.Put(SvxPostureItem(ITALIC_NORMAL, EE_CHAR_ITALIC));
if (pHeadFootLine->LogFont.lfUnderline != 0)
- aEditAttribs.Put(SvxUnderlineItem(LINESTYLE_SINGLE, EE_CHAR_UNDERLINE), EE_CHAR_UNDERLINE);
+ aEditAttribs.Put(SvxUnderlineItem(LINESTYLE_SINGLE, EE_CHAR_UNDERLINE));
if (pHeadFootLine->LogFont.lfStrikeOut != 0)
- aEditAttribs.Put(SvxCrossedOutItem(STRIKEOUT_SINGLE, EE_CHAR_STRIKEOUT), EE_CHAR_STRIKEOUT);
+ aEditAttribs.Put(SvxCrossedOutItem(STRIKEOUT_SINGLE, EE_CHAR_STRIKEOUT));
OUString aText( pHeadFootLine->Title, strlen(pHeadFootLine->Title), DEFCHARSET );
aEditEngine.SetText( aText );
aEditEngine.QuickSetAttribs( aEditAttribs, ESelection( 0, 0, 0, aText.getLength() ) );
diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx
index 17eb94d2ca80..5c4e0c1a82d1 100644
--- a/sc/source/ui/Accessibility/AccessibleText.cxx
+++ b/sc/source/ui/Accessibility/AccessibleText.cxx
@@ -1427,9 +1427,12 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder()
rPattern.FillEditItemSet( &aDefaults );
// FillEditItemSet adjusts font height to 1/100th mm,
// but for header/footer twips is needed, as in the PatternAttr:
- aDefaults.Put( rPattern.GetItem(ATTR_FONT_HEIGHT), EE_CHAR_FONTHEIGHT );
- aDefaults.Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CJK );
- aDefaults.Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CTL );
+ std::unique_ptr<SfxPoolItem> pNewItem(rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT));
+ aDefaults.Put( *pNewItem );
+ pNewItem.reset(rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK));
+ aDefaults.Put( *pNewItem );
+ pNewItem.reset(rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL));
+ aDefaults.Put( *pNewItem );
aDefaults.Put( SvxAdjustItem( meAdjust, EE_PARA_JUST ) );
pHdrEngine->SetDefaults( aDefaults );
diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx
index 86cf7061fdd5..882dfdd367ae 100644
--- a/sc/source/ui/app/inputwin.cxx
+++ b/sc/source/ui/app/inputwin.cxx
@@ -1237,20 +1237,35 @@ void ScTextWnd::StartEditEngine()
static void lcl_ExtendEditFontAttribs( SfxItemSet& rSet )
{
const SfxPoolItem& rFontItem = rSet.Get( EE_CHAR_FONTINFO );
- rSet.Put( rFontItem, EE_CHAR_FONTINFO_CJK );
- rSet.Put( rFontItem, EE_CHAR_FONTINFO_CTL );
+ std::unique_ptr<SfxPoolItem> pNewItem(rFontItem.Clone());
+ pNewItem->SetWhich(EE_CHAR_FONTINFO_CJK);
+ rSet.Put( *pNewItem );
+ pNewItem->SetWhich(EE_CHAR_FONTINFO_CTL);
+ rSet.Put( *pNewItem );
const SfxPoolItem& rHeightItem = rSet.Get( EE_CHAR_FONTHEIGHT );
- rSet.Put( rHeightItem, EE_CHAR_FONTHEIGHT_CJK );
- rSet.Put( rHeightItem, EE_CHAR_FONTHEIGHT_CTL );
+ pNewItem.reset(rHeightItem.Clone());
+ pNewItem->SetWhich(EE_CHAR_FONTHEIGHT_CJK);
+ rSet.Put( *pNewItem );
+ pNewItem->SetWhich(EE_CHAR_FONTHEIGHT_CTL);
+ rSet.Put( *pNewItem );
const SfxPoolItem& rWeightItem = rSet.Get( EE_CHAR_WEIGHT );
- rSet.Put( rWeightItem, EE_CHAR_WEIGHT_CJK );
- rSet.Put( rWeightItem, EE_CHAR_WEIGHT_CTL );
+ pNewItem.reset(rWeightItem.Clone());
+ pNewItem->SetWhich(EE_CHAR_WEIGHT_CJK);
+ rSet.Put( *pNewItem );
+ pNewItem->SetWhich(EE_CHAR_WEIGHT_CTL);
+ rSet.Put( *pNewItem );
const SfxPoolItem& rItalicItem = rSet.Get( EE_CHAR_ITALIC );
- rSet.Put( rItalicItem, EE_CHAR_ITALIC_CJK );
- rSet.Put( rItalicItem, EE_CHAR_ITALIC_CTL );
+ pNewItem.reset(rItalicItem.Clone());
+ pNewItem->SetWhich(EE_CHAR_ITALIC_CJK);
+ rSet.Put( *pNewItem );
+ pNewItem->SetWhich(EE_CHAR_ITALIC_CTL);
+ rSet.Put( *pNewItem );
const SfxPoolItem& rLangItem = rSet.Get( EE_CHAR_LANGUAGE );
- rSet.Put( rLangItem, EE_CHAR_LANGUAGE_CJK );
- rSet.Put( rLangItem, EE_CHAR_LANGUAGE_CTL );
+ pNewItem.reset(rLangItem.Clone());
+ pNewItem->SetWhich(EE_CHAR_LANGUAGE_CJK);
+ rSet.Put( *pNewItem );
+ pNewItem->SetWhich(EE_CHAR_LANGUAGE_CTL);
+ rSet.Put( *pNewItem );
}
static void lcl_ModifyRTLDefaults( SfxItemSet& rSet )
diff --git a/sc/source/ui/dbgui/csvgrid.cxx b/sc/source/ui/dbgui/csvgrid.cxx
index 10ac5464cc4e..e2a8ec2b75e8 100644
--- a/sc/source/ui/dbgui/csvgrid.cxx
+++ b/sc/source/ui/dbgui/csvgrid.cxx
@@ -251,14 +251,23 @@ void ScCsvGrid::InitFonts()
// copy other items from default font
const SfxPoolItem& rWeightItem = aDefSet.Get( EE_CHAR_WEIGHT );
- aDefSet.Put( rWeightItem, EE_CHAR_WEIGHT_CJK );
- aDefSet.Put( rWeightItem, EE_CHAR_WEIGHT_CTL );
+ std::unique_ptr<SfxPoolItem> pNewItem(rWeightItem.Clone());
+ pNewItem->SetWhich(EE_CHAR_WEIGHT_CJK);
+ aDefSet.Put( *pNewItem );
+ pNewItem->SetWhich(EE_CHAR_WEIGHT_CTL);
+ aDefSet.Put( *pNewItem );
const SfxPoolItem& rItalicItem = aDefSet.Get( EE_CHAR_ITALIC );
- aDefSet.Put( rItalicItem, EE_CHAR_ITALIC_CJK );
- aDefSet.Put( rItalicItem, EE_CHAR_ITALIC_CTL );
+ pNewItem.reset(rItalicItem.Clone());
+ pNewItem->SetWhich(EE_CHAR_ITALIC_CJK);
+ aDefSet.Put( *pNewItem );
+ pNewItem->SetWhich(EE_CHAR_ITALIC_CTL);
+ aDefSet.Put( *pNewItem );
const SfxPoolItem& rLangItem = aDefSet.Get( EE_CHAR_LANGUAGE );
- aDefSet.Put( rLangItem, EE_CHAR_LANGUAGE_CJK );
- aDefSet.Put( rLangItem, EE_CHAR_LANGUAGE_CTL );
+ pNewItem.reset(rLangItem.Clone());
+ pNewItem->SetWhich(EE_CHAR_LANGUAGE_CJK);
+ aDefSet.Put( *pNewItem );
+ pNewItem->SetWhich(EE_CHAR_LANGUAGE_CTL);
+ aDefSet.Put( *pNewItem );
mpEditEngine->SetDefaults( aDefSet );
InvalidateGfx();
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 200d5a9b8a47..35a063941a35 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -334,11 +334,11 @@ void ScDrawShell::ExecuteMacroAssign( SdrObject* pObj, vcl::Window* pWin )
// create empty itemset for macro-dlg
std::unique_ptr<SfxItemSet> pItemSet(new SfxItemSet(SfxGetpApp()->GetPool(), SID_ATTR_MACROITEM, SID_ATTR_MACROITEM, SID_EVENTCONFIG, SID_EVENTCONFIG, 0 ));
- pItemSet->Put ( aItem, SID_ATTR_MACROITEM );
+ pItemSet->Put ( aItem );
SfxEventNamesItem aNamesItem(SID_EVENTCONFIG);
aNamesItem.AddEvent( ScResId(RID_SCSTR_ONCLICK), OUString(), SFX_EVENT_MOUSECLICK_OBJECT );
- pItemSet->Put( aNamesItem, SID_EVENTCONFIG );
+ pItemSet->Put( aNamesItem );
css::uno::Reference < css::frame::XFrame > xFrame;
if (GetViewShell())
diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx
index 8bccbccd13be..f9eaeac73e0f 100644
--- a/sc/source/ui/pagedlg/tphfedit.cxx
+++ b/sc/source/ui/pagedlg/tphfedit.cxx
@@ -160,9 +160,12 @@ void ScEditWindow::SetFont( const ScPatternAttr& rPattern )
rPattern.FillEditItemSet( pSet );
// FillEditItemSet adjusts font height to 1/100th mm,
// but for header/footer twips is needed, as in the PatternAttr:
- pSet->Put( rPattern.GetItem(ATTR_FONT_HEIGHT), EE_CHAR_FONTHEIGHT );
- pSet->Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CJK );
- pSet->Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CTL );
+ std::unique_ptr<SfxPoolItem> pNewItem(rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT));
+ pSet->Put( *pNewItem );
+ pNewItem.reset(rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK));
+ pSet->Put( *pNewItem );
+ pNewItem.reset(rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL));
+ pSet->Put( *pNewItem );
if (mbRTL)
pSet->Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
pEdEngine->SetDefaults( pSet );
diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx
index 3c9cbf318a66..67e2acb578b7 100644
--- a/sc/source/ui/unoobj/textuno.cxx
+++ b/sc/source/ui/unoobj/textuno.cxx
@@ -221,9 +221,12 @@ SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder()
rPattern.FillEditItemSet( &aDefaults );
// FillEditItemSet adjusts font height to 1/100th mm,
// but for header/footer twips is needed, as in the PatternAttr:
- aDefaults.Put( rPattern.GetItem(ATTR_FONT_HEIGHT), EE_CHAR_FONTHEIGHT );
- aDefaults.Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CJK );
- aDefaults.Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CTL );
+ std::unique_ptr<SfxPoolItem> pNewItem( rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT) );
+ aDefaults.Put( *pNewItem );
+ pNewItem.reset( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK) );
+ aDefaults.Put( *pNewItem );
+ pNewItem.reset( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL) );
+ aDefaults.Put( *pNewItem );
pHdrEngine->SetDefaults( aDefaults );
ScHeaderFieldData aData;
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index b7af7e0ec8ae..3fb44d5bebae 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2183,7 +2183,8 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet )
break;
case SID_ATTR_BRUSH:
{
- rSet.Put( rBrushItem, GetPool().GetWhich(nWhich) );
+ std::unique_ptr<SfxPoolItem> pNewItem(rBrushItem.CloneSetWhich(GetPool().GetWhich(nWhich)));
+ rSet.Put( *pNewItem );
}
break;
}
diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx
index 292b9d1de392..a1ec9e6a7ed1 100644
--- a/sc/source/ui/view/printfun.cxx
+++ b/sc/source/ui/view/printfun.cxx
@@ -1701,9 +1701,12 @@ void ScPrintFunc::MakeEditEngine()
rPattern.FillEditItemSet( pEditDefaults );
// FillEditItemSet adjusts font height to 1/100th mm,
// but for header/footer twips is needed, as in the PatternAttr:
- pEditDefaults->Put( rPattern.GetItem(ATTR_FONT_HEIGHT), EE_CHAR_FONTHEIGHT );
- pEditDefaults->Put( rPattern.GetItem(ATTR_CJK_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CJK );
- pEditDefaults->Put( rPattern.GetItem(ATTR_CTL_FONT_HEIGHT), EE_CHAR_FONTHEIGHT_CTL );
+ std::unique_ptr<SfxPoolItem> pNewItem(rPattern.GetItem(ATTR_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT));
+ pEditDefaults->Put( *pNewItem );
+ pNewItem.reset(rPattern.GetItem(ATTR_CJK_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CJK));
+ pEditDefaults->Put( *pNewItem );
+ pNewItem.reset(rPattern.GetItem(ATTR_CTL_FONT_HEIGHT).CloneSetWhich(EE_CHAR_FONTHEIGHT_CTL));
+ pEditDefaults->Put( *pNewItem );
// don't use font color, because background color is not used
//! there's no way to set the background for note pages
pEditDefaults->ClearItem( EE_CHAR_COLOR );
diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx
index 3b289998cf32..958a0424f339 100644
--- a/sc/source/ui/view/viewutil.cxx
+++ b/sc/source/ui/view/viewutil.cxx
@@ -64,7 +64,10 @@ void ScViewUtil::PutItemScript( SfxItemSet& rShellSet, const SfxItemSet& rCoreSe
aSetItem.GetItemSet().PutExtended( rCoreSet, SfxItemState::DONTCARE, SfxItemState::SET );
const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
if (pI)
- rShellSet.Put( *pI, nWhichId );
+ {
+ std::unique_ptr<SfxPoolItem> pNewItem(pI->CloneSetWhich(nWhichId));
+ rShellSet.Put( *pNewItem );
+ }
else
rShellSet.InvalidateItem( nWhichId );
}