summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2019-03-27 10:03:09 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2019-03-28 07:39:43 +0100
commit6b46aaafb8aa65987e4e441d3523c52283664a58 (patch)
tree4f0c70e490047d879de52e52de8fb05745aa2ae2 /sw
parentb4a208d1d38fb1eb71070e24cb2d146558b214a2 (diff)
return unique_ptr from MakeNumRule
Change-Id: Ic606aa8f349946661b4a5fb017d1a1fd4ba993ae Reviewed-on: https://gerrit.libreoffice.org/69852 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/ui/misc/outline.cxx2
-rw-r--r--sw/source/uibase/config/uinums.cxx4
-rw-r--r--sw/source/uibase/inc/uinums.hxx2
3 files changed, 4 insertions, 4 deletions
diff --git a/sw/source/ui/misc/outline.cxx b/sw/source/ui/misc/outline.cxx
index 06f3b29e32bc..e87933b44228 100644
--- a/sw/source/ui/misc/outline.cxx
+++ b/sw/source/ui/misc/outline.cxx
@@ -278,7 +278,7 @@ IMPL_LINK(SwOutlineTabDialog, MenuSelectHdl, const OString&, rIdent, void)
const SwNumRulesWithName *pRules = pChapterNumRules->GetRules( nLevelNo );
if( pRules )
{
- xNumRule.reset(pRules->MakeNumRule(rWrtSh));
+ xNumRule = pRules->MakeNumRule(rWrtSh);
xNumRule->SetRuleType( OUTLINE_RULE );
SfxTabPage* pOutlinePage = GetTabPage("numbering");
assert(pOutlinePage);
diff --git a/sw/source/uibase/config/uinums.cxx b/sw/source/uibase/config/uinums.cxx
index 3b7f3e35e10c..700e0f86c28e 100644
--- a/sw/source/uibase/config/uinums.cxx
+++ b/sw/source/uibase/config/uinums.cxx
@@ -153,10 +153,10 @@ SwNumRulesWithName& SwNumRulesWithName::operator=(const SwNumRulesWithName &rCop
return *this;
}
-SwNumRule* SwNumRulesWithName::MakeNumRule(SwWrtShell& rSh) const
+std::unique_ptr<SwNumRule> SwNumRulesWithName::MakeNumRule(SwWrtShell& rSh) const
{
// #i89178#
- SwNumRule* pChg = new SwNumRule(maName, numfunc::GetDefaultPositionAndSpaceMode());
+ std::unique_ptr<SwNumRule> pChg(new SwNumRule(maName, numfunc::GetDefaultPositionAndSpaceMode()));
pChg->SetAutoRule( false );
for (sal_uInt16 n = 0; n < MAXLEVEL; ++n)
{
diff --git a/sw/source/uibase/inc/uinums.hxx b/sw/source/uibase/inc/uinums.hxx
index 3e5767c4d87a..9b822742083e 100644
--- a/sw/source/uibase/inc/uinums.hxx
+++ b/sw/source/uibase/inc/uinums.hxx
@@ -72,7 +72,7 @@ public:
SwNumRulesWithName &operator=(const SwNumRulesWithName &);
const OUString& GetName() const { return maName; }
- SwNumRule* MakeNumRule(SwWrtShell& rSh) const;
+ std::unique_ptr<SwNumRule> MakeNumRule(SwWrtShell& rSh) const;
void GetNumFormat(size_t, SwNumFormat const*&, OUString const*&) const;
};