summaryrefslogtreecommitdiff
path: root/cui/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-09-20 16:26:54 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-09-20 22:08:03 +0200
commit71b85d982269af1ec4616d6738cdadf5ea750f99 (patch)
treedd34052c4cca62860b6271cd18de5736ae82ac99 /cui/source
parent7b4bb1d190642ec1c3b4bd9696d8261afe224fdc (diff)
weld SvxDistributeDialog
Change-Id: I15ee19d825800fc99150292e04dbe4ff239589ba Reviewed-on: https://gerrit.libreoffice.org/60829 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'cui/source')
-rw-r--r--cui/source/factory/dlgfact.cxx17
-rw-r--r--cui/source/factory/dlgfact.hxx11
-rw-r--r--cui/source/inc/dstribut.hxx5
-rw-r--r--cui/source/tabpages/dstribut.cxx17
4 files changed, 27 insertions, 23 deletions
diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx
index fa44f29ac581..e9929805ae5d 100644
--- a/cui/source/factory/dlgfact.cxx
+++ b/cui/source/factory/dlgfact.cxx
@@ -101,7 +101,12 @@ IMPL_ABSTDLG_BASE(CuiAbstractSfxDialog_Impl)
IMPL_ABSTDLG_BASE(CuiVclAbstractDialog_Impl)
IMPL_ABSTDLG_BASE(VclAbstractRefreshableDialog_Impl);
IMPL_ABSTDLG_BASE(CuiAbstractTabDialog_Impl);
-IMPL_ABSTDLG_BASE(AbstractSvxDistributeDialog_Impl);
+
+short AbstractSvxDistributeDialog_Impl::Execute()
+{
+ return m_xDlg->run();
+}
+
IMPL_ABSTDLG_BASE(AbstractHangulHanjaConversionDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractFmShowColsDialog_Impl);
@@ -370,11 +375,11 @@ void CuiAbstractSfxDialog_Impl::SetText( const OUString& rStr )
SvxDistributeHorizontal AbstractSvxDistributeDialog_Impl::GetDistributeHor()const
{
- return pDlg->GetDistributeHor();
+ return m_xDlg->GetDistributeHor();
}
SvxDistributeVertical AbstractSvxDistributeDialog_Impl::GetDistributeVer()const
{
- return pDlg->GetDistributeVer();
+ return m_xDlg->GetDistributeVer();
}
void AbstractHangulHanjaConversionDialog_Impl::EndDialog(sal_Int32 nResult)
@@ -1029,10 +1034,10 @@ VclPtr<AbstractSvxCaptionDialog> AbstractDialogFactory_Impl::CreateCaptionDialog
return VclPtr<AbstractSvxCaptionDialog_Impl>::Create(o3tl::make_unique<SvxCaptionTabDialog>(pParent, pView, nAnchorTypes));
}
-VclPtr<AbstractSvxDistributeDialog> AbstractDialogFactory_Impl::CreateSvxDistributeDialog(const SfxItemSet& rAttr)
+VclPtr<AbstractSvxDistributeDialog> AbstractDialogFactory_Impl::CreateSvxDistributeDialog(weld::Window* pParent,
+ const SfxItemSet& rAttr)
{
- VclPtrInstance<SvxDistributeDialog> pDlg( nullptr, rAttr, SvxDistributeHorizontal::NONE, SvxDistributeVertical::NONE);
- return VclPtr<AbstractSvxDistributeDialog_Impl>::Create( pDlg );
+ return VclPtr<AbstractSvxDistributeDialog_Impl>::Create(o3tl::make_unique<SvxDistributeDialog>(pParent, rAttr, SvxDistributeHorizontal::NONE, SvxDistributeVertical::NONE));
}
VclPtr<AbstractHangulHanjaConversionDialog> AbstractDialogFactory_Impl::CreateHangulHanjaConversionDialog(vcl::Window* pParent,
diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx
index 55bcfa009b31..c2a91e684ade 100644
--- a/cui/source/factory/dlgfact.hxx
+++ b/cui/source/factory/dlgfact.hxx
@@ -145,7 +145,14 @@ public:
class SvxDistributeDialog;
class AbstractSvxDistributeDialog_Impl: public AbstractSvxDistributeDialog
{
- DECL_ABSTDLG_BASE(AbstractSvxDistributeDialog_Impl,SvxDistributeDialog)
+protected:
+ std::unique_ptr<SvxDistributeDialog> m_xDlg;
+public:
+ explicit AbstractSvxDistributeDialog_Impl(std::unique_ptr<SvxDistributeDialog> p)
+ : m_xDlg(std::move(p))
+ {
+ }
+ virtual short Execute() override;
public:
virtual SvxDistributeHorizontal GetDistributeHor() const override;
virtual SvxDistributeVertical GetDistributeVer() const override;
@@ -671,7 +678,7 @@ public:
const SdrView* pView,
SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) override;
virtual VclPtr<AbstractSvxDistributeDialog>
- CreateSvxDistributeDialog(const SfxItemSet& rAttr) override;
+ CreateSvxDistributeDialog(weld::Window* pParent, const SfxItemSet& rAttr) override;
virtual VclPtr<SfxAbstractInsertObjectDialog>
CreateInsertObjectDialog(weld::Window* pParent, const OUString& rCommmand,
const css::uno::Reference < css::embed::XStorage >& xStor,
diff --git a/cui/source/inc/dstribut.hxx b/cui/source/inc/dstribut.hxx
index 9178e8b65af7..40f93d7635c7 100644
--- a/cui/source/inc/dstribut.hxx
+++ b/cui/source/inc/dstribut.hxx
@@ -55,16 +55,15 @@ public:
SvxDistributeVertical GetDistributeVer() const { return m_eDistributeVer; }
};
-class SvxDistributeDialog : public SfxSingleTabDialog
+class SvxDistributeDialog : public SfxSingleTabDialogController
{
VclPtr<SvxDistributePage> mpPage;
public:
- SvxDistributeDialog(vcl::Window* pParent, const SfxItemSet& rAttr,
+ SvxDistributeDialog(weld::Window* pParent, const SfxItemSet& rAttr,
SvxDistributeHorizontal eHor,
SvxDistributeVertical eVer);
virtual ~SvxDistributeDialog() override;
- virtual void dispose() override;
SvxDistributeHorizontal GetDistributeHor() const { return mpPage->GetDistributeHor(); }
SvxDistributeVertical GetDistributeVer() const { return mpPage->GetDistributeVer(); }
diff --git a/cui/source/tabpages/dstribut.cxx b/cui/source/tabpages/dstribut.cxx
index 1e7fa0e46791..668fd610d80d 100644
--- a/cui/source/tabpages/dstribut.cxx
+++ b/cui/source/tabpages/dstribut.cxx
@@ -28,26 +28,19 @@
|*
\************************************************************************/
-SvxDistributeDialog::SvxDistributeDialog(vcl::Window* pParent,
+SvxDistributeDialog::SvxDistributeDialog(weld::Window* pParent,
const SfxItemSet& rInAttrs, SvxDistributeHorizontal eHor,
SvxDistributeVertical eVer)
- : SfxSingleTabDialog(pParent, rInAttrs, "DistributionDialog",
- "cui/ui/distributiondialog.ui")
- , mpPage(nullptr)
+ : SfxSingleTabDialogController(pParent, rInAttrs, "cui/ui/distributiondialog.ui",
+ "DistributionDialog")
{
- mpPage = VclPtr<SvxDistributePage>::Create(get_content_area(), rInAttrs, eHor, eVer);
+ TabPageParent pPageParent(get_content_area(), this);
+ mpPage = VclPtr<SvxDistributePage>::Create(pPageParent, rInAttrs, eHor, eVer);
SetTabPage(mpPage);
}
SvxDistributeDialog::~SvxDistributeDialog()
{
- disposeOnce();
-}
-
-void SvxDistributeDialog::dispose()
-{
- mpPage.clear();
- SfxSingleTabDialog::dispose();
}
/*************************************************************************