summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/basflt/fltini.cxx4
-rw-r--r--sw/source/filter/html/htmldrawreader.cxx6
-rw-r--r--sw/source/filter/html/htmldrawwriter.cxx4
-rw-r--r--sw/source/filter/ww8/wrtw8nds.cxx5
-rw-r--r--sw/source/filter/ww8/ww8graf.cxx8
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx2
-rw-r--r--sw/source/filter/xml/xmlitemi.cxx2
7 files changed, 10 insertions, 21 deletions
diff --git a/sw/source/filter/basflt/fltini.cxx b/sw/source/filter/basflt/fltini.cxx
index 3b6ce6e54469..847930fc84a1 100644
--- a/sw/source/filter/basflt/fltini.cxx
+++ b/sw/source/filter/basflt/fltini.cxx
@@ -404,9 +404,9 @@ void CalculateFlySize(SfxItemSet& rFlySet, const SwNodeIndex& rAnchor,
}
else if( MINFLY > static_cast<const SwFormatFrameSize*>(pItem)->GetHeight() )
{
- std::shared_ptr<SwFormatFrameSize> aSz(static_cast<SwFormatFrameSize*>(pItem->Clone()));
+ std::unique_ptr<SwFormatFrameSize> aSz(static_cast<SwFormatFrameSize*>(pItem->Clone()));
aSz->SetHeight( MINFLY );
- rFlySet.Put( *aSz );
+ rFlySet.Put( std::move(aSz) );
}
}
diff --git a/sw/source/filter/html/htmldrawreader.cxx b/sw/source/filter/html/htmldrawreader.cxx
index cfaa9ece5011..7dbabfafd73e 100644
--- a/sw/source/filter/html/htmldrawreader.cxx
+++ b/sw/source/filter/html/htmldrawreader.cxx
@@ -238,11 +238,7 @@ static void PutEEPoolItem( SfxItemSet &rEEItemSet,
}
if( nEEWhich )
- {
- std::unique_ptr<SfxPoolItem> pEEItem(rSwItem.Clone());
- pEEItem->SetWhich( nEEWhich );
- rEEItemSet.Put( *pEEItem );
- }
+ rEEItemSet.Put( rSwItem.CloneSetWhich(nEEWhich) );
}
void SwHTMLParser::NewMarquee( HTMLTable *pCurTable )
diff --git a/sw/source/filter/html/htmldrawwriter.cxx b/sw/source/filter/html/htmldrawwriter.cxx
index 15615ad29698..7666f9f2ca17 100644
--- a/sw/source/filter/html/htmldrawwriter.cxx
+++ b/sw/source/filter/html/htmldrawwriter.cxx
@@ -114,9 +114,7 @@ void SwHTMLWriter::GetEEAttrsFromDrwObj( SfxItemSet& rItemSet,
pEEItem = &rObjItemSet.GetPool()->GetDefaultItem(nEEWhich);
// now we clone the item with the which id of the writer
- std::unique_ptr<SfxPoolItem> pSwItem(pEEItem->Clone());
- pSwItem->SetWhich( nSwWhich );
- rItemSet.Put( *pSwItem );
+ rItemSet.Put( pEEItem->CloneSetWhich(nSwWhich) );
}
nEEWhich = aIter.NextWhich();
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index d08796457530..5ea8e4a5a7db 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -468,8 +468,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bWriteCombChars)
{
if (const SfxGrabBagItem *pCharFmtGrabBag = aExportSet.GetItem<SfxGrabBagItem>(RES_CHRATR_GRABBAG, false))
{
- std::unique_ptr<SfxPoolItem> pNewItem(pCharFmtGrabBag->Clone());
- SfxGrabBagItem* pNewCharFmtGrabBag = dynamic_cast<SfxGrabBagItem*>(pNewItem.get());
+ std::unique_ptr<SfxGrabBagItem> pNewCharFmtGrabBag(static_cast<SfxGrabBagItem*>(pCharFmtGrabBag->Clone()));
assert(pNewCharFmtGrabBag);
auto & rNewFmtMap = pNewCharFmtGrabBag->GetGrabBag();
for (auto const & item : pAutoFmtGrabBag->GetGrabBag())
@@ -477,7 +476,7 @@ void SwWW8AttrIter::OutAttr( sal_Int32 nSwPos, bool bWriteCombChars)
if (item.second.hasValue())
rNewFmtMap.erase(item.first);
}
- aExportSet.Put(*pNewCharFmtGrabBag);
+ aExportSet.Put(std::move(pNewCharFmtGrabBag));
}
}
diff --git a/sw/source/filter/ww8/ww8graf.cxx b/sw/source/filter/ww8/ww8graf.cxx
index 551376439e05..f798db5f25cd 100644
--- a/sw/source/filter/ww8/ww8graf.cxx
+++ b/sw/source/filter/ww8/ww8graf.cxx
@@ -521,9 +521,7 @@ void SwWW8ImplReader::InsertTxbxStyAttrs( SfxItemSet& rS, sal_uInt16 nColl )
( SfxItemState::SET != rS.GetItemState(nWhich, false) )
)
{
- std::unique_ptr<SfxPoolItem> pCopy(pItem->Clone());
- pCopy->SetWhich( nWhich );
- rS.Put( *pCopy );
+ rS.Put( pItem->CloneSetWhich(nWhich) );
}
}
}
@@ -735,9 +733,7 @@ void SwWW8ImplReader::InsertAttrsAsDrawingAttrs(WW8_CP nStartCp, WW8_CP nEndCp,
nWhich != nSlotId
)
{
- std::unique_ptr<SfxPoolItem> pCopy(pItem->Clone());
- pCopy->SetWhich( nWhich );
- pS->Put( *pCopy );
+ pS->Put( pItem->CloneSetWhich(nWhich) );
}
}
}
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index bcb276246418..e98fc1b5b4b6 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -3617,7 +3617,7 @@ void SwWW8ImplReader::Read_UnderlineColor(sal_uInt16, const sal_uInt8* pData, sh
{
std::unique_ptr<SvxUnderlineItem> pUnderline(static_cast<SvxUnderlineItem*>(m_xCurrentItemSet->Get(RES_CHRATR_UNDERLINE, false).Clone()));
pUnderline->SetColor( msfilter::util::BGRToRGB(SVBT32ToUInt32(pData)) );
- m_xCurrentItemSet->Put( *pUnderline );
+ m_xCurrentItemSet->Put( std::move(pUnderline) );
}
}
}
diff --git a/sw/source/filter/xml/xmlitemi.cxx b/sw/source/filter/xml/xmlitemi.cxx
index 68e7ca2f47d7..b14f28bc7534 100644
--- a/sw/source/filter/xml/xmlitemi.cxx
+++ b/sw/source/filter/xml/xmlitemi.cxx
@@ -220,7 +220,7 @@ void SwXMLImportTableItemMapper_Impl::finished(
*pNewItem, m_FoMarginValue, Ids[i][1], rUnitConverter);
if (bPut)
{
- rSet.Put(*pNewItem);
+ rSet.Put(std::move(pNewItem));
}
}
else