From ecc6180d8158a6b4d998807bc78f78b9efcea677 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Sun, 7 Oct 2018 19:14:41 +0100 Subject: weld ORptPageDialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I96bd38046e527c76782504edd408df1aee490e37 Reviewed-on: https://gerrit.libreoffice.org/61498 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- reportdesign/source/ui/dlg/dlgpage.cxx | 14 +- reportdesign/source/ui/inc/dlgpage.hxx | 7 +- reportdesign/source/ui/misc/UITools.cxx | 8 +- reportdesign/source/ui/report/ReportController.cxx | 8 +- .../uiconfig/dbreport/ui/backgrounddialog.ui | 56 +++++-- reportdesign/uiconfig/dbreport/ui/chardialog.ui | 176 +++++++++++++++++++-- reportdesign/uiconfig/dbreport/ui/pagedialog.ui | 80 ++++++++-- 7 files changed, 290 insertions(+), 59 deletions(-) (limited to 'reportdesign') diff --git a/reportdesign/source/ui/dlg/dlgpage.cxx b/reportdesign/source/ui/dlg/dlgpage.cxx index fa2a38ff9da0..23ee7bd4f6f6 100644 --- a/reportdesign/source/ui/dlg/dlgpage.cxx +++ b/reportdesign/source/ui/dlg/dlgpage.cxx @@ -36,11 +36,9 @@ namespace rptui |* \************************************************************************/ -ORptPageDialog::ORptPageDialog( vcl::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog) - : SfxTabDialog (pParent, rDialog, "modules/dbreport/ui/" + - rDialog.toAsciiLowerCase() + - ".ui", pAttr) - , m_nCharBgdId(0) +ORptPageDialog::ORptPageDialog(weld::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog) + : SfxTabDialogController(pParent, "modules/dbreport/ui/" + + rDialog.toAsciiLowerCase() + ".ui", rDialog.toUtf8(), pAttr) { SfxAbstractDialogFactory* pFact = SfxAbstractDialogFactory::Create(); @@ -59,7 +57,7 @@ ORptPageDialog::ORptPageDialog( vcl::Window* pParent, const SfxItemSet* pAttr, c AddTabPage("fonteffects", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_EFFECTS ), nullptr ); AddTabPage("position", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_POSITION ), nullptr ); AddTabPage("asianlayout", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_CHAR_TWOLINES ), nullptr ); - m_nCharBgdId = AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr ); + AddTabPage("background", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_BACKGROUND ), nullptr ); AddTabPage("alignment", pFact->GetTabPageCreatorFunc( RID_SVXPAGE_ALIGNMENT ), nullptr ); } else @@ -70,10 +68,10 @@ ORptPageDialog::ORptPageDialog( vcl::Window* pParent, const SfxItemSet* pAttr, c RemoveTabPage("asianlayout"); } -void ORptPageDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) +void ORptPageDialog::PageCreated(const OString& rId, SfxTabPage &rPage) { SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); - if (nId == m_nCharBgdId) + if (rId == "background") { aSet.Put(SfxUInt32Item(SID_FLAG_TYPE,static_cast(SvxBackgroundTabFlags::SHOW_HIGHLIGHTING))); rPage.PageCreated(aSet); diff --git a/reportdesign/source/ui/inc/dlgpage.hxx b/reportdesign/source/ui/inc/dlgpage.hxx index 49d82cf32502..5bebf0958945 100644 --- a/reportdesign/source/ui/inc/dlgpage.hxx +++ b/reportdesign/source/ui/inc/dlgpage.hxx @@ -28,17 +28,16 @@ namespace rptui |* Page setup tab dialog |* \************************************************************************/ -class ORptPageDialog : public SfxTabDialog +class ORptPageDialog : public SfxTabDialogController { private: ORptPageDialog(const ORptPageDialog&) = delete; void operator =(const ORptPageDialog&) = delete; - sal_uInt16 m_nCharBgdId; public: - ORptPageDialog(vcl::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog); - virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) override; + ORptPageDialog(weld::Window* pParent, const SfxItemSet* pAttr, const OUString &rDialog); + virtual void PageCreated(const OString& rId, SfxTabPage &rPage) override; }; } // namespace rptui diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 8bbfd8820fb0..48b509663757 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -710,16 +710,16 @@ bool openCharDialog( const uno::Reference& _rxRep lcl_CharPropertiesToItems( _rxReportControlFormat, *pDescriptor ); { // want the dialog to be destroyed before our set - ScopedVclPtrInstance< ORptPageDialog > aDlg(pParent, pDescriptor.get(), "CharDialog"); + ORptPageDialog aDlg(Application::GetFrameWeld(_rxParentWindow), pDescriptor.get(), "CharDialog"); uno::Reference< report::XShape > xShape( _rxReportControlFormat, uno::UNO_QUERY ); if ( xShape.is() ) - aDlg->RemoveTabPage("background"); - bSuccess = ( RET_OK == aDlg->Execute() ); + aDlg.RemoveTabPage("background"); + bSuccess = aDlg.execute() == RET_OK; if ( bSuccess ) { lcl_itemsToCharProperties( lcl_getReportControlFont( _rxReportControlFormat,WESTERN ), lcl_getReportControlFont( _rxReportControlFormat,ASIAN ), - lcl_getReportControlFont( _rxReportControlFormat,COMPLEX ), *aDlg->GetOutputItemSet(), _out_rNewValues ); + lcl_getReportControlFont( _rxReportControlFormat,COMPLEX ), *aDlg.GetOutputItemSet(), _out_rNewValues ); } } } diff --git a/reportdesign/source/ui/report/ReportController.cxx b/reportdesign/source/ui/report/ReportController.cxx index c0288eb92de6..7bc4c6a4f4d1 100644 --- a/reportdesign/source/ui/report/ReportController.cxx +++ b/reportdesign/source/ui/report/ReportController.cxx @@ -2422,16 +2422,16 @@ void OReportController::openPageDialog(const uno::Reference& _ } { // want the dialog to be destroyed before our set - ScopedVclPtrInstance aDlg( - getView(), pDescriptor.get(),_xSection.is() + ORptPageDialog aDlg( + getFrameWeld(), pDescriptor.get(),_xSection.is() ? OUString("BackgroundDialog") : OUString("PageDialog")); - if (RET_OK == aDlg->Execute()) + if (aDlg.execute() == RET_OK) { // ItemSet->UNO // UNO-properties - const SfxItemSet* pSet = aDlg->GetOutputItemSet(); + const SfxItemSet* pSet = aDlg.GetOutputItemSet(); if ( _xSection.is() ) { const SfxPoolItem* pItem; diff --git a/reportdesign/uiconfig/dbreport/ui/backgrounddialog.ui b/reportdesign/uiconfig/dbreport/ui/backgrounddialog.ui index 47852d4e0de8..276934de6e86 100644 --- a/reportdesign/uiconfig/dbreport/ui/backgrounddialog.ui +++ b/reportdesign/uiconfig/dbreport/ui/backgrounddialog.ui @@ -1,12 +1,18 @@ - + False 6 Section Setup + True + 0 + 0 dialog + + + False @@ -17,12 +23,10 @@ False end - - gtk-ok + + gtk-revert-to-saved True True - True - True True True @@ -33,10 +37,12 @@ - - gtk-cancel + + gtk-ok True True + True + True True True @@ -47,8 +53,8 @@ - - gtk-help + + gtk-cancel True True True @@ -58,12 +64,11 @@ False True 2 - True - - gtk-revert-to-saved + + gtk-help True True True @@ -73,6 +78,7 @@ False True 3 + True @@ -98,6 +104,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -121,10 +151,10 @@ + reset ok cancel help - reset diff --git a/reportdesign/uiconfig/dbreport/ui/chardialog.ui b/reportdesign/uiconfig/dbreport/ui/chardialog.ui index 8507501a3ada..ed038d5cfd73 100644 --- a/reportdesign/uiconfig/dbreport/ui/chardialog.ui +++ b/reportdesign/uiconfig/dbreport/ui/chardialog.ui @@ -1,12 +1,18 @@ - + False 6 Character Settings + True + 0 + 0 dialog + + + False @@ -17,12 +23,10 @@ False end - - gtk-ok + + gtk-revert-to-saved True True - True - True True True @@ -33,10 +37,12 @@ - - gtk-cancel + + gtk-ok True True + True + True True True @@ -47,8 +53,8 @@ - - gtk-help + + gtk-cancel True True True @@ -58,12 +64,11 @@ False True 2 - True - - gtk-revert-to-saved + + gtk-help True True True @@ -73,6 +78,7 @@ False True 3 + True @@ -98,6 +104,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -117,6 +147,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 1 @@ -140,6 +194,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 2 @@ -163,6 +241,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 3 @@ -186,6 +288,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 4 @@ -209,6 +335,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 5 @@ -235,10 +385,10 @@ + reset ok cancel help - reset diff --git a/reportdesign/uiconfig/dbreport/ui/pagedialog.ui b/reportdesign/uiconfig/dbreport/ui/pagedialog.ui index 4dfbf0081170..9aaf3c5ff94a 100644 --- a/reportdesign/uiconfig/dbreport/ui/pagedialog.ui +++ b/reportdesign/uiconfig/dbreport/ui/pagedialog.ui @@ -1,12 +1,18 @@ - + False 6 Page Setup + True + 0 + 0 dialog + + + False @@ -17,12 +23,10 @@ False end - - gtk-ok + + gtk-revert-to-saved True True - True - True True True @@ -33,10 +37,12 @@ - - gtk-cancel + + gtk-ok True True + True + True True True @@ -47,8 +53,8 @@ - - gtk-help + + gtk-cancel True True True @@ -58,12 +64,11 @@ False True 2 - True - - gtk-revert-to-saved + + gtk-help True True True @@ -73,6 +78,7 @@ False True 3 + True @@ -98,6 +104,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + @@ -117,6 +147,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + 1 @@ -144,10 +198,10 @@ + reset ok cancel help - reset -- cgit