[Libreoffice-commits] core.git: sd/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Fri Aug 24 11:18:55 UTC 2018


 sd/source/ui/dlg/sddlgfact.cxx |   28 ++++++++++++++--------------
 sd/source/ui/dlg/sddlgfact.hxx |   36 ++++++++++++++++++------------------
 2 files changed, 32 insertions(+), 32 deletions(-)

New commits:
commit 8e74d55a89b00e3d1a8e6d356c21009cda02eb5c
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Fri Aug 24 10:35:53 2018 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Fri Aug 24 13:18:31 2018 +0200

    loplugin:useuniqueptr in sd dialogs
    
    Change-Id: Ie4b665b565812f8ba4ca454387a6ad0e38433bbd
    Reviewed-on: https://gerrit.libreoffice.org/59544
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sd/source/ui/dlg/sddlgfact.cxx b/sd/source/ui/dlg/sddlgfact.cxx
index d318528ca594..22581ad31aaa 100644
--- a/sd/source/ui/dlg/sddlgfact.cxx
+++ b/sd/source/ui/dlg/sddlgfact.cxx
@@ -103,8 +103,8 @@ IMPL_ABSTDLG_BASE(AbstractSdPublishingDlg_Impl);
 IMPL_ABSTDLG_BASE(AbstractHeaderFooterDialog_Impl);
 IMPL_ABSTDLG_BASE(AbstractBulletDialog_Impl);
 
-AbstractBreakDlg_Impl::AbstractBreakDlg_Impl(::sd::BreakDlg* pDlg)
-    : m_xDlg(pDlg)
+AbstractBreakDlg_Impl::AbstractBreakDlg_Impl(std::unique_ptr<::sd::BreakDlg> pDlg)
+    : m_xDlg(std::move(pDlg))
 {
 }
 
@@ -113,8 +113,8 @@ short AbstractBreakDlg_Impl::Execute()
     return m_xDlg->execute();
 }
 
-AbstractMasterLayoutDialog_Impl::AbstractMasterLayoutDialog_Impl(::sd::MasterLayoutDialog* pDlg)
-    : m_xDlg(pDlg)
+AbstractMasterLayoutDialog_Impl::AbstractMasterLayoutDialog_Impl(std::unique_ptr<::sd::MasterLayoutDialog> pDlg)
+    : m_xDlg(std::move(pDlg))
 {
 }
 
@@ -333,7 +333,7 @@ VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateBreakDlg(
                                             sal_uLong nSumActionCount,
                                             sal_uLong nObjCount )
 {
-    return VclPtr<AbstractBreakDlg_Impl>::Create(new ::sd::BreakDlg(pParent, pDrView, pShell, nSumActionCount, nObjCount));
+    return VclPtr<AbstractBreakDlg_Impl>::Create(o3tl::make_unique<::sd::BreakDlg>(pParent, pDrView, pShell, nSumActionCount, nObjCount));
 }
 
 VclPtr<AbstractCopyDlg> SdAbstractDialogFactory_Impl::CreateCopyDlg(vcl::Window* pParent,
@@ -345,7 +345,7 @@ VclPtr<AbstractCopyDlg> SdAbstractDialogFactory_Impl::CreateCopyDlg(vcl::Window*
 
 VclPtr<AbstractSdCustomShowDlg> SdAbstractDialogFactory_Impl::CreateSdCustomShowDlg(weld::Window* pParent, SdDrawDocument& rDrawDoc )
 {
-    return VclPtr<AbstractSdCustomShowDlg_Impl>::Create(new SdCustomShowDlg(pParent, rDrawDoc));
+    return VclPtr<AbstractSdCustomShowDlg_Impl>::Create(o3tl::make_unique<SdCustomShowDlg>(pParent, rDrawDoc));
 }
 
 VclPtr<SfxAbstractTabDialog>  SdAbstractDialogFactory_Impl::CreateSdTabCharDialog(vcl::Window* pParent, const SfxItemSet* pAttr, SfxObjectShell* pDocShell )
@@ -360,17 +360,17 @@ VclPtr<SfxAbstractTabDialog>  SdAbstractDialogFactory_Impl::CreateSdTabPageDialo
 
 VclPtr<AbstractSdModifyFieldDlg> SdAbstractDialogFactory_Impl::CreateSdModifyFieldDlg(weld::Window* pParent, const SvxFieldData* pInField, const SfxItemSet& rSet)
 {
-    return VclPtr<AbstractSdModifyFieldDlg_Impl>::Create(new SdModifyFieldDlg(pParent, pInField, rSet));
+    return VclPtr<AbstractSdModifyFieldDlg_Impl>::Create(o3tl::make_unique<SdModifyFieldDlg>(pParent, pInField, rSet));
 }
 
 VclPtr<AbstractSdSnapLineDlg> SdAbstractDialogFactory_Impl::CreateSdSnapLineDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, ::sd::View* pView)
 {
-    return VclPtr<AbstractSdSnapLineDlg_Impl>::Create(new SdSnapLineDlg(pParent, rInAttrs, pView));
+    return VclPtr<AbstractSdSnapLineDlg_Impl>::Create(o3tl::make_unique<SdSnapLineDlg>(pParent, rInAttrs, pView));
 }
 
 VclPtr<AbstractSdInsertLayerDlg> SdAbstractDialogFactory_Impl::CreateSdInsertLayerDlg(weld::Window* pParent, const SfxItemSet& rInAttrs, bool bDeletable, const OUString& aStr)
 {
-    return VclPtr<AbstractSdInsertLayerDlg_Impl>::Create(new SdInsertLayerDlg(pParent, rInAttrs, bDeletable, aStr));
+    return VclPtr<AbstractSdInsertLayerDlg_Impl>::Create(o3tl::make_unique<SdInsertLayerDlg>(pParent, rInAttrs, bDeletable, aStr));
 }
 
 VclPtr<AbstractSdInsertPagesObjsDlg> SdAbstractDialogFactory_Impl::CreateSdInsertPagesObjsDlg( vcl::Window* pParent, const SdDrawDocument* pDoc, SfxMedium* pSfxMedium, const OUString& rFileName )
@@ -380,7 +380,7 @@ VclPtr<AbstractSdInsertPagesObjsDlg> SdAbstractDialogFactory_Impl::CreateSdInser
 
 VclPtr<AbstractMorphDlg> SdAbstractDialogFactory_Impl::CreateMorphDlg(weld::Window* pParent, const SdrObject* pObj1, const SdrObject* pObj2)
 {
-    return VclPtr<AbstractMorphDlg_Impl>::Create(new ::sd::MorphDlg(pParent, pObj1, pObj2));
+    return VclPtr<AbstractMorphDlg_Impl>::Create(o3tl::make_unique<::sd::MorphDlg>(pParent, pObj1, pObj2));
 }
 
 VclPtr<SfxAbstractTabDialog>  SdAbstractDialogFactory_Impl::CreateSdOutlineBulletTabDlg(vcl::Window* pParent, const SfxItemSet* pAttr, ::sd::View* pView )
@@ -396,7 +396,7 @@ VclPtr<SfxAbstractTabDialog> SdAbstractDialogFactory_Impl::CreateSdParagraphTabD
 VclPtr<AbstractSdStartPresDlg> SdAbstractDialogFactory_Impl::CreateSdStartPresentationDlg(weld::Window* pParent,
         const SfxItemSet& rInAttrs, const std::vector<OUString> &rPageNames, SdCustomShowList* pCSList)
 {
-    return VclPtr<AbstractSdStartPresDlg_Impl>::Create(new SdStartPresentationDlg(pParent, rInAttrs, rPageNames, pCSList));
+    return VclPtr<AbstractSdStartPresDlg_Impl>::Create(o3tl::make_unique<SdStartPresentationDlg>(pParent, rInAttrs, rPageNames, pCSList));
 }
 
 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateRemoteDialog( vcl::Window* pParent )
@@ -426,7 +426,7 @@ VclPtr<SfxAbstractDialog> SdAbstractDialogFactory_Impl::CreatSdActionDialog(vcl:
 
 VclPtr<AbstractSdVectorizeDlg>  SdAbstractDialogFactory_Impl::CreateSdVectorizeDlg(weld::Window* pParent, const Bitmap& rBmp, ::sd::DrawDocShell* pDocShell)
 {
-    return VclPtr<AbstractSdVectorizeDlg_Impl>::Create(new SdVectorizeDlg(pParent, rBmp, pDocShell));
+    return VclPtr<AbstractSdVectorizeDlg_Impl>::Create(o3tl::make_unique<SdVectorizeDlg>(pParent, rBmp, pDocShell));
 }
 
 VclPtr<AbstractSdPublishingDlg>  SdAbstractDialogFactory_Impl::CreateSdPublishingDlg( vcl::Window* pParent, DocumentType eDocType)
@@ -457,7 +457,7 @@ CreateTabPage SdAbstractDialogFactory_Impl::GetSdOptionsSnapTabPageCreatorFunc()
 
 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateMasterLayoutDialog(weld::Window* pParent, SdDrawDocument* pDoc, SdPage* pCurrentPage)
 {
-  return VclPtr<AbstractMasterLayoutDialog_Impl>::Create(new ::sd::MasterLayoutDialog(pParent, pDoc, pCurrentPage));
+  return VclPtr<AbstractMasterLayoutDialog_Impl>::Create(o3tl::make_unique<::sd::MasterLayoutDialog>(pParent, pDoc, pCurrentPage));
 }
 
 VclPtr<AbstractHeaderFooterDialog> SdAbstractDialogFactory_Impl::CreateHeaderFooterDialog( sd::ViewShell* pViewShell,
@@ -468,7 +468,7 @@ VclPtr<AbstractHeaderFooterDialog> SdAbstractDialogFactory_Impl::CreateHeaderFoo
 
 VclPtr<VclAbstractDialog> SdAbstractDialogFactory_Impl::CreateSdPhotoAlbumDialog(weld::Window* pParent, SdDrawDocument* pDoc)
 {
-    return VclPtr<SdAbstractGenericDialog_Impl>::Create(new sd::SdPhotoAlbumDialog(pParent, pDoc));
+    return VclPtr<SdAbstractGenericDialog_Impl>::Create(o3tl::make_unique<sd::SdPhotoAlbumDialog>(pParent, pDoc));
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sd/source/ui/dlg/sddlgfact.hxx b/sd/source/ui/dlg/sddlgfact.hxx
index 3ecd1d32e2d1..10880bd9b46f 100644
--- a/sd/source/ui/dlg/sddlgfact.hxx
+++ b/sd/source/ui/dlg/sddlgfact.hxx
@@ -70,8 +70,8 @@ class SdAbstractGenericDialog_Impl : public VclAbstractDialog
 protected:
     std::unique_ptr<weld::GenericDialogController> m_xDlg;
 public:
-    explicit SdAbstractGenericDialog_Impl(weld::GenericDialogController* p)
-        : m_xDlg(p)
+    explicit SdAbstractGenericDialog_Impl(std::unique_ptr<weld::GenericDialogController> p)
+        : m_xDlg(std::move(p))
     {
     }
     virtual short Execute() override;
@@ -82,7 +82,7 @@ class AbstractMasterLayoutDialog_Impl : public VclAbstractDialog
 private:
     std::unique_ptr<sd::MasterLayoutDialog> m_xDlg;
 public:
-    AbstractMasterLayoutDialog_Impl(::sd::MasterLayoutDialog* pDlg);
+    AbstractMasterLayoutDialog_Impl(std::unique_ptr<::sd::MasterLayoutDialog> pDlg);
     virtual short Execute() override;
 };
 
@@ -91,7 +91,7 @@ class AbstractBreakDlg_Impl : public VclAbstractDialog
 private:
     std::unique_ptr<sd::BreakDlg> m_xDlg;
 public:
-    AbstractBreakDlg_Impl(::sd::BreakDlg* pDlg);
+    AbstractBreakDlg_Impl(std::unique_ptr<::sd::BreakDlg> pDlg);
     virtual short Execute() override;
 };
 
@@ -107,8 +107,8 @@ class AbstractSdCustomShowDlg_Impl : public AbstractSdCustomShowDlg
 private:
     std::unique_ptr<SdCustomShowDlg> m_xDlg;
 public:
-    AbstractSdCustomShowDlg_Impl(SdCustomShowDlg* pDlg)
-        : m_xDlg(pDlg)
+    AbstractSdCustomShowDlg_Impl(std::unique_ptr<SdCustomShowDlg> pDlg)
+        : m_xDlg(std::move(pDlg))
     {
     }
     virtual short       Execute() override;
@@ -157,8 +157,8 @@ class AbstractSdModifyFieldDlg_Impl : public AbstractSdModifyFieldDlg
 private:
     std::unique_ptr<SdModifyFieldDlg> m_xDlg;
 public:
-    AbstractSdModifyFieldDlg_Impl(SdModifyFieldDlg* pDlg)
-        : m_xDlg(pDlg)
+    AbstractSdModifyFieldDlg_Impl(std::unique_ptr<SdModifyFieldDlg> pDlg)
+        : m_xDlg(std::move(pDlg))
     {
     }
     virtual short Execute() override;
@@ -172,8 +172,8 @@ class AbstractSdSnapLineDlg_Impl : public AbstractSdSnapLineDlg
 private:
     std::unique_ptr<SdSnapLineDlg> m_xDlg;
 public:
-    AbstractSdSnapLineDlg_Impl(SdSnapLineDlg* pDlg)
-        : m_xDlg(pDlg)
+    AbstractSdSnapLineDlg_Impl(std::unique_ptr<SdSnapLineDlg> pDlg)
+        : m_xDlg(std::move(pDlg))
     {
     }
     virtual short Execute() override;
@@ -191,8 +191,8 @@ class AbstractSdInsertLayerDlg_Impl : public AbstractSdInsertLayerDlg
 private:
     std::unique_ptr<SdInsertLayerDlg> m_xDlg;
 public:
-    AbstractSdInsertLayerDlg_Impl(SdInsertLayerDlg* pDlg)
-        : m_xDlg(pDlg)
+    AbstractSdInsertLayerDlg_Impl(std::unique_ptr<SdInsertLayerDlg> pDlg)
+        : m_xDlg(std::move(pDlg))
     {
     }
     virtual short   Execute() override;
@@ -215,8 +215,8 @@ class AbstractMorphDlg_Impl : public AbstractMorphDlg
 private:
     std::unique_ptr<sd::MorphDlg> m_xDlg;
 public:
-    AbstractMorphDlg_Impl(::sd::MorphDlg* pDlg)
-        : m_xDlg(pDlg)
+    AbstractMorphDlg_Impl(std::unique_ptr<::sd::MorphDlg> pDlg)
+        : m_xDlg(std::move(pDlg))
     {
     }
     virtual short   Execute() override;
@@ -232,8 +232,8 @@ class AbstractSdStartPresDlg_Impl : public AbstractSdStartPresDlg
 private:
     std::unique_ptr<SdStartPresentationDlg> m_xDlg;
 public:
-    AbstractSdStartPresDlg_Impl(SdStartPresentationDlg* pDlg)
-        : m_xDlg(pDlg)
+    AbstractSdStartPresDlg_Impl(std::unique_ptr<SdStartPresentationDlg> pDlg)
+        : m_xDlg(std::move(pDlg))
     {
     }
     virtual short   Execute() override;
@@ -260,8 +260,8 @@ class AbstractSdVectorizeDlg_Impl :public AbstractSdVectorizeDlg
 private:
     std::unique_ptr<SdVectorizeDlg> m_xDlg;
 public:
-    AbstractSdVectorizeDlg_Impl(SdVectorizeDlg* pDlg)
-        : m_xDlg(pDlg)
+    AbstractSdVectorizeDlg_Impl(std::unique_ptr<SdVectorizeDlg> pDlg)
+        : m_xDlg(std::move(pDlg))
     {
     }
     virtual short Execute() override;


More information about the Libreoffice-commits mailing list