[Libreoffice-commits] core.git: 2 commits - sw/inc sw/source
Noel Grandin (via logerrit)
logerrit at kemper.freedesktop.org
Thu Mar 28 06:40:00 UTC 2019
sw/inc/swabstdlg.hxx | 2 +-
sw/source/ui/dbui/dbinsdlg.cxx | 2 +-
sw/source/ui/dialog/swdlgfact.cxx | 2 +-
sw/source/ui/dialog/swdlgfact.hxx | 2 +-
sw/source/ui/misc/outline.cxx | 2 +-
sw/source/ui/table/convert.cxx | 2 +-
sw/source/ui/table/tautofmt.cxx | 4 ++--
sw/source/uibase/config/uinums.cxx | 4 ++--
sw/source/uibase/inc/tautofmt.hxx | 2 +-
sw/source/uibase/inc/uinums.hxx | 2 +-
10 files changed, 12 insertions(+), 12 deletions(-)
New commits:
commit 6b46aaafb8aa65987e4e441d3523c52283664a58
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Mar 27 10:03:09 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Mar 28 07:39:43 2019 +0100
return unique_ptr from MakeNumRule
Change-Id: Ic606aa8f349946661b4a5fb017d1a1fd4ba993ae
Reviewed-on: https://gerrit.libreoffice.org/69852
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
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;
};
commit b4a208d1d38fb1eb71070e24cb2d146558b214a2
Author: Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Wed Mar 27 10:01:19 2019 +0200
Commit: Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Thu Mar 28 07:39:31 2019 +0100
return unique_ptr from FillAutoFormatOfIndex
Change-Id: If41981a2136ab1a9d06a1b7a3b044ade302ba1d4
Reviewed-on: https://gerrit.libreoffice.org/69795
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx
index 647c5c903925..c92ab77686e9 100644
--- a/sw/inc/swabstdlg.hxx
+++ b/sw/inc/swabstdlg.hxx
@@ -297,7 +297,7 @@ class AbstractSwAutoFormatDlg : public VclAbstractDialog
protected:
virtual ~AbstractSwAutoFormatDlg() override = default;
public:
- virtual SwTableAutoFormat* FillAutoFormatOfIndex() const = 0;
+ virtual std::unique_ptr<SwTableAutoFormat> FillAutoFormatOfIndex() const = 0;
};
class AbstractSwFieldDlg : public SfxAbstractTabDialog
diff --git a/sw/source/ui/dbui/dbinsdlg.cxx b/sw/source/ui/dbui/dbinsdlg.cxx
index dd3abe56a7ee..51d02dcd5026 100644
--- a/sw/source/ui/dbui/dbinsdlg.cxx
+++ b/sw/source/ui/dbui/dbinsdlg.cxx
@@ -740,7 +740,7 @@ IMPL_LINK_NOARG(SwInsertDBColAutoPilot, AutoFormatHdl, weld::Button&, void)
ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(rFact.CreateSwAutoFormatDlg(m_xDialog.get(), pView->GetWrtShellPtr(), false, m_xTAutoFormat.get()));
if( RET_OK == pDlg->Execute())
- m_xTAutoFormat.reset(pDlg->FillAutoFormatOfIndex());
+ m_xTAutoFormat = pDlg->FillAutoFormatOfIndex();
}
IMPL_LINK(SwInsertDBColAutoPilot, TVSelectHdl, weld::TreeView&, rBox, void)
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 7d36a5e527e1..687f70bd90cf 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -437,7 +437,7 @@ void AbstractSwSelGlossaryDlg_Impl::SelectEntryPos(sal_Int32 nIdx)
m_xDlg->SelectEntryPos( nIdx );
}
-SwTableAutoFormat* AbstractSwAutoFormatDlg_Impl::FillAutoFormatOfIndex() const
+std::unique_ptr<SwTableAutoFormat> AbstractSwAutoFormatDlg_Impl::FillAutoFormatOfIndex() const
{
return m_xDlg->FillAutoFormatOfIndex();
}
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index dfb5925b7a5e..94b7fa965640 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -344,7 +344,7 @@ public:
{
}
virtual short Execute() override;
- virtual SwTableAutoFormat* FillAutoFormatOfIndex() const override;
+ virtual std::unique_ptr<SwTableAutoFormat> FillAutoFormatOfIndex() const override;
};
class AbstractSwFieldDlg_Impl : public AbstractSwFieldDlg
diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx
index 6ac46df8eaae..9420e5c2290f 100644
--- a/sw/source/ui/table/convert.cxx
+++ b/sw/source/ui/table/convert.cxx
@@ -175,7 +175,7 @@ IMPL_LINK_NOARG(SwConvertTableDlg, AutoFormatHdl, weld::Button&, void)
ScopedVclPtr<AbstractSwAutoFormatDlg> pDlg(rFact.CreateSwAutoFormatDlg(m_xDialog.get(), pShell, false, mxTAutoFormat.get()));
if (RET_OK == pDlg->Execute())
- mxTAutoFormat.reset(pDlg->FillAutoFormatOfIndex());
+ mxTAutoFormat = pDlg->FillAutoFormatOfIndex();
}
IMPL_LINK(SwConvertTableDlg, BtnHdl, weld::Button&, rButton, void)
diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx
index 503553fc6ead..e2cfa38a688d 100644
--- a/sw/source/ui/table/tautofmt.cxx
+++ b/sw/source/ui/table/tautofmt.cxx
@@ -161,11 +161,11 @@ void SwAutoFormatDlg::UpdateChecks( const SwTableAutoFormat& rFormat, bool bEnab
m_xBtnAlignment->set_active(rFormat.IsJustify());
}
-SwTableAutoFormat* SwAutoFormatDlg::FillAutoFormatOfIndex() const
+std::unique_ptr<SwTableAutoFormat> SwAutoFormatDlg::FillAutoFormatOfIndex() const
{
if( 255 != m_nIndex )
{
- return new SwTableAutoFormat( (*m_xTableTable)[ m_nIndex ] );
+ return std::make_unique<SwTableAutoFormat>( (*m_xTableTable)[ m_nIndex ] );
}
return nullptr;
diff --git a/sw/source/uibase/inc/tautofmt.hxx b/sw/source/uibase/inc/tautofmt.hxx
index bfc00a3d97d5..69e9938ba11c 100644
--- a/sw/source/uibase/inc/tautofmt.hxx
+++ b/sw/source/uibase/inc/tautofmt.hxx
@@ -79,7 +79,7 @@ public:
virtual short run() override;
- SwTableAutoFormat* FillAutoFormatOfIndex() const;
+ std::unique_ptr<SwTableAutoFormat> FillAutoFormatOfIndex() const;
virtual ~SwAutoFormatDlg() override;
};
More information about the Libreoffice-commits
mailing list