summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2018-07-16 16:50:15 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2018-07-17 12:30:51 +0200
commita97411b061a382dc09423d04c633dc9b7d24a737 (patch)
tree985683f1a56441245a9746bd02f4f8d4c7effd64
parent011c6c719f77181f042c68ba92e38847e39c8ca1 (diff)
loplugin:useuniqueptr in ScPivotFilterDlg
Change-Id: Iffd5b18048117f59443fc63f137cd468e7e22750 Reviewed-on: https://gerrit.libreoffice.org/57525 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sc/source/ui/dbgui/pfiltdlg.cxx5
-rw-r--r--sc/source/ui/inc/pfiltdlg.hxx2
2 files changed, 3 insertions, 4 deletions
diff --git a/sc/source/ui/dbgui/pfiltdlg.cxx b/sc/source/ui/dbgui/pfiltdlg.cxx
index 757cde2abed9..cdd761e8fdc7 100644
--- a/sc/source/ui/dbgui/pfiltdlg.cxx
+++ b/sc/source/ui/dbgui/pfiltdlg.cxx
@@ -85,7 +85,7 @@ void ScPivotFilterDlg::dispose()
{
for (auto& a : m_pEntryLists) a.reset();
- delete pOutItem;
+ pOutItem.reset();
m_pLbField1.clear();
m_pLbCond1.clear();
m_pEdVal1.clear();
@@ -413,8 +413,7 @@ const ScQueryItem& ScPivotFilterDlg::GetOutputItem()
theParam.bCaseSens = m_pBtnCase->IsChecked();
theParam.eSearchType = m_pBtnRegExp->IsChecked() ? utl::SearchParam::SearchType::Regexp : utl::SearchParam::SearchType::Normal;
- if ( pOutItem ) DELETEZ( pOutItem );
- pOutItem = new ScQueryItem( nWhichQuery, &theParam );
+ pOutItem.reset( new ScQueryItem( nWhichQuery, &theParam ) );
return *pOutItem;
}
diff --git a/sc/source/ui/inc/pfiltdlg.hxx b/sc/source/ui/inc/pfiltdlg.hxx
index a0a33356e5e0..07f2ab565bcc 100644
--- a/sc/source/ui/inc/pfiltdlg.hxx
+++ b/sc/source/ui/inc/pfiltdlg.hxx
@@ -73,7 +73,7 @@ private:
const sal_uInt16 nWhichQuery;
const ScQueryParam theQueryData;
- ScQueryItem* pOutItem;
+ std::unique_ptr<ScQueryItem> pOutItem;
ScViewData* pViewData;
ScDocument* pDoc;
SCTAB nSrcTab;