summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-09-05 15:20:50 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-09-06 08:32:32 +0200
commit7c94581151c6427d143bb63fe51fa4b229e0b7e7 (patch)
tree51efa11bb945fde4e61dba453c7b4b83d702bfe7 /editeng
parent1f5698ba8b62e62999b0efb363916a91bdd54c94 (diff)
loplugin:useuniqueptr in editeng
Change-Id: I6190098e7e3f4df415d6aef46d152324cbc3dd60 Reviewed-on: https://gerrit.libreoffice.org/60049 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/impedit4.cxx6
-rw-r--r--editeng/source/items/textitem.cxx3
2 files changed, 4 insertions, 5 deletions
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 471301196295..31b3cd6c4e3d 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -1458,10 +1458,10 @@ EESpellState ImpEditEngine::Spell( EditView* pEditView, bool bMultipleDoc )
else if ( CreateEPaM( aEditDoc.GetStartPaM() ) == pSpellInfo->aSpellStart )
bIsStart = true;
- EditSpellWrapper* pWrp = new EditSpellWrapper( Application::GetDefDialogParent(),
- bIsStart, pEditView );
+ std::unique_ptr<EditSpellWrapper> pWrp(new EditSpellWrapper( Application::GetDefDialogParent(),
+ bIsStart, pEditView ));
pWrp->SpellDocument();
- delete pWrp;
+ pWrp.reset();
if ( !bMultipleDoc )
{
diff --git a/editeng/source/items/textitem.cxx b/editeng/source/items/textitem.cxx
index 9f6a0f22ba74..e995a7ba5796 100644
--- a/editeng/source/items/textitem.cxx
+++ b/editeng/source/items/textitem.cxx
@@ -2881,7 +2881,7 @@ void SvxScriptSetItem::PutItemForScriptType( SvtScriptType nScriptType,
sal_uInt16 nLatin, nAsian, nComplex;
GetWhichIds( nLatin, nAsian, nComplex );
- SfxPoolItem* pCpy = rItem.Clone();
+ std::unique_ptr<SfxPoolItem> pCpy(rItem.Clone());
if( SvtScriptType::LATIN & nScriptType )
{
pCpy->SetWhich( nLatin );
@@ -2897,7 +2897,6 @@ void SvxScriptSetItem::PutItemForScriptType( SvtScriptType nScriptType,
pCpy->SetWhich( nComplex );
GetItemSet().Put( *pCpy );
}
- delete pCpy;
}
void SvxScriptSetItem::GetWhichIds( sal_uInt16 nSlotId, const SfxItemSet& rSet, sal_uInt16& rLatin, sal_uInt16& rAsian, sal_uInt16& rComplex )