From 80761fd7cd574a2d71b5b0aeead5d6920db56707 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Caol=C3=A1n=20McNamara?= Date: Mon, 17 Sep 2018 12:43:17 +0100 Subject: [PATCH] weld ShapeParagraphDialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I8c3b3c0f6c0cfe133e1ec8eda8c10bbbaee5f010 Reviewed-on: https://gerrit.libreoffice.org/60584 Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- .../controller/dialogs/dlg_ShapeParagraph.cxx | 12 +- .../controller/inc/dlg_ShapeParagraph.hxx | 7 +- .../controller/main/ShapeController.cxx | 6 +- chart2/uiconfig/ui/paradialog.ui | 140 +++++++++++++++--- 4 files changed, 131 insertions(+), 34 deletions(-) diff --git a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx index 76a665775741..b203e13b3d7c 100644 --- a/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx +++ b/chart2/source/controller/dialogs/dlg_ShapeParagraph.cxx @@ -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 ) | diff --git a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx index d47d7098c729..14fbf5f0cc8c 100644 --- a/chart2/source/controller/inc/dlg_ShapeParagraph.hxx +++ b/chart2/source/controller/inc/dlg_ShapeParagraph.hxx @@ -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 diff --git a/chart2/source/controller/main/ShapeController.cxx b/chart2/source/controller/main/ShapeController.cxx index 04683e058481..1c082d84505b 100644 --- a/chart2/source/controller/main/ShapeController.cxx +++ b/chart2/source/controller/main/ShapeController.cxx @@ -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 ); } } diff --git a/chart2/uiconfig/ui/paradialog.ui b/chart2/uiconfig/ui/paradialog.ui index f32fc5fa68d6..5e89c680dd44 100644 --- a/chart2/uiconfig/ui/paradialog.ui +++ b/chart2/uiconfig/ui/paradialog.ui @@ -1,5 +1,5 @@ - + @@ -7,6 +7,9 @@ 6 Paragraph dialog + + + False @@ -16,6 +19,20 @@ False end + + + gtk-revert-to-saved + True + True + True + True + + + False + True + 0 + + gtk-ok @@ -29,7 +46,7 @@ False True - 0 + 1 @@ -43,7 +60,7 @@ False True - 1 + 2 @@ -54,25 +71,11 @@ True True - - False - True - 2 - True - - - - - gtk-revert-to-saved - True - True - True - True - False True 3 + True @@ -86,9 +89,10 @@ True - False + True True True + True True @@ -96,6 +100,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -115,6 +143,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 1 @@ -139,6 +191,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 2 @@ -162,6 +238,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 3 @@ -188,10 +288,10 @@ + reset ok cancel help - reset