summaryrefslogtreecommitdiff
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
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>
-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
-rw-r--r--cui/uiconfig/ui/distributiondialog.ui8
-rw-r--r--include/svx/svdedtv.hxx2
-rw-r--r--include/svx/svxdlg.hxx2
-rw-r--r--reportdesign/source/ui/report/ReportController.cxx2
-rw-r--r--sd/source/ui/view/drviews2.cxx2
-rw-r--r--svx/source/svdraw/svdedtv2.cxx4
10 files changed, 40 insertions, 30 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();
}
/*************************************************************************
diff --git a/cui/uiconfig/ui/distributiondialog.ui b/cui/uiconfig/ui/distributiondialog.ui
index cb69ff86ebfc..03f848b981ed 100644
--- a/cui/uiconfig/ui/distributiondialog.ui
+++ b/cui/uiconfig/ui/distributiondialog.ui
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!-- Generated with glade 3.18.3 -->
+<!-- Generated with glade 3.22.1 -->
<interface domain="cui">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="DistributionDialog">
@@ -7,7 +7,13 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="distributiondialog|DistributionDialog">Distribution</property>
<property name="resizable">False</property>
+ <property name="modal">True</property>
+ <property name="default_width">0</property>
+ <property name="default_height">0</property>
<property name="type_hint">dialog</property>
+ <child>
+ <placeholder/>
+ </child>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property>
diff --git a/include/svx/svdedtv.hxx b/include/svx/svdedtv.hxx
index 4e7f7e63eb56..63d74b4bc74a 100644
--- a/include/svx/svdedtv.hxx
+++ b/include/svx/svdedtv.hxx
@@ -255,7 +255,7 @@ public:
void MergeMarkedObjects(SdrMergeMode eMode);
// for distribution dialog function
- void DistributeMarkedObjects();
+ void DistributeMarkedObjects(weld::Window* pParent);
// for setting either the width or height of all selected
// objects to the width/height of the last selected object
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index fd36c0297688..061c30ffc9a7 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -342,7 +342,7 @@ public:
const SdrView* pView,
SvxAnchorIds nAnchorTypes = SvxAnchorIds::NONE) = 0;
- virtual VclPtr<AbstractSvxDistributeDialog> CreateSvxDistributeDialog(
+ virtual VclPtr<AbstractSvxDistributeDialog> CreateSvxDistributeDialog(weld::Window* pParent,
const SfxItemSet& rAttr)= 0;
virtual VclPtr<AbstractFmShowColsDialog> CreateFmShowColsDialog() = 0;
diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx
index 0a652766b5b1..411b8eb034b8 100644
--- a/reportdesign/source/ui/report/ReportController.cxx
+++ b/reportdesign/source/ui/report/ReportController.cxx
@@ -1039,7 +1039,7 @@ void OReportController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >
{
OSectionView* pSectionView = getCurrentSectionView();
if ( pSectionView )
- pSectionView->DistributeMarkedObjects();
+ pSectionView->DistributeMarkedObjects(getFrameWeld());
}
break;
case SID_OBJECT_SMALLESTWIDTH:
diff --git a/sd/source/ui/view/drviews2.cxx b/sd/source/ui/view/drviews2.cxx
index 25bed90aec1f..7a8433da90f0 100644
--- a/sd/source/ui/view/drviews2.cxx
+++ b/sd/source/ui/view/drviews2.cxx
@@ -2609,7 +2609,7 @@ void DrawViewShell::FuTemporary(SfxRequest& rReq)
}
else
{
- mpDrawView->DistributeMarkedObjects();
+ mpDrawView->DistributeMarkedObjects(GetFrameWeld());
}
Cancel();
rReq.Done ();
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index d6031358738a..1151fc460dcb 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -762,7 +762,7 @@ struct ImpDistributeEntry
typedef vector< ImpDistributeEntry*> ImpDistributeEntryList;
-void SdrEditView::DistributeMarkedObjects()
+void SdrEditView::DistributeMarkedObjects(weld::Window* pParent)
{
const size_t nMark(GetMarkedObjectCount());
@@ -771,7 +771,7 @@ void SdrEditView::DistributeMarkedObjects()
SfxItemSet aNewAttr(mpModel->GetItemPool());
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<AbstractSvxDistributeDialog> pDlg(pFact->CreateSvxDistributeDialog(aNewAttr));
+ ScopedVclPtr<AbstractSvxDistributeDialog> pDlg(pFact->CreateSvxDistributeDialog(pParent, aNewAttr));
sal_uInt16 nResult = pDlg->Execute();