[Libreoffice-commits] core.git: 2 commits - include/svx svx/source
Noel Grandin
noel.grandin at collabora.co.uk
Mon Jun 4 06:38:05 UTC 2018
include/svx/ctredlin.hxx | 3 ++-
include/svx/hdft.hxx | 3 ++-
svx/source/dialog/ctredlin.cxx | 7 ++-----
svx/source/dialog/hdft.cxx | 10 +++++-----
4 files changed, 11 insertions(+), 12 deletions(-)
New commits:
commit 5386d54420c893c05b4e5d3827b7211f523d0cc4
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon May 28 13:12:45 2018 +0200
loplugin:useuniqueptr in SvxHFPage
Change-Id: I9db95c6e18002ac0b111b36d5f236550ac0af098
Reviewed-on: https://gerrit.libreoffice.org/55225
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svx/hdft.hxx b/include/svx/hdft.hxx
index 0f6b422a5672..2e6d14dc7cce 100644
--- a/include/svx/hdft.hxx
+++ b/include/svx/hdft.hxx
@@ -29,6 +29,7 @@
#include <svx/pagectrl.hxx>
#include <svx/svxdllapi.h>
+#include <memory>
namespace svx
{
@@ -80,7 +81,7 @@ protected:
VclPtr<PushButton> m_pBackgroundBtn;
sal_uInt16 nId;
- SfxItemSet* pBBSet;
+ std::unique_ptr<SfxItemSet> pBBSet;
bool mbDisableQueryBox : 1;
bool mbEnableDrawingLayerFillStyles : 1;
diff --git a/svx/source/dialog/hdft.cxx b/svx/source/dialog/hdft.cxx
index 9e7c3a774093..698fb4eccf2a 100644
--- a/svx/source/dialog/hdft.cxx
+++ b/svx/source/dialog/hdft.cxx
@@ -206,7 +206,7 @@ SvxHFPage::~SvxHFPage()
void SvxHFPage::dispose()
{
- delete pBBSet;
+ pBBSet.reset();
m_pPageLbl.clear();
m_pTurnOnBox.clear();
m_pCntSharedBox.clear();
@@ -595,13 +595,13 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, Button*, void)
if(mbEnableDrawingLayerFillStyles)
{
- pBBSet = new SfxItemSet(
+ pBBSet.reset(new SfxItemSet(
*GetItemSet().GetPool(),
{{XATTR_FILL_FIRST, XATTR_FILL_LAST}, // DrawingLayer FillStyle definitions
{SID_COLOR_TABLE, SID_PATTERN_LIST}, // XPropertyLists for Color, Gradient, Hatch and Graphic fills
{nOuter, nOuter},
{nInner, nInner},
- {nShadow, nShadow}});
+ {nShadow, nShadow}}));
// copy items for XPropertyList entries from the DrawModel so that
// the Area TabPage can access them
@@ -632,12 +632,12 @@ IMPL_LINK_NOARG(SvxHFPage, BackgroundHdl, Button*, void)
{
const sal_uInt16 nBrush(GetWhich(SID_ATTR_BRUSH));
- pBBSet = new SfxItemSet(
+ pBBSet.reset( new SfxItemSet(
*GetItemSet().GetPool(),
{{nBrush, nBrush},
{nOuter, nOuter},
{nInner, nInner},
- {nShadow, nShadow}});
+ {nShadow, nShadow}}) );
}
const SfxPoolItem* pItem;
commit 1649f48917e04549cfffddff322cc8fa6d4b42c1
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date: Mon May 28 12:04:08 2018 +0200
loplugin:useuniqueptr in SvxRedlinTable
Change-Id: I9d2f7516f84351e5a1447a4a78398d8c33bd211a
Reviewed-on: https://gerrit.libreoffice.org/55224
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/include/svx/ctredlin.hxx b/include/svx/ctredlin.hxx
index b778bd8015bc..c6c15baf5148 100644
--- a/include/svx/ctredlin.hxx
+++ b/include/svx/ctredlin.hxx
@@ -41,6 +41,7 @@
#include <vcl/vclptr.hxx>
#include <vcl/tabpage.hxx>
#include <vcl/tabctrl.hxx>
+#include <memory>
namespace utl {
class SearchParam;
@@ -126,7 +127,7 @@ private:
Color maEntryColor;
Image maEntryImage;
OUString maEntryString;
- utl::TextSearch* pCommentSearcher;
+ std::unique_ptr<utl::TextSearch> pCommentSearcher;
Link<const SvSortData*,sal_Int32> aColCompareLink;
protected:
diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx
index 8de682c4933e..c6cea65bd278 100644
--- a/svx/source/dialog/ctredlin.cxx
+++ b/svx/source/dialog/ctredlin.cxx
@@ -113,8 +113,7 @@ SvxRedlinTable::~SvxRedlinTable()
void SvxRedlinTable::dispose()
{
- delete pCommentSearcher;
- pCommentSearcher = nullptr;
+ pCommentSearcher.reset();
SvSimpleTable::dispose();
}
@@ -257,9 +256,7 @@ void SvxRedlinTable::SetCommentParams( const utl::SearchParam* pSearchPara )
{
if(pSearchPara!=nullptr)
{
- delete pCommentSearcher;
-
- pCommentSearcher=new utl::TextSearch(*pSearchPara, LANGUAGE_SYSTEM );
+ pCommentSearcher.reset(new utl::TextSearch(*pSearchPara, LANGUAGE_SYSTEM ));
}
}
More information about the Libreoffice-commits
mailing list