diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-03-08 09:49:36 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-03-09 13:47:52 +0100 |
commit | 48bca65f1cf381cba7cb7a4c3916155a1bca0955 (patch) | |
tree | df461652450b3e095e37a3290cbe54ab20cedfae /sw | |
parent | c468b6910bf77e332647725da70e3cb248a9de0e (diff) |
inherit welded dialogs from a common ancestor
Change-Id: Ifa6c871a134cf89bfba71b1049a115cf7c953c42
Reviewed-on: https://gerrit.libreoffice.org/50936
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/chrdlg/break.cxx | 24 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/dialog/uiregionsw.cxx | 6 | ||||
-rw-r--r-- | sw/source/ui/table/convert.cxx | 4 | ||||
-rw-r--r-- | sw/source/ui/table/splittbl.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/table/tautofmt.cxx | 16 | ||||
-rw-r--r-- | sw/source/uibase/dbui/mailmergehelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/uibase/inc/break.hxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/inc/convert.hxx | 7 | ||||
-rw-r--r-- | sw/source/uibase/inc/splittbl.hxx | 6 | ||||
-rw-r--r-- | sw/source/uibase/inc/tautofmt.hxx | 8 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 4 |
12 files changed, 38 insertions, 56 deletions
diff --git a/sw/source/ui/chrdlg/break.cxx b/sw/source/ui/chrdlg/break.cxx index 68f2e3241474..038284e6a11c 100644 --- a/sw/source/ui/chrdlg/break.cxx +++ b/sw/source/ui/chrdlg/break.cxx @@ -36,7 +36,7 @@ #include <strings.hrc> #include <SwStyleNameMapper.hxx> -short SwBreakDlg::run() +short SwBreakDlg::execute() { short nRet = m_xDialog->run(); if (nRet == RET_OK) @@ -131,21 +131,19 @@ IMPL_LINK_NOARG(SwBreakDlg, OkHdl, weld::Button&, void) } SwBreakDlg::SwBreakDlg(weld::Window *pParent, SwWrtShell &rS) - : rSh(rS) - , m_xBuilder(Application::CreateBuilder(pParent, "modules/swriter/ui/insertbreak.ui")) + : GenericDialogController(pParent, "modules/swriter/ui/insertbreak.ui", "BreakDialog") + , m_xLineBtn(m_xBuilder->weld_radio_button("linerb")) + , m_xColumnBtn(m_xBuilder->weld_radio_button("columnrb")) + , m_xPageBtn(m_xBuilder->weld_radio_button("pagerb")) + , m_xPageCollText(m_xBuilder->weld_label("styleft")) + , m_xPageCollBox(m_xBuilder->weld_combo_box_text("stylelb")) + , m_xPageNumBox(m_xBuilder->weld_check_button("pagenumcb")) + , m_xPageNumEdit(m_xBuilder->weld_spin_button("pagenumsb")) + , m_xOkBtn(m_xBuilder->weld_button("ok")) + , rSh(rS) , nKind(0) , bHtmlMode(0 != ::GetHtmlMode(rS.GetView().GetDocShell())) { - m_xDialog.reset(m_xBuilder->weld_dialog("BreakDialog")); - m_xLineBtn.reset(m_xBuilder->weld_radio_button("linerb")); - m_xColumnBtn.reset(m_xBuilder->weld_radio_button("columnrb")); - m_xPageBtn.reset(m_xBuilder->weld_radio_button("pagerb")); - m_xPageCollBox.reset(m_xBuilder->weld_combo_box_text("stylelb")); - m_xPageNumBox.reset(m_xBuilder->weld_check_button("pagenumcb")); - m_xPageNumEdit.reset(m_xBuilder->weld_spin_button("pagenumsb")); - m_xPageCollText.reset(m_xBuilder->weld_label("styleft")); - m_xOkBtn.reset(m_xBuilder->weld_button("ok")); - Link<weld::ToggleButton&,void> aLk = LINK(this, SwBreakDlg, ToggleHdl); m_xPageBtn->connect_toggled(aLk); m_xLineBtn->connect_toggled(aLk); diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index 96a4acb469c5..c283f4fec404 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -94,11 +94,11 @@ IMPL_ABSTDLG_BASE(AbstractSwAsciiFilterDlg_Impl); IMPL_ABSTDLG_BASE(VclAbstractDialog_Impl); short AbstractSplitTableDialog_Impl::Execute() { - return m_xDlg->run(); + return m_xDlg->execute(); } short AbstractSwBreakDlg_Impl::Execute() { - return m_xDlg->run(); + return m_xDlg->execute(); } IMPL_ABSTDLG_BASE(AbstractTabDialog_Impl); short AbstractSwConvertTableDlg_Impl::Execute() @@ -111,7 +111,7 @@ IMPL_ABSTDLG_BASE(AbstractSwLabDlg_Impl); IMPL_ABSTDLG_BASE(AbstractSwSelGlossaryDlg_Impl); short AbstractSwAutoFormatDlg_Impl::Execute() { - return m_xDlg->run(); + return m_xDlg->execute(); } IMPL_ABSTDLG_BASE(AbstractSwFieldDlg_Impl); IMPL_ABSTDLG_BASE(AbstractSwRenameXNamedDlg_Impl); diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx index b513bbcffa2b..64988bc9ca17 100644 --- a/sw/source/ui/dialog/uiregionsw.cxx +++ b/sw/source/ui/dialog/uiregionsw.cxx @@ -409,7 +409,7 @@ bool SwEditRegionDlg::CheckPasswd(CheckBox* pBox) { SfxPasswordDialog aPasswdDlg(GetFrameWeld()); bRet = false; - if (aPasswdDlg.run()) + if (aPasswdDlg.execute()) { const OUString sNewPasswd(aPasswdDlg.GetPassword()); css::uno::Sequence <sal_Int8 > aNewPasswd; @@ -1262,7 +1262,7 @@ IMPL_LINK( SwEditRegionDlg, ChangePasswdHdl, Button *, pBox, void ) { SfxPasswordDialog aPasswdDlg(GetFrameWeld()); aPasswdDlg.ShowExtras(SfxShowExtras::CONFIRM); - if (RET_OK == aPasswdDlg.run()) + if (RET_OK == aPasswdDlg.execute()) { const OUString sNewPasswd(aPasswdDlg.GetPassword()); if (aPasswdDlg.GetConfirm() == sNewPasswd) @@ -1702,7 +1702,7 @@ IMPL_LINK( SwInsertSectionTabPage, ChangePasswdHdl, Button *, pButton, void ) { SfxPasswordDialog aPasswdDlg(GetFrameWeld()); aPasswdDlg.ShowExtras(SfxShowExtras::CONFIRM); - if(RET_OK == aPasswdDlg.run()) + if (RET_OK == aPasswdDlg.execute()) { const OUString sNewPasswd(aPasswdDlg.GetPassword()); if (aPasswdDlg.GetConfirm() == sNewPasswd) diff --git a/sw/source/ui/table/convert.cxx b/sw/source/ui/table/convert.cxx index f6df42e9c9bd..f33d262bba41 100644 --- a/sw/source/ui/table/convert.cxx +++ b/sw/source/ui/table/convert.cxx @@ -94,8 +94,8 @@ void SwConvertTableDlg::GetValues( sal_Unicode& rDelim, } SwConvertTableDlg::SwConvertTableDlg(SwView& rView, bool bToTable) - : m_xBuilder(Application::CreateBuilder(rView.GetViewFrame()->GetWindow().GetFrameWeld(), "modules/swriter/ui/converttexttable.ui")) - , m_xDialog(m_xBuilder->weld_dialog("ConvertTextTableDialog")) + : GenericDialogController(rView.GetViewFrame()->GetWindow().GetFrameWeld(), + "modules/swriter/ui/converttexttable.ui", "ConvertTextTableDialog") , m_xTabBtn(m_xBuilder->weld_radio_button("tabs")) , m_xSemiBtn(m_xBuilder->weld_radio_button("semicolons")) , m_xParaBtn(m_xBuilder->weld_radio_button("paragraph")) diff --git a/sw/source/ui/table/splittbl.cxx b/sw/source/ui/table/splittbl.cxx index f78041b06cfa..e322bd8462a0 100644 --- a/sw/source/ui/table/splittbl.cxx +++ b/sw/source/ui/table/splittbl.cxx @@ -22,8 +22,7 @@ #include <tblenum.hxx> SwSplitTableDlg::SwSplitTableDlg(weld::Window *pParent, SwWrtShell &rSh) - : m_xBuilder(Application::CreateBuilder(pParent, "modules/swriter/ui/splittable.ui")) - , m_xDialog(m_xBuilder->weld_dialog("SplitTableDialog")) + : GenericDialogController(pParent, "modules/swriter/ui/splittable.ui", "SplitTableDialog") , m_xContentCopyRB(m_xBuilder->weld_radio_button("copyheading")) , m_xBoxAttrCopyWithParaRB(m_xBuilder->weld_radio_button("customheadingapplystyle")) , m_xBoxAttrCopyNoParaRB(m_xBuilder->weld_radio_button("customheading")) diff --git a/sw/source/ui/table/tautofmt.cxx b/sw/source/ui/table/tautofmt.cxx index fcbae6f6d46c..5adc8ca51fcd 100644 --- a/sw/source/ui/table/tautofmt.cxx +++ b/sw/source/ui/table/tautofmt.cxx @@ -24,19 +24,17 @@ #include <shellres.hxx> #include <tautofmt.hxx> -class SwStringInputDlg +class SwStringInputDlg : public weld::GenericDialogController { private: - std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Dialog> m_xDialog; std::unique_ptr<weld::Label> m_xLabel; std::unique_ptr<weld::Entry> m_xEdInput; // Edit obtains the focus. public: SwStringInputDlg(weld::Window* pParent, const OUString& rTitle, const OUString& rEditTitle, const OUString& rDefault) - : m_xBuilder(Application::CreateBuilder(pParent, "modules/swriter/ui/stringinput.ui")) - , m_xDialog(m_xBuilder->weld_dialog("StringInputDialog")) + : GenericDialogController(pParent, "modules/swriter/ui/stringinput.ui", + "StringInputDialog") , m_xLabel(m_xBuilder->weld_label("name")) , m_xEdInput(m_xBuilder->weld_entry("edit")) { @@ -50,15 +48,13 @@ public: { return m_xEdInput->get_text(); } - - short run() { return m_xDialog->run(); } }; // AutoFormat-Dialogue: SwAutoFormatDlg::SwAutoFormatDlg(weld::Window* pParent, SwWrtShell* pWrtShell, bool bAutoFormat, const SwTableAutoFormat* pSelFormat) - : m_xBuilder(Application::CreateBuilder(pParent, "modules/swriter/ui/autoformattable.ui")) - , m_xDialog(m_xBuilder->weld_dialog("AutoFormatTableDialog")) + : GenericDialogController(pParent, "modules/swriter/ui/autoformattable.ui", + "AutoFormatTableDialog") , m_xLbFormat(m_xBuilder->weld_tree_view("formatlb")) , m_xBtnNumFormat(m_xBuilder->weld_check_button("numformatcb")) , m_xBtnBorder(m_xBuilder->weld_check_button("bordercb")) @@ -394,7 +390,7 @@ IMPL_LINK_NOARG(SwAutoFormatDlg, SelFormatHdl, weld::TreeView&, void) m_xBtnRename->set_sensitive(bBtnEnable); } -short SwAutoFormatDlg::run() +short SwAutoFormatDlg::execute() { short nRet = m_xDialog->run(); if (nRet == RET_OK && bSetAutoFormat) diff --git a/sw/source/uibase/dbui/mailmergehelper.cxx b/sw/source/uibase/dbui/mailmergehelper.cxx index 6125e58b2f77..aae8e1f553da 100644 --- a/sw/source/uibase/dbui/mailmergehelper.cxx +++ b/sw/source/uibase/dbui/mailmergehelper.cxx @@ -615,7 +615,7 @@ OUString SwAuthenticator::getPassword( ) { SfxPasswordDialog aPasswdDlg(m_pParentWindow->GetFrameWeld()); aPasswdDlg.SetMinLen(0); - if (RET_OK == aPasswdDlg.run()) + if (RET_OK == aPasswdDlg.execute()) m_aPassword = aPasswdDlg.GetPassword(); } return m_aPassword; diff --git a/sw/source/uibase/inc/break.hxx b/sw/source/uibase/inc/break.hxx index 4f39f55674b1..70af5ad61c51 100644 --- a/sw/source/uibase/inc/break.hxx +++ b/sw/source/uibase/inc/break.hxx @@ -29,11 +29,8 @@ class SwWrtShell; -class SwBreakDlg +class SwBreakDlg : public weld::GenericDialogController { - SwWrtShell &rSh; - std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Dialog> m_xDialog; std::unique_ptr<weld::RadioButton> m_xLineBtn; std::unique_ptr<weld::RadioButton> m_xColumnBtn; std::unique_ptr<weld::RadioButton> m_xPageBtn; @@ -43,6 +40,7 @@ class SwBreakDlg std::unique_ptr<weld::SpinButton> m_xPageNumEdit; std::unique_ptr<weld::Button> m_xOkBtn; + SwWrtShell &rSh; OUString m_aTemplate; sal_uInt16 nKind; ::boost::optional<sal_uInt16> oPgNum; @@ -59,7 +57,7 @@ class SwBreakDlg public: SwBreakDlg(weld::Window *pParent, SwWrtShell &rSh); - short run(); + short execute(); const OUString& GetTemplateName() const { return m_aTemplate; } sal_uInt16 GetKind() const { return nKind; } const ::boost::optional<sal_uInt16>& GetPageNumber() const { return oPgNum; } diff --git a/sw/source/uibase/inc/convert.hxx b/sw/source/uibase/inc/convert.hxx index 6ae9a8e699c9..9dfefc5fa642 100644 --- a/sw/source/uibase/inc/convert.hxx +++ b/sw/source/uibase/inc/convert.hxx @@ -27,11 +27,8 @@ class SwView; class SwWrtShell; struct SwInsertTableOptions; -class SwConvertTableDlg +class SwConvertTableDlg : public weld::GenericDialogController { - std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Dialog> m_xDialog; - std::unique_ptr<weld::RadioButton> m_xTabBtn; std::unique_ptr<weld::RadioButton> m_xSemiBtn; std::unique_ptr<weld::RadioButton> m_xParaBtn; @@ -63,8 +60,6 @@ class SwConvertTableDlg public: SwConvertTableDlg(SwView& rView, bool bToTable); - short run() { return m_xDialog->run(); } - void GetValues( sal_Unicode& rDelim, SwInsertTableOptions& rInsTableOpts, SwTableAutoFormat const*& prTAFormat ); diff --git a/sw/source/uibase/inc/splittbl.hxx b/sw/source/uibase/inc/splittbl.hxx index 62d4f4ba9de4..8d32899d0f0a 100644 --- a/sw/source/uibase/inc/splittbl.hxx +++ b/sw/source/uibase/inc/splittbl.hxx @@ -24,11 +24,9 @@ class SwWrtShell; -class SwSplitTableDlg +class SwSplitTableDlg : public weld::GenericDialogController { private: - std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Dialog> m_xDialog; std::unique_ptr<weld::RadioButton> m_xHorzBox; std::unique_ptr<weld::RadioButton> m_xContentCopyRB; std::unique_ptr<weld::RadioButton> m_xBoxAttrCopyWithParaRB; @@ -43,7 +41,7 @@ private: public: SwSplitTableDlg(weld::Window *pParent, SwWrtShell &rSh); - short run() + short execute() { short nRet = m_xDialog->run(); if (nRet == RET_OK) diff --git a/sw/source/uibase/inc/tautofmt.hxx b/sw/source/uibase/inc/tautofmt.hxx index e7870e2c6f17..984554a80467 100644 --- a/sw/source/uibase/inc/tautofmt.hxx +++ b/sw/source/uibase/inc/tautofmt.hxx @@ -35,10 +35,8 @@ class SwWrtShell; enum AutoFormatLine { TOP_LINE, BOTTOM_LINE, LEFT_LINE, RIGHT_LINE }; -class SwAutoFormatDlg +class SwAutoFormatDlg : public weld::GenericDialogController { - std::unique_ptr<weld::Builder> m_xBuilder; - std::unique_ptr<weld::Dialog> m_xDialog; std::unique_ptr<weld::TreeView> m_xLbFormat; std::unique_ptr<weld::Container> m_xFormatting; std::unique_ptr<weld::CheckButton> m_xBtnNumFormat; @@ -79,11 +77,11 @@ public: SwAutoFormatDlg(weld::Window* pParent, SwWrtShell* pShell, bool bSetAutoFormat, const SwTableAutoFormat* pSelFormat); - short run(); + short execute(); SwTableAutoFormat* FillAutoFormatOfIndex() const; - ~SwAutoFormatDlg(); + virtual ~SwAutoFormatDlg() override; }; #endif // SW_AUTOFMT_HXX diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index d1707627f7ef..5fde9cc1f392 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -567,7 +567,7 @@ void SwView::Execute(SfxRequest &rReq) SfxPasswordDialog aPasswdDlg(pParent); aPasswdDlg.SetMinLen(1); //#i69751# the result of Execute() can be ignored - (void)aPasswdDlg.run(); + (void)aPasswdDlg.execute(); OUString sNewPasswd(aPasswdDlg.GetPassword()); Sequence <sal_Int8> aNewPasswd = rIDRA.GetRedlinePassword(); SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd ); @@ -609,7 +609,7 @@ void SwView::Execute(SfxRequest &rReq) aPasswdDlg.SetMinLen(1); if (!aPasswd.getLength()) aPasswdDlg.ShowExtras(SfxShowExtras::CONFIRM); - if (aPasswdDlg.run()) + if (aPasswdDlg.execute()) { RedlineFlags nOn = RedlineFlags::On; OUString sNewPasswd(aPasswdDlg.GetPassword()); |