Kaydet (Commit) 916260dc authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SwTableTabDlg

Change-Id: I343ddfd5ba1e42711b74815517ab931e0905dd07
Reviewed-on: https://gerrit.libreoffice.org/60243
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 0e8d0c72
...@@ -417,7 +417,7 @@ public: ...@@ -417,7 +417,7 @@ public:
virtual VclPtr<SfxAbstractDialog> CreateSwWrapDlg ( vcl::Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh ) = 0; virtual VclPtr<SfxAbstractDialog> CreateSwWrapDlg ( vcl::Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh ) = 0;
virtual VclPtr<VclAbstractDialog> CreateSwTableWidthDlg(weld::Window *pParent, SwTableFUNC &rFnc) = 0; virtual VclPtr<VclAbstractDialog> CreateSwTableWidthDlg(weld::Window *pParent, SwTableFUNC &rFnc) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateSwTableTabDlg(vcl::Window* pParent, virtual VclPtr<SfxAbstractTabDialog> CreateSwTableTabDlg(weld::Window* pParent,
const SfxItemSet* pItemSet, SwWrtShell* pSh) = 0; const SfxItemSet* pItemSet, SwWrtShell* pSh) = 0;
virtual VclPtr<AbstractSwFieldDlg> CreateSwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pParent) = 0; virtual VclPtr<AbstractSwFieldDlg> CreateSwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pParent) = 0;
......
...@@ -653,7 +653,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, DblClickHdl, ListBox&, rBox, void ) ...@@ -653,7 +653,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, DblClickHdl, ListBox&, rBox, void )
TableToFromHdl( pButton ); TableToFromHdl( pButton );
} }
IMPL_LINK( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void ) IMPL_LINK_NOARG(SwInsertDBColAutoPilot, TableFormatHdl, Button*, void)
{ {
SwWrtShell& rSh = pView->GetWrtShell(); SwWrtShell& rSh = pView->GetWrtShell();
bool bNewSet = false; bool bNewSet = false;
...@@ -761,7 +761,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void ) ...@@ -761,7 +761,7 @@ IMPL_LINK( SwInsertDBColAutoPilot, TableFormatHdl, Button*, pButton, void )
SwAbstractDialogFactory* pFact = swui::GetFactory(); SwAbstractDialogFactory* pFact = swui::GetFactory();
OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!"); OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTableTabDlg(pButton, pTableSet.get(), &rSh)); ScopedVclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTableTabDlg(GetFrameWeld(), pTableSet.get(), &rSh));
if( RET_OK == pDlg->Execute() ) if( RET_OK == pDlg->Execute() )
pTableSet->Put( *pDlg->GetOutputItemSet() ); pTableSet->Put( *pDlg->GetOutputItemSet() );
else if( bNewSet ) else if( bNewSet )
......
...@@ -892,11 +892,10 @@ VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg(we ...@@ -892,11 +892,10 @@ VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateSwTableWidthDlg(we
return VclPtr<AbstractSwTableWidthDlg_Impl>::Create(o3tl::make_unique<SwTableWidthDlg>(pParent, rFnc)); return VclPtr<AbstractSwTableWidthDlg_Impl>::Create(o3tl::make_unique<SwTableWidthDlg>(pParent, rFnc));
} }
VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateSwTableTabDlg(vcl::Window* pParent, VclPtr<SfxAbstractTabDialog> SwAbstractDialogFactory_Impl::CreateSwTableTabDlg(weld::Window* pParent,
const SfxItemSet* pItemSet, SwWrtShell* pSh) const SfxItemSet* pItemSet, SwWrtShell* pSh)
{ {
VclPtr<SfxTabDialog> pDlg = VclPtr<SwTableTabDlg>::Create(pParent, pItemSet, pSh); return VclPtr<AbstractTabController_Impl>::Create(o3tl::make_unique<SwTableTabDlg>(pParent, pItemSet, pSh));
return VclPtr<AbstractTabDialog_Impl>::Create(pDlg);
} }
VclPtr<AbstractSwFieldDlg> SwAbstractDialogFactory_Impl::CreateSwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pParent) VclPtr<AbstractSwFieldDlg> SwAbstractDialogFactory_Impl::CreateSwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pParent)
......
...@@ -608,7 +608,7 @@ public: ...@@ -608,7 +608,7 @@ public:
virtual VclPtr<SfxAbstractDialog> CreateSwWrapDlg ( vcl::Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh ) override; virtual VclPtr<SfxAbstractDialog> CreateSwWrapDlg ( vcl::Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh ) override;
virtual VclPtr<VclAbstractDialog> CreateSwTableWidthDlg(weld::Window *pParent, SwTableFUNC &rFnc) override; virtual VclPtr<VclAbstractDialog> CreateSwTableWidthDlg(weld::Window *pParent, SwTableFUNC &rFnc) override;
virtual VclPtr<SfxAbstractTabDialog> CreateSwTableTabDlg(vcl::Window* pParent, virtual VclPtr<SfxAbstractTabDialog> CreateSwTableTabDlg(weld::Window* pParent,
const SfxItemSet* pItemSet, SwWrtShell* pSh) override; const SfxItemSet* pItemSet, SwWrtShell* pSh) override;
virtual VclPtr<AbstractSwFieldDlg> CreateSwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pParent) override; virtual VclPtr<AbstractSwFieldDlg> CreateSwFieldDlg(SfxBindings* pB, SwChildWinWrapper* pCW, vcl::Window *pParent) override;
virtual VclPtr<SfxAbstractDialog> CreateSwFieldEditDlg ( SwView& rVw ) override; virtual VclPtr<SfxAbstractDialog> CreateSwFieldEditDlg ( SwView& rVw ) override;
......
...@@ -1150,35 +1150,33 @@ void SwTableColumnPage::SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth) ...@@ -1150,35 +1150,33 @@ void SwTableColumnPage::SetVisibleWidth(sal_uInt16 nPos, SwTwips nNewWidth)
} }
SwTableTabDlg::SwTableTabDlg(vcl::Window* pParent, SwTableTabDlg::SwTableTabDlg(weld::Window* pParent, const SfxItemSet* pItemSet, SwWrtShell* pSh)
const SfxItemSet* pItemSet, SwWrtShell* pSh) : SfxTabDialogController(pParent, "modules/swriter/ui/tableproperties.ui", "TablePropertiesDialog", pItemSet)
: SfxTabDialog(pParent, "TablePropertiesDialog",
"modules/swriter/ui/tableproperties.ui", pItemSet)
, pShell(pSh) , pShell(pSh)
{ {
SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create();
AddTabPage("table", &SwFormatTablePage::Create, nullptr); AddTabPage("table", &SwFormatTablePage::Create, nullptr);
m_nTextFlowId = AddTabPage("textflow", &SwTextFlowPage::Create, nullptr); AddTabPage("textflow", &SwTextFlowPage::Create, nullptr);
AddTabPage("columns", &SwTableColumnPage::Create, nullptr); AddTabPage("columns", &SwTableColumnPage::Create, nullptr);
m_nBackgroundId = AddTabPage("background", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_BKG), nullptr); AddTabPage("background", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_BKG), nullptr);
m_nBorderId = AddTabPage("borders", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_BORDER), nullptr); AddTabPage("borders", pFact->GetTabPageCreatorFunc(RID_SVXPAGE_BORDER), nullptr);
} }
void SwTableTabDlg::PageCreated(sal_uInt16 nId, SfxTabPage& rPage) void SwTableTabDlg::PageCreated(const OString& rId, SfxTabPage& rPage)
{ {
SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
if (nId == m_nBackgroundId) if (rId == "background")
{ {
SvxBackgroundTabFlags const nFlagType = SvxBackgroundTabFlags::SHOW_TBLCTL; SvxBackgroundTabFlags const nFlagType = SvxBackgroundTabFlags::SHOW_TBLCTL;
aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, static_cast<sal_uInt32>(nFlagType))); aSet.Put (SfxUInt32Item(SID_FLAG_TYPE, static_cast<sal_uInt32>(nFlagType)));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nBorderId) else if (rId == "borders")
{ {
aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE, static_cast<sal_uInt16>(SwBorderModes::TABLE))); aSet.Put (SfxUInt16Item(SID_SWMODE_TYPE, static_cast<sal_uInt16>(SwBorderModes::TABLE)));
rPage.PageCreated(aSet); rPage.PageCreated(aSet);
} }
else if (nId == m_nTextFlowId) else if (rId == "textflow")
{ {
static_cast<SwTextFlowPage&>(rPage).SetShell(pShell); static_cast<SwTextFlowPage&>(rPage).SetShell(pShell);
const FrameTypeFlags eType = pShell->GetFrameType(nullptr,true); const FrameTypeFlags eType = pShell->GetFrameType(nullptr,true);
......
...@@ -28,17 +28,13 @@ class SwWrtShell; ...@@ -28,17 +28,13 @@ class SwWrtShell;
struct TColumn; struct TColumn;
// table dialog // table dialog
class SwTableTabDlg : public SfxTabDialog class SwTableTabDlg : public SfxTabDialogController
{ {
SwWrtShell* pShell; SwWrtShell* pShell;
sal_uInt16 m_nTextFlowId;
sal_uInt16 m_nBackgroundId;
sal_uInt16 m_nBorderId;
virtual void PageCreated(sal_uInt16 nId, SfxTabPage& rPage) override; virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override;
public: public:
SwTableTabDlg( vcl::Window* pParent, SwTableTabDlg(weld::Window* pParent, const SfxItemSet* pItemSet, SwWrtShell* pSh);
const SfxItemSet* pItemSet, SwWrtShell* pSh );
}; };
#endif #endif
......
...@@ -593,7 +593,7 @@ void SwTableShell::Execute(SfxRequest &rReq) ...@@ -593,7 +593,7 @@ void SwTableShell::Execute(SfxRequest &rReq)
setSvxBrushItemAsFillAttributesToTargetSet(aBrush, aCoreSet); setSvxBrushItemAsFillAttributesToTargetSet(aBrush, aCoreSet);
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTableTabDlg(GetView().GetWindow(), &aCoreSet, &rSh)); VclPtr<SfxAbstractTabDialog> pDlg(pFact->CreateSwTableTabDlg(GetView().GetFrameWeld(), &aCoreSet, &rSh));
if (pDlg) if (pDlg)
{ {
...@@ -619,6 +619,8 @@ void SwTableShell::Execute(SfxRequest &rReq) ...@@ -619,6 +619,8 @@ void SwTableShell::Execute(SfxRequest &rReq)
rBindings.Update(SID_ATTR_TABSTOP); rBindings.Update(SID_ATTR_TABSTOP);
rBindings.Update(SID_RULER_BORDERS_VERTICAL); rBindings.Update(SID_RULER_BORDERS_VERTICAL);
rBindings.Update(SID_ATTR_TABSTOP_VERTICAL); rBindings.Update(SID_ATTR_TABSTOP_VERTICAL);
pDlg->disposeOnce();
}); });
} }
else else
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.18.3 --> <!-- Generated with glade 3.22.1 -->
<interface domain="sw"> <interface domain="sw">
<requires lib="gtk+" version="3.18"/> <requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="TablePropertiesDialog"> <object class="GtkDialog" id="TablePropertiesDialog">
...@@ -8,6 +8,9 @@ ...@@ -8,6 +8,9 @@
<property name="title" translatable="yes" context="tableproperties|TablePropertiesDialog">Table Properties</property> <property name="title" translatable="yes" context="tableproperties|TablePropertiesDialog">Table Properties</property>
<property name="resizable">False</property> <property name="resizable">False</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<child>
<placeholder/>
</child>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
...@@ -18,12 +21,10 @@ ...@@ -18,12 +21,10 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="layout_style">end</property> <property name="layout_style">end</property>
<child> <child>
<object class="GtkButton" id="ok"> <object class="GtkButton" id="reset">
<property name="label">gtk-ok</property> <property name="label">gtk-revert-to-saved</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
...@@ -34,10 +35,12 @@ ...@@ -34,10 +35,12 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="cancel"> <object class="GtkButton" id="ok">
<property name="label">gtk-cancel</property> <property name="label">gtk-ok</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
<property name="use_stock">True</property> <property name="use_stock">True</property>
</object> </object>
...@@ -48,8 +51,8 @@ ...@@ -48,8 +51,8 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="help"> <object class="GtkButton" id="cancel">
<property name="label">gtk-help</property> <property name="label">gtk-cancel</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
...@@ -59,12 +62,11 @@ ...@@ -59,12 +62,11 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property> <property name="position">2</property>
<property name="secondary">True</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="reset"> <object class="GtkButton" id="help">
<property name="label">gtk-revert-to-saved</property> <property name="label">gtk-help</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">True</property> <property name="receives_default">True</property>
...@@ -74,6 +76,7 @@ ...@@ -74,6 +76,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">3</property> <property name="position">3</property>
<property name="secondary">True</property>
</packing> </packing>
</child> </child>
</object> </object>
...@@ -97,6 +100,30 @@ ...@@ -97,6 +100,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object> </object>
</child> </child>
<child type="tab"> <child type="tab">
...@@ -116,6 +143,30 @@ ...@@ -116,6 +143,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="position">1</property> <property name="position">1</property>
...@@ -139,6 +190,30 @@ ...@@ -139,6 +190,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="position">2</property> <property name="position">2</property>
...@@ -162,6 +237,30 @@ ...@@ -162,6 +237,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="position">3</property> <property name="position">3</property>
...@@ -185,6 +284,30 @@ ...@@ -185,6 +284,30 @@
<child> <child>
<placeholder/> <placeholder/>
</child> </child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
<child>
<placeholder/>
</child>
</object> </object>
<packing> <packing>
<property name="position">4</property> <property name="position">4</property>
...@@ -211,10 +334,10 @@ ...@@ -211,10 +334,10 @@
</object> </object>
</child> </child>
<action-widgets> <action-widgets>
<action-widget response="0">reset</action-widget>
<action-widget response="-5">ok</action-widget> <action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget> <action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget> <action-widget response="-11">help</action-widget>
<action-widget response="0">reset</action-widget>
</action-widgets> </action-widgets>
</object> </object>
</interface> </interface>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment