weld ShapeParagraphDialog

Change-Id: I8c3b3c0f6c0cfe133e1ec8eda8c10bbbaee5f010
Reviewed-on: https://gerrit.libreoffice.org/60584
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
This commit is contained in:
Caolán McNamara
2018-09-19 11:41:18 +02:00
parent 3c24038f0e
commit 80761fd7cd
4 changed files with 131 additions and 34 deletions
@@ -30,11 +30,9 @@ using namespace ::com::sun::star;
namespace chart
{
ShapeParagraphDialog::ShapeParagraphDialog(vcl::Window* pParent,
ShapeParagraphDialog::ShapeParagraphDialog(weld::Window* pParent,
const SfxItemSet* pAttr)
: SfxTabDialog(pParent, "ParagraphDialog",
"modules/schart/ui/paradialog.ui", pAttr)
, m_nTabPageId(0)
: SfxTabDialogController(pParent, "modules/schart/ui/paradialog.ui", "ParagraphDialog", pAttr)
{
SvtCJKOptions aCJKOptions;
@@ -48,12 +46,12 @@ ShapeParagraphDialog::ShapeParagraphDialog(vcl::Window* pParent,
{
RemoveTabPage("labelTP_PARA_ASIAN");
}
m_nTabPageId = AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR);
AddTabPage("labelTP_TABULATOR", RID_SVXPAGE_TABULATOR);
}
void ShapeParagraphDialog::PageCreated( sal_uInt16 nId, SfxTabPage& rPage )
void ShapeParagraphDialog::PageCreated(const OString& rId, SfxTabPage& rPage)
{
if (nId == m_nTabPageId)
if (rId == "labelTP_TABULATOR")
{
SfxAllItemSet aSet( *( GetInputSetImpl()->GetPool() ) );
TabulatorDisableFlags const nFlags(( TabulatorDisableFlags::TypeMask &~TabulatorDisableFlags::TypeLeft ) |
@@ -26,13 +26,12 @@ namespace chart
/** dialog for paragraph properties of shapes
*/
class ShapeParagraphDialog : public SfxTabDialog
class ShapeParagraphDialog : public SfxTabDialogController
{
public:
ShapeParagraphDialog(vcl::Window* pParent, const SfxItemSet* pAttr);
ShapeParagraphDialog(weld::Window* pParent, const SfxItemSet* pAttr);
private:
virtual void PageCreated(sal_uInt16 nId, SfxTabPage& rPage) override;
sal_uInt16 m_nTabPageId;
virtual void PageCreated(const OString& rId, SfxTabPage& rPage) override;
};
} // namespace chart
@@ -547,10 +547,10 @@ void ShapeController::executeDispatch_ParagraphDialog()
aNewAttr.Put( SvxWidowsItem( 0, SID_ATTR_PARA_WIDOWS) );
aNewAttr.Put( SvxOrphansItem( 0, SID_ATTR_PARA_ORPHANS) );
ScopedVclPtrInstance< ShapeParagraphDialog > pDlg( pChartWindow, &aNewAttr );
if ( pDlg->Execute() == RET_OK )
ShapeParagraphDialog aDlg(pChartWindow->GetFrameWeld(), &aNewAttr);
if (aDlg.execute() == RET_OK)
{
const SfxItemSet* pOutAttr = pDlg->GetOutputItemSet();
const SfxItemSet* pOutAttr = aDlg.GetOutputItemSet();
pDrawViewWrapper->SetAttributes( *pOutAttr );
}
}
+120 -20
View File
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<!-- Generated with glade 3.22.1 -->
<interface domain="chart">
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="ParagraphDialog">
@@ -7,6 +7,9 @@
<property name="border_width">6</property>
<property name="title" translatable="yes" context="paradialog|ParagraphDialog">Paragraph</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>
@@ -16,6 +19,20 @@
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="can_focus">False</property>
<property name="layout_style">end</property>
<child>
<object class="GtkButton" id="reset">
<property name="label">gtk-revert-to-saved</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="ok">
<property name="label">gtk-ok</property>
@@ -29,7 +46,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
<property name="position">1</property>
</packing>
</child>
<child>
@@ -43,7 +60,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
<property name="position">2</property>
</packing>
</child>
<child>
@@ -54,25 +71,11 @@
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>
</child>
<child>
<object class="GtkButton" id="reset">
<property name="label">gtk-revert-to-saved</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_stock">True</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
@@ -86,9 +89,10 @@
<child>
<object class="GtkNotebook" id="tabcontrol">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="scrollable">True</property>
<child>
<object class="GtkGrid">
<property name="visible">True</property>
@@ -96,6 +100,30 @@
<child>
<placeholder/>
</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>
</child>
<child type="tab">
@@ -115,6 +143,30 @@
<child>
<placeholder/>
</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>
<packing>
<property name="position">1</property>
@@ -139,6 +191,30 @@
<child>
<placeholder/>
</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>
<packing>
<property name="position">2</property>
@@ -162,6 +238,30 @@
<child>
<placeholder/>
</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>
<packing>
<property name="position">3</property>
@@ -188,10 +288,10 @@
</object>
</child>
<action-widgets>
<action-widget response="0">reset</action-widget>
<action-widget response="-5">ok</action-widget>
<action-widget response="-6">cancel</action-widget>
<action-widget response="-11">help</action-widget>
<action-widget response="0">reset</action-widget>
</action-widgets>
</object>
</interface>