summaryrefslogtreecommitdiff
path: root/sw/source/ui/dialog
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-11-02 09:50:31 +0000
committerCaolán McNamara <caolanm@redhat.com>2018-11-05 13:21:29 +0100
commite3c6c89588fc6b85663444d701f782e73bb572c1 (patch)
tree47ecffe8be56efa3e150841d7de791308ef8ee03 /sw/source/ui/dialog
parent13b4c191cb251e9218bb9c99140cff7c52fd04db (diff)
weld SwIndexMarkModalDlg cluster
Change-Id: Iff45d9deb5409cf0dbb35723da6bad886379531f Reviewed-on: https://gerrit.libreoffice.org/62775 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/ui/dialog')
-rw-r--r--sw/source/ui/dialog/swdlgfact.cxx40
-rw-r--r--sw/source/ui/dialog/swdlgfact.hxx32
2 files changed, 45 insertions, 27 deletions
diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx
index 84a3b5400b91..c773d98038ac 100644
--- a/sw/source/ui/dialog/swdlgfact.cxx
+++ b/sw/source/ui/dialog/swdlgfact.cxx
@@ -233,8 +233,16 @@ short AbstractMailMergeFieldConnectionsDlg_Impl::Execute()
IMPL_ABSTDLG_BASE(AbstractMultiTOXTabDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractEditRegionDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractInsertSectionTabDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractIndexMarkFloatDlg_Impl);
-IMPL_ABSTDLG_BASE(AbstractAuthMarkFloatDlg_Impl);
+
+short AbstractIndexMarkFloatDlg_Impl::Execute()
+{
+ return m_xDlg->run();
+}
+
+short AbstractAuthMarkFloatDlg_Impl::Execute()
+{
+ return m_xDlg->run();
+}
void AbstractTabDialog_Impl::SetCurPageId( const OString &rName )
{
@@ -690,22 +698,22 @@ AbstractInsertSectionTabDialog_Impl::SetSectionData(SwSectionData const& rSect)
void AbstractIndexMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell)
{
- pDlg->ReInitDlg( rWrtShell);
+ m_xDlg->ReInitDlg( rWrtShell);
}
-vcl::Window* AbstractIndexMarkFloatDlg_Impl::GetWindow()
+std::shared_ptr<SfxModelessDialogController> AbstractIndexMarkFloatDlg_Impl::GetController()
{
- return static_cast<vcl::Window*>(pDlg);
+ return m_xDlg;
}
void AbstractAuthMarkFloatDlg_Impl::ReInitDlg(SwWrtShell& rWrtShell)
{
- pDlg->ReInitDlg( rWrtShell);
+ m_xDlg->ReInitDlg(rWrtShell);
}
-vcl::Window* AbstractAuthMarkFloatDlg_Impl::GetWindow()
+std::shared_ptr<SfxModelessDialogController> AbstractAuthMarkFloatDlg_Impl::GetController()
{
- return static_cast<vcl::Window*>(pDlg);
+ return m_xDlg;
}
std::shared_ptr<SfxModelessDialogController> AbstractSwWordCountFloatDlg_Impl::GetController()
@@ -1115,21 +1123,19 @@ VclPtr<AbstractInsertSectionTabDialog> SwAbstractDialogFactory_Impl::CreateInser
VclPtr<AbstractMarkFloatDlg> SwAbstractDialogFactory_Impl::CreateIndexMarkFloatDlg(
SfxBindings* pBindings,
SfxChildWindow* pChild,
- vcl::Window *pParent,
+ weld::Window *pParent,
SfxChildWinInfo* pInfo )
{
- VclPtr<SwIndexMarkFloatDlg> pDlg = VclPtr<SwIndexMarkFloatDlg>::Create(pBindings, pChild, pParent, pInfo, true/*bNew*/);
- return VclPtr<AbstractIndexMarkFloatDlg_Impl>::Create(pDlg);
+ return VclPtr<AbstractIndexMarkFloatDlg_Impl>::Create(o3tl::make_unique<SwIndexMarkFloatDlg>(pBindings, pChild, pParent, pInfo, true/*bNew*/));
}
VclPtr<AbstractMarkFloatDlg> SwAbstractDialogFactory_Impl::CreateAuthMarkFloatDlg(
SfxBindings* pBindings,
SfxChildWindow* pChild,
- vcl::Window *pParent,
+ weld::Window *pParent,
SfxChildWinInfo* pInfo)
{
- VclPtr<SwAuthMarkFloatDlg> pDlg = VclPtr<SwAuthMarkFloatDlg>::Create( pBindings, pChild, pParent, pInfo, true/*bNew*/ );
- return VclPtr<AbstractAuthMarkFloatDlg_Impl>::Create( pDlg );
+ return VclPtr<AbstractAuthMarkFloatDlg_Impl>::Create(o3tl::make_unique<SwAuthMarkFloatDlg>(pBindings, pChild, pParent, pInfo, true/*bNew*/));
}
VclPtr<AbstractSwWordCountFloatDlg> SwAbstractDialogFactory_Impl::CreateSwWordCountDialog(
@@ -1141,11 +1147,9 @@ VclPtr<AbstractSwWordCountFloatDlg> SwAbstractDialogFactory_Impl::CreateSwWordCo
return VclPtr<AbstractSwWordCountFloatDlg_Impl>::Create(o3tl::make_unique<SwWordCountFloatDlg>(pBindings, pChild, pParent, pInfo));
}
-VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg(
- vcl::Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark )
+VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateIndexMarkModalDlg(weld::Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark )
{
- VclPtr<Dialog> pDlg = VclPtr<SwIndexMarkModalDlg>::Create( pParent, rSh, pCurTOXMark );
- return VclPtr<VclAbstractDialog_Impl>::Create( pDlg );
+ return VclPtr<AbstractGenericDialog_Impl>::Create(o3tl::make_unique<SwIndexMarkModalDlg>(pParent, rSh, pCurTOXMark));
}
VclPtr<AbstractMailMergeWizard> SwAbstractDialogFactory_Impl::CreateMailMergeWizard(
diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx
index 14b802ef7e2d..0959581dd8b2 100644
--- a/sw/source/ui/dialog/swdlgfact.hxx
+++ b/sw/source/ui/dialog/swdlgfact.hxx
@@ -560,17 +560,31 @@ class AbstractInsertSectionTabDialog_Impl : public AbstractInsertSectionTabDialo
class SwIndexMarkFloatDlg;
class AbstractIndexMarkFloatDlg_Impl : public AbstractMarkFloatDlg
{
- DECL_ABSTDLG_BASE(AbstractIndexMarkFloatDlg_Impl,SwIndexMarkFloatDlg)
- virtual void ReInitDlg(SwWrtShell& rWrtShell) override;
- virtual vcl::Window * GetWindow() override; //this method is added for return a Window type pointer
+protected:
+ std::shared_ptr<SwIndexMarkFloatDlg> m_xDlg;
+public:
+ explicit AbstractIndexMarkFloatDlg_Impl(std::unique_ptr<SwIndexMarkFloatDlg> p)
+ : m_xDlg(std::move(p))
+ {
+ }
+ virtual short Execute() override;
+ virtual void ReInitDlg(SwWrtShell& rWrtShell) override;
+ virtual std::shared_ptr<SfxModelessDialogController> GetController() override;
};
class SwAuthMarkFloatDlg;
class AbstractAuthMarkFloatDlg_Impl : public AbstractMarkFloatDlg
{
- DECL_ABSTDLG_BASE(AbstractAuthMarkFloatDlg_Impl,SwAuthMarkFloatDlg)
- virtual void ReInitDlg(SwWrtShell& rWrtShell) override;
- virtual vcl::Window * GetWindow() override; //this method is added for return a Window type pointer
+protected:
+ std::shared_ptr<SwAuthMarkFloatDlg> m_xDlg;
+public:
+ explicit AbstractAuthMarkFloatDlg_Impl(std::unique_ptr<SwAuthMarkFloatDlg> p)
+ : m_xDlg(std::move(p))
+ {
+ }
+ virtual short Execute() override;
+ virtual void ReInitDlg(SwWrtShell& rWrtShell) override;
+ virtual std::shared_ptr<SfxModelessDialogController> GetController() override;
};
class SwMailMergeWizard;
@@ -707,15 +721,15 @@ public:
virtual VclPtr<AbstractMarkFloatDlg> CreateIndexMarkFloatDlg(
SfxBindings* pBindings,
SfxChildWindow* pChild,
- vcl::Window *pParent,
+ weld::Window *pParent,
SfxChildWinInfo* pInfo) override;
virtual VclPtr<AbstractMarkFloatDlg> CreateAuthMarkFloatDlg(
SfxBindings* pBindings,
SfxChildWindow* pChild,
- vcl::Window *pParent,
+ weld::Window *pParent,
SfxChildWinInfo* pInfo) override;
virtual VclPtr<VclAbstractDialog> CreateIndexMarkModalDlg(
- vcl::Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ) override;
+ weld::Window *pParent, SwWrtShell& rSh, SwTOXMark* pCurTOXMark ) override;
virtual VclPtr<AbstractMailMergeWizard> CreateMailMergeWizard(SwView& rView, std::shared_ptr<SwMailMergeConfigItem>& rConfigItem) override;