From a2304f62e963b413b7575bedfb8d34e5f2d3ea58 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 30 Aug 2018 09:43:59 +0100 Subject: weld writer page style dialog and SvxBorderBackgroundDlg MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit writer, format page is complete Change-Id: I09f6e4354461c4374cdb0d0e0754dfee35415b45 Reviewed-on: https://gerrit.libreoffice.org/60058 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- include/sfx2/tabdlg.hxx | 28 +++++++++++++++++++++------- include/sfx2/viewsh.hxx | 2 +- 2 files changed, 22 insertions(+), 8 deletions(-) (limited to 'include/sfx2') diff --git a/include/sfx2/tabdlg.hxx b/include/sfx2/tabdlg.hxx index d0c28f1c30f9..8102ff3ba0b6 100644 --- a/include/sfx2/tabdlg.hxx +++ b/include/sfx2/tabdlg.hxx @@ -45,15 +45,24 @@ struct TabPageParent TabPageParent(vcl::Window* _pParent) : pParent(_pParent) , pPage(nullptr) + , pController(nullptr) { } - TabPageParent(weld::Container* _pPage) + TabPageParent(weld::Container* _pPage, weld::DialogController* _pController) : pParent(nullptr) , pPage(_pPage) + , pController(_pController) { } + weld::Window* GetFrameWeld() const + { + if (pController) + return pController->getDialog(); + return pParent->GetFrameWeld(); + } VclPtr pParent; weld::Container* pPage; + weld::DialogController* pController; }; typedef VclPtr (*CreateTabPage)(TabPageParent pParent, const SfxItemSet *rAttrSet); @@ -256,7 +265,7 @@ private: protected: virtual short Ok(); - void RefreshInputSet(); + virtual void RefreshInputSet(); virtual void PageCreated(const OString &rName, SfxTabPage &rPage); std::unique_ptr m_xExampleSet; @@ -308,6 +317,11 @@ public: const std::function&); const SfxItemSet* GetExampleSet() const { return m_xExampleSet.get(); } + + void SetApplyHandler(const Link& _rHdl); + + //calls Ok without closing dialog + bool Apply(); }; namespace sfx { class ItemConnectionBase; } @@ -352,15 +366,12 @@ protected: } SfxTabDialog* GetTabDialog() const; + SfxTabDialogController* GetDialogController() const; public: void SetTabDialog(SfxTabDialog* pDialog); -protected: - - SfxTabDialogController* GetDialogController() const; void SetDialogController(SfxTabDialogController* pDialog); - +protected: void AddItemConnection( sfx::ItemConnectionBase* pConnection ); - public: virtual ~SfxTabPage() override; virtual void dispose() override; @@ -397,6 +408,9 @@ public: OString GetConfigId() const; + //TODO rename to GetFrameWeld when SfxTabPage doesn't inherit from anything + weld::Window* GetDialogFrameWeld() const; + //TODO rename to get_preferred_size when SfxTabPage doesn't inherit from anything Size get_container_size() const { diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx index 37f051a8167b..b1c27bdd4321 100644 --- a/include/sfx2/viewsh.hxx +++ b/include/sfx2/viewsh.hxx @@ -245,7 +245,7 @@ public: virtual SfxPrinter* GetPrinter( bool bCreate = false ); virtual sal_uInt16 SetPrinter( SfxPrinter *pNewPrinter, SfxPrinterChangeFlags nDiffFlags = SFX_PRINTER_ALL ); virtual bool HasPrintOptionsPage() const; - virtual VclPtr CreatePrintOptionsPage(weld::Container* pPage, const SfxItemSet &rOptions); + virtual VclPtr CreatePrintOptionsPage(TabPageParent pParent, const SfxItemSet &rOptions); Printer* GetActivePrinter() const; // Working set -- cgit