summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-05-08 08:29:46 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-05-09 08:47:50 +0200
commite0382c3ad7786910bc9aa81cf581798df0f2508c (patch)
tree6acb0196add99896ced2aa1a76ff5b432bc45401 /cui
parent38a684f72988f29e1c07bf9fa5a83e275e80e24c (diff)
avoid copying when placing items into SfxItemSet
Change-Id: I05c627f590e7794c1ba11b66021dc30aa3285eb0 Reviewed-on: https://gerrit.libreoffice.org/71941 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/options/treeopt.cxx3
-rw-r--r--cui/source/tabpages/border.cxx4
-rw-r--r--cui/source/tabpages/page.cxx2
-rw-r--r--cui/source/tabpages/paragrph.cxx6
4 files changed, 7 insertions, 8 deletions
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index 79ebf3644b14..6b8dac450be5 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1191,8 +1191,7 @@ std::unique_ptr<SfxItemSet> OfaTreeOptionsDialog::CreateItemSet( sal_uInt16 nId
pRet->Put(aHyphen);
if(SfxItemState::DEFAULT <= pDispatch->QueryState(SID_AUTOSPELL_CHECK, pItem))
{
- std::unique_ptr<SfxPoolItem> pClone(pItem->Clone());
- pRet->Put(*pClone);
+ pRet->Put(std::unique_ptr<SfxPoolItem>(pItem->Clone()));
}
else
{
diff --git a/cui/source/tabpages/border.cxx b/cui/source/tabpages/border.cxx
index 208d50f0cf55..a0449ef7379c 100644
--- a/cui/source/tabpages/border.cxx
+++ b/cui/source/tabpages/border.cxx
@@ -900,7 +900,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
{
std::unique_ptr<SfxBoolItem> xNewItem(static_cast<SfxBoolItem*>(rCoreAttrs->Get(nMergeAdjacentBordersId).Clone()));
xNewItem->SetValue(static_cast<bool>(nState));
- rCoreAttrs->Put(*xNewItem);
+ rCoreAttrs->Put(std::move(xNewItem));
}
bAttrsChanged = true;
}
@@ -915,7 +915,7 @@ bool SvxBorderTabPage::FillItemSet( SfxItemSet* rCoreAttrs )
{
std::unique_ptr<SfxBoolItem> xNewItem(static_cast<SfxBoolItem*>(rCoreAttrs->Get(nMergeWithNextId).Clone()));
xNewItem->SetValue(static_cast<bool>(nState));
- rCoreAttrs->Put(*xNewItem);
+ rCoreAttrs->Put(std::move(xNewItem));
}
bAttrsChanged = true;
}
diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx
index e3c3b704efd9..a5e7269c224c 100644
--- a/cui/source/tabpages/page.cxx
+++ b/cui/source/tabpages/page.cxx
@@ -765,7 +765,7 @@ bool SvxPageDescPage::FillItemSet( SfxItemSet* rSet )
std::unique_ptr<SfxBoolItem> pRegItem(static_cast<SfxBoolItem*>(rRegItem.Clone()));
bool bCheck = m_xRegisterCB->get_active();
pRegItem->SetValue(bCheck);
- rSet->Put(*pRegItem);
+ rSet->Put(std::move(pRegItem));
bModified = true;
if(bCheck)
{
diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx
index 6c8cf7293f26..9c9bca1963c8 100644
--- a/cui/source/tabpages/paragrph.cxx
+++ b/cui/source/tabpages/paragrph.cxx
@@ -2238,7 +2238,7 @@ bool SvxAsianTabPage::FillItemSet( SfxItemSet* rSet )
std::unique_ptr<SfxBoolItem> pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
pPool->GetWhich(SID_ATTR_PARA_SCRIPTSPACE)).Clone()));
pNewItem->SetValue(m_xScriptSpaceCB->get_active());
- rSet->Put(*pNewItem);
+ rSet->Put(std::move(pNewItem));
bRet = true;
}
if (m_xHangingPunctCB->get_sensitive() && m_xHangingPunctCB->get_state_changed_from_saved())
@@ -2246,7 +2246,7 @@ bool SvxAsianTabPage::FillItemSet( SfxItemSet* rSet )
std::unique_ptr<SfxBoolItem> pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
pPool->GetWhich(SID_ATTR_PARA_HANGPUNCTUATION)).Clone()));
pNewItem->SetValue(m_xHangingPunctCB->get_active());
- rSet->Put(*pNewItem);
+ rSet->Put(std::move(pNewItem));
bRet = true;
}
if (m_xForbiddenRulesCB->get_sensitive() && m_xForbiddenRulesCB->get_state_changed_from_saved())
@@ -2254,7 +2254,7 @@ bool SvxAsianTabPage::FillItemSet( SfxItemSet* rSet )
std::unique_ptr<SfxBoolItem> pNewItem(static_cast<SfxBoolItem*>(rSet->Get(
pPool->GetWhich(SID_ATTR_PARA_FORBIDDEN_RULES)).Clone()));
pNewItem->SetValue(m_xForbiddenRulesCB->get_active());
- rSet->Put(*pNewItem);
+ rSet->Put(std::move(pNewItem));
bRet = true;
}
return bRet;