summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-06-02 09:13:02 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-06-02 10:45:44 +0200
commite6de84d46c2a41fc4ae53e2744d432e50c4a4ac1 (patch)
tree6be38c21e699cf240ff4b5eb3dd38e251dda96b5 /cui
parent1577c0dc30ed3c9db361fb989e41a3e9d6c45dfa (diff)
std::move SfxPoolItem into SfxItemSet where possible
found with the help of a temporary loplugin (which i have put into the store/ folder) Change-Id: Ide40d09bef6993ace50039a8fd0439b7e29c09a6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135288 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/align.cxx12
-rw-r--r--cui/source/tabpages/backgrnd.cxx4
-rw-r--r--cui/source/tabpages/grfpage.cxx2
-rw-r--r--cui/source/tabpages/paragrph.cxx6
-rw-r--r--cui/source/tabpages/swpossizetabpage.cxx2
-rw-r--r--cui/source/tabpages/tabstpge.cxx2
-rw-r--r--cui/source/tabpages/tpline.cxx10
7 files changed, 19 insertions, 19 deletions
diff --git a/cui/source/tabpages/align.cxx b/cui/source/tabpages/align.cxx
index 12e93ae65c43..8d2425e7ef68 100644
--- a/cui/source/tabpages/align.cxx
+++ b/cui/source/tabpages/align.cxx
@@ -223,7 +223,7 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
assert(pIndentItem);
std::unique_ptr<SfxUInt16Item> pNewIndentItem(pIndentItem->Clone());
pNewIndentItem->SetValue(m_xEdIndent->get_value(FieldUnit::TWIP));
- rSet->Put(*pNewIndentItem);
+ rSet->Put(std::move(pNewIndentItem));
bChanged = true;
}
else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false))
@@ -266,7 +266,7 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
assert(pAngleItem);
std::unique_ptr<SdrAngleItem> pNewAngleItem(pAngleItem->Clone());
pNewAngleItem->SetValue(m_xCtrlDial->GetRotation());
- rSet->Put(*pNewAngleItem);
+ rSet->Put(std::move(pNewAngleItem));
bChanged = true;
}
else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false))
@@ -303,7 +303,7 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
assert(pStackItem);
std::unique_ptr<SfxBoolItem> pNewStackItem(pStackItem->Clone());
pNewStackItem->SetValue(m_xCbStacked->get_active());
- rSet->Put(*pNewStackItem);
+ rSet->Put(std::move(pNewStackItem));
bChanged = true;
}
else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false))
@@ -326,7 +326,7 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
assert(pWrapItem);
std::unique_ptr<SfxBoolItem> pNewWrapItem(pWrapItem->Clone());
pNewWrapItem->SetValue(m_xBtnWrap->get_active());
- rSet->Put(*pNewWrapItem);
+ rSet->Put(std::move(pNewWrapItem));
bChanged = true;
}
else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false))
@@ -340,7 +340,7 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
assert(pHyphItem);
std::unique_ptr<SfxBoolItem> pNewHyphItem(pHyphItem->Clone());
pNewHyphItem->SetValue(m_xBtnHyphen->get_active());
- rSet->Put(*pNewHyphItem);
+ rSet->Put(std::move(pNewHyphItem));
bChanged = true;
}
else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false))
@@ -354,7 +354,7 @@ bool AlignmentTabPage::FillItemSet( SfxItemSet* rSet )
assert(pShrinkItem);
std::unique_ptr<SfxBoolItem> pNewShrinkItem(pShrinkItem->Clone());
pNewShrinkItem->SetValue(m_xBtnShrink->get_active());
- rSet->Put(*pNewShrinkItem);
+ rSet->Put(std::move(pNewShrinkItem));
bChanged = true;
}
else if (SfxItemState::DEFAULT == rOldSet.GetItemState(nWhich, false))
diff --git a/cui/source/tabpages/backgrnd.cxx b/cui/source/tabpages/backgrnd.cxx
index f1c0765fa70e..14269ad3c6c8 100644
--- a/cui/source/tabpages/backgrnd.cxx
+++ b/cui/source/tabpages/backgrnd.cxx
@@ -180,7 +180,7 @@ bool SvxBkgTabPage::FillItemSet( SfxItemSet* rCoreSet )
{
std::unique_ptr<SvxBrushItem> aBrushItem( getSvxBrushItemFromSourceSet( maSet, nWhich ) );
if ( GraphicType::NONE != aBrushItem->GetGraphicObject()->GetType() )
- rCoreSet->Put( *aBrushItem );
+ rCoreSet->Put( std::move(aBrushItem) );
break;
}
default:
@@ -281,7 +281,7 @@ IMPL_LINK(SvxBkgTabPage, TblDestinationHdl_Impl, weld::ComboBox&, rBox, void)
// fill local item set with XATTR_FILL settings gathered from tab page
// and convert to SvxBrushItem and store in table destination slot Which
SvxAreaTabPage::FillItemSet(&maSet);
- maSet.Put(*getSvxBrushItemFromSourceSet(maSet, maSet.GetPool()->GetWhich(lcl_GetTableDestSlot(m_nActPos))));
+ maSet.Put(getSvxBrushItemFromSourceSet(maSet, maSet.GetPool()->GetWhich(lcl_GetTableDestSlot(m_nActPos))));
}
sal_Int32 nSelPos = rBox.get_active();
diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx
index d5c7fca425c0..1bbc73c3add3 100644
--- a/cui/source/tabpages/grfpage.cxx
+++ b/cui/source/tabpages/grfpage.cxx
@@ -270,7 +270,7 @@ bool SvxGrfCropPage::FillItemSet(SfxItemSet *rSet)
pNew->SetRight( lcl_GetValue( *m_xRightMF, eUnit ) );
pNew->SetTop( lcl_GetValue( *m_xTopMF, eUnit ) );
pNew->SetBottom( lcl_GetValue( *m_xBottomMF, eUnit ) );
- bModified |= nullptr != rSet->Put( *pNew );
+ bModified |= nullptr != rSet->Put( std::move(pNew) );
}
if( m_xZoomConstRB->get_state_changed_from_saved() )
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 3fa77d9fb791..4b9aaff94f85 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -384,14 +384,14 @@ bool SvxStdParagraphTabPage::FillItemSet( SfxItemSet* rOutSet )
*rOutSet, SID_ATTR_PARA_REGISTER));
if (!pBoolItem)
return bModified;
- std::unique_ptr<SfxBoolItem> pRegItem(pBoolItem->Clone());
sal_uInt16 _nWhich = GetWhich( SID_ATTR_PARA_REGISTER );
- bool bSet = pRegItem->GetValue();
+ bool bSet = pBoolItem->GetValue();
if (m_xRegisterCB->get_active() != bSet)
{
+ std::unique_ptr<SfxBoolItem> pRegItem(pBoolItem->Clone());
pRegItem->SetValue(!bSet);
- rOutSet->Put(*pRegItem);
+ rOutSet->Put(std::move(pRegItem));
bModified = true;
}
else if ( SfxItemState::DEFAULT == GetItemSet().GetItemState( _nWhich, false ) )
diff --git a/cui/source/tabpages/swpossizetabpage.cxx b/cui/source/tabpages/swpossizetabpage.cxx
index 5b0e20264282..e8a1e4eb9df4 100644
--- a/cui/source/tabpages/swpossizetabpage.cxx
+++ b/cui/source/tabpages/swpossizetabpage.cxx
@@ -861,7 +861,7 @@ bool SvxSwPosSizeTabPage::FillItemSet( SfxItemSet* rSet)
{
std::unique_ptr<SfxBoolItem> pFollow(static_cast<SfxBoolItem*>(pItem->Clone()));
pFollow->SetValue(m_xFollowCB->get_active());
- bModified |= nullptr != rSet->Put(*pFollow);
+ bModified |= nullptr != rSet->Put(std::move(pFollow));
}
}
}
diff --git a/cui/source/tabpages/tabstpge.cxx b/cui/source/tabpages/tabstpge.cxx
index 96431ba20a5d..5a468f1dfffa 100644
--- a/cui/source/tabpages/tabstpge.cxx
+++ b/cui/source/tabpages/tabstpge.cxx
@@ -190,7 +190,7 @@ bool SvxTabulatorTabPage::FillItemSet(SfxItemSet* rSet)
if (!pOld || *static_cast<const SvxTabStopItem*>(pOld) != *aTmp)
{
- rSet->Put(*aTmp);
+ rSet->Put(std::move(aTmp));
bModified = true;
}
}
diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx
index 60321ae9f3aa..04eaa41b92c9 100644
--- a/cui/source/tabpages/tpline.cxx
+++ b/cui/source/tabpages/tpline.cxx
@@ -413,7 +413,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
pOld = GetOldItem( *rAttrs, XATTR_LINESTYLE );
if ( !pOld || !( *static_cast<const XLineStyleItem*>(pOld) == *pStyleItem ) )
{
- rAttrs->Put( *pStyleItem );
+ rAttrs->Put( std::move(pStyleItem) );
bModified = true;
}
}
@@ -480,7 +480,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
pOld = GetOldItem( *rAttrs, XATTR_LINESTART );
if( pItem && ( !pOld || *pOld != *pItem ) )
{
- rAttrs->Put( *pItem );
+ rAttrs->Put( std::move(pItem) );
bModified = true;
}
}
@@ -497,7 +497,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
if( pItem &&
( !pOld || !( *static_cast<const XLineEndItem*>(pOld) == *pItem ) ) )
{
- rAttrs->Put( *pItem );
+ rAttrs->Put( std::move(pItem) );
bModified = true;
}
}
@@ -575,7 +575,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
if(!pOld || !(*static_cast<const XLineJointItem*>(pOld) == *pNew))
{
- rAttrs->Put( *pNew );
+ rAttrs->Put( std::move(pNew) );
bModified = true;
}
}
@@ -612,7 +612,7 @@ bool SvxLineTabPage::FillItemSet( SfxItemSet* rAttrs )
if(!pOld || !(*static_cast<const XLineCapItem*>(pOld) == *pNew))
{
- rAttrs->Put( *pNew );
+ rAttrs->Put( std::move(pNew) );
bModified = true;
}
}