diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-18 15:05:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-08-20 08:19:48 +0200 |
commit | 0f34e96a5ce68a3039f65cd0f896b33f2d20af5f (patch) | |
tree | 2ea420b96865e6fe69bbbbc1915d3b1ac4c1e808 /include | |
parent | f05b0a6aaf8af5d78f9cad8bb953228cb0ce09f1 (diff) |
return weld widgets by std::unique_ptr from builder
Change-Id: I20c007b13dae2d1155034711ad1ad48bfdfd0ba8
Reviewed-on: https://gerrit.libreoffice.org/59288
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/svtools/inettbc.hxx | 2 | ||||
-rw-r--r-- | include/svtools/valueset.hxx | 2 | ||||
-rw-r--r-- | include/svx/SvxColorValueSet.hxx | 2 | ||||
-rw-r--r-- | include/svx/charmap.hxx | 2 | ||||
-rw-r--r-- | include/svx/colorbox.hxx | 2 | ||||
-rw-r--r-- | include/svx/frmdirlbox.hxx | 4 | ||||
-rw-r--r-- | include/svx/hexcolorcontrol.hxx | 2 | ||||
-rw-r--r-- | include/svx/langbox.hxx | 2 | ||||
-rw-r--r-- | include/svx/pagenumberlistbox.hxx | 2 | ||||
-rw-r--r-- | include/svx/papersizelistbox.hxx | 2 | ||||
-rw-r--r-- | include/svx/relfld.hxx | 2 | ||||
-rw-r--r-- | include/svx/searchcharmap.hxx | 2 | ||||
-rw-r--r-- | include/svx/txencbox.hxx | 2 | ||||
-rw-r--r-- | include/vcl/weld.hxx | 101 |
14 files changed, 77 insertions, 52 deletions
diff --git a/include/svtools/inettbc.hxx b/include/svtools/inettbc.hxx index 18764ec42ce8..6cba183eb953 100644 --- a/include/svtools/inettbc.hxx +++ b/include/svtools/inettbc.hxx @@ -112,7 +112,7 @@ class SVT_DLLPUBLIC URLBox SVT_DLLPRIVATE void Init(); public: - URLBox(weld::ComboBoxText* pWidget); + URLBox(std::unique_ptr<weld::ComboBoxText> pWidget); ~URLBox(); void SetText(const OUString& rStr) { m_xWidget->set_entry_text(rStr); } diff --git a/include/svtools/valueset.hxx b/include/svtools/valueset.hxx index 9d774063d11e..1e2921ba7a5e 100644 --- a/include/svtools/valueset.hxx +++ b/include/svtools/valueset.hxx @@ -475,7 +475,7 @@ protected: virtual css::uno::Reference<css::accessibility::XAccessible> CreateAccessible() override; public: - SvtValueSet(weld::ScrolledWindow* pScrolledWindow); + SvtValueSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow); virtual ~SvtValueSet() override; virtual void SetDrawingArea(weld::DrawingArea* pDrawingArea) override; diff --git a/include/svx/SvxColorValueSet.hxx b/include/svx/SvxColorValueSet.hxx index a1098fb7bd91..42315203980a 100644 --- a/include/svx/SvxColorValueSet.hxx +++ b/include/svx/SvxColorValueSet.hxx @@ -45,7 +45,7 @@ public: class SVX_DLLPUBLIC ColorValueSet : public SvtValueSet { public: - ColorValueSet(weld::ScrolledWindow* pWindow); + ColorValueSet(std::unique_ptr<weld::ScrolledWindow> pWindow); virtual void Resize() override; diff --git a/include/svx/charmap.hxx b/include/svx/charmap.hxx index 5101b230059f..6871aae3dea7 100644 --- a/include/svx/charmap.hxx +++ b/include/svx/charmap.hxx @@ -65,7 +65,7 @@ protected: vcl::Font maFont; std::unique_ptr<weld::ScrolledWindow> mxScrollArea; public: - SvxShowCharSet(weld::ScrolledWindow* pScrollArea, const VclPtr<VirtualDevice>& rVirDev); + SvxShowCharSet(std::unique_ptr<weld::ScrolledWindow> pScrollArea, const VclPtr<VirtualDevice>& rVirDev); virtual ~SvxShowCharSet() override; virtual void RecalculateFont(vcl::RenderContext& rRenderContext); diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx index a4aa9de32133..efa949db4081 100644 --- a/include/svx/colorbox.hxx +++ b/include/svx/colorbox.hxx @@ -110,7 +110,7 @@ private: void LockWidthRequest(); ColorWindow* getColorWindow() const; public: - ColorListBox(weld::MenuButton* pControl, weld::Window* pWindow, bool bInterimBuilder = false); + ColorListBox(std::unique_ptr<weld::MenuButton> pControl, weld::Window* pWindow, bool bInterimBuilder = false); ~ColorListBox(); void SetSelectHdl(const Link<ColorListBox&, void>& rLink) diff --git a/include/svx/frmdirlbox.hxx b/include/svx/frmdirlbox.hxx index 600a3240863e..fb2208f59190 100644 --- a/include/svx/frmdirlbox.hxx +++ b/include/svx/frmdirlbox.hxx @@ -58,8 +58,8 @@ class SAL_WARN_UNUSED SVX_DLLPUBLIC SvxFrameDirectionListBox private: std::unique_ptr<weld::ComboBoxText> m_xControl; public: - explicit SvxFrameDirectionListBox(weld::ComboBoxText* pControl) - : m_xControl(pControl) + explicit SvxFrameDirectionListBox(std::unique_ptr<weld::ComboBoxText> pControl) + : m_xControl(std::move(pControl)) { } diff --git a/include/svx/hexcolorcontrol.hxx b/include/svx/hexcolorcontrol.hxx index 30302374d52b..8e6b34cf311a 100644 --- a/include/svx/hexcolorcontrol.hxx +++ b/include/svx/hexcolorcontrol.hxx @@ -41,7 +41,7 @@ private: DECL_LINK(ImplProcessInputHdl, OUString&, bool); public: - HexColorControl(weld::Entry* pEdit); + HexColorControl(std::unique_ptr<weld::Entry> pEdit); void connect_changed(const Link<Entry&, void>& rLink) { m_xEntry->connect_changed(rLink); } diff --git a/include/svx/langbox.hxx b/include/svx/langbox.hxx index 848d93a2de72..9b130559320f 100644 --- a/include/svx/langbox.hxx +++ b/include/svx/langbox.hxx @@ -160,7 +160,7 @@ private: SVX_DLLPRIVATE void ImplClear(); DECL_LINK(ChangeHdl, weld::ComboBoxText&, void); public: - LanguageBox(weld::ComboBoxText* pControl); + LanguageBox(std::unique_ptr<weld::ComboBoxText> pControl); void SetLanguageList( SvxLanguageListFlags nLangList, bool bHasLangNone, bool bLangNoneIsLangAll = false ); void AddLanguages( const std::vector< LanguageType >& rLanguageTypes, SvxLanguageListFlags nLangList ); diff --git a/include/svx/pagenumberlistbox.hxx b/include/svx/pagenumberlistbox.hxx index 4d15369b0545..51cc94e53a81 100644 --- a/include/svx/pagenumberlistbox.hxx +++ b/include/svx/pagenumberlistbox.hxx @@ -39,7 +39,7 @@ class SVX_DLLPUBLIC SvxPageNumberListBox private: std::unique_ptr<weld::ComboBoxText> m_xControl; public: - SvxPageNumberListBox(weld::ComboBoxText* pControl); + SvxPageNumberListBox(std::unique_ptr<weld::ComboBoxText> pControl); int get_count() const { return m_xControl->get_count(); } OUString get_id(int pos) const { return m_xControl->get_id(pos); } int get_active() const { return m_xControl->get_active(); } diff --git a/include/svx/papersizelistbox.hxx b/include/svx/papersizelistbox.hxx index d9ed3b42582d..0ba2de17ccf5 100644 --- a/include/svx/papersizelistbox.hxx +++ b/include/svx/papersizelistbox.hxx @@ -48,7 +48,7 @@ class SVX_DLLPUBLIC SvxPaperSizeListBox private: std::unique_ptr<weld::ComboBoxText> m_xControl; public: - SvxPaperSizeListBox(weld::ComboBoxText *pControl); + SvxPaperSizeListBox(std::unique_ptr<weld::ComboBoxText> pControl); void FillPaperSizeEntries(PaperSizeApp eApp); void SetSelection(Paper eSize); diff --git a/include/svx/relfld.hxx b/include/svx/relfld.hxx index 8b4d50503fdb..00b8ade7dc3e 100644 --- a/include/svx/relfld.hxx +++ b/include/svx/relfld.hxx @@ -45,7 +45,7 @@ private: DECL_LINK(ModifyHdl, weld::Entry&, void); public: - RelativeField(weld::MetricSpinButton* pControl); + RelativeField(std::unique_ptr<weld::MetricSpinButton> pControl); void EnableRelativeMode( sal_uInt16 nMin, sal_uInt16 nMax ); void SetRelative( bool bRelative ); diff --git a/include/svx/searchcharmap.hxx b/include/svx/searchcharmap.hxx index bcc4ac2dc5b9..7cdebe6acf12 100644 --- a/include/svx/searchcharmap.hxx +++ b/include/svx/searchcharmap.hxx @@ -53,7 +53,7 @@ class ScrollBar; class SVX_DLLPUBLIC SvxSearchCharSet : public SvxShowCharSet { public: - SvxSearchCharSet(weld::ScrolledWindow* pScrolledWindow, const VclPtr<VirtualDevice> &rDevice); + SvxSearchCharSet(std::unique_ptr<weld::ScrolledWindow> pScrolledWindow, const VclPtr<VirtualDevice> &rDevice); virtual ~SvxSearchCharSet() override; virtual void RecalculateFont(vcl::RenderContext& rRenderContext) override; diff --git a/include/svx/txencbox.hxx b/include/svx/txencbox.hxx index 4555b7d338da..294362cc5f85 100644 --- a/include/svx/txencbox.hxx +++ b/include/svx/txencbox.hxx @@ -95,7 +95,7 @@ private: std::unique_ptr<weld::ComboBoxText> m_xControl; public: - TextEncodingBox(weld::ComboBoxText* pControl); + TextEncodingBox(std::unique_ptr<weld::ComboBoxText> pControl); ~TextEncodingBox(); diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx index 0277b3cfae6f..b864231e105a 100644 --- a/include/vcl/weld.hxx +++ b/include/vcl/weld.hxx @@ -17,6 +17,7 @@ #include <vcl/field.hxx> #include <vcl/vclenum.hxx> #include <vcl/virdev.hxx> +#include <o3tl/make_unique.hxx> #include <com/sun/star/accessibility/XAccessibleRelationSet.hpp> @@ -590,9 +591,9 @@ protected: void update_width_chars(); public: - MetricSpinButton(SpinButton* pSpinButton, FieldUnit eSrcUnit) + MetricSpinButton(std::unique_ptr<SpinButton> pSpinButton, FieldUnit eSrcUnit) : m_eSrcUnit(eSrcUnit) - , m_xSpinButton(pSpinButton) + , m_xSpinButton(std::move(pSpinButton)) { update_width_chars(); m_xSpinButton->connect_output(LINK(this, MetricSpinButton, spin_button_output)); @@ -748,9 +749,9 @@ protected: void update_width_chars(); public: - TimeSpinButton(SpinButton* pSpinButton, TimeFieldFormat eFormat) + TimeSpinButton(std::unique_ptr<SpinButton> pSpinButton, TimeFieldFormat eFormat) : m_eFormat(eFormat) - , m_xSpinButton(pSpinButton) + , m_xSpinButton(std::move(pSpinButton)) { update_width_chars(); m_xSpinButton->connect_output(LINK(this, TimeSpinButton, spin_button_output)); @@ -920,43 +921,67 @@ public: m_sHelpRoot = m_sHelpRoot.copy(0, nIdx); m_sHelpRoot = m_sHelpRoot + OString('/'); } - virtual MessageDialog* weld_message_dialog(const OString& id, bool bTakeOwnership = true) = 0; - virtual Dialog* weld_dialog(const OString& id, bool bTakeOwnership = true) = 0; - virtual Window* weld_window(const OString& id, bool bTakeOwnership = true) = 0; - virtual Widget* weld_widget(const OString& id, bool bTakeOwnership = false) = 0; - virtual Container* weld_container(const OString& id, bool bTakeOwnership = false) = 0; - virtual Button* weld_button(const OString& id, bool bTakeOwnership = false) = 0; - virtual MenuButton* weld_menu_button(const OString& id, bool bTakeOwnership = false) = 0; - virtual Frame* weld_frame(const OString& id, bool bTakeOwnership = false) = 0; - virtual ScrolledWindow* weld_scrolled_window(const OString& id, bool bTakeOwnership = false) + virtual std::unique_ptr<MessageDialog> weld_message_dialog(const OString& id, + bool bTakeOwnership = true) = 0; - virtual Notebook* weld_notebook(const OString& id, bool bTakeOwnership = false) = 0; - virtual ToggleButton* weld_toggle_button(const OString& id, bool bTakeOwnership = false) = 0; - virtual RadioButton* weld_radio_button(const OString& id, bool bTakeOwnership = false) = 0; - virtual CheckButton* weld_check_button(const OString& id, bool bTakeOwnership = false) = 0; - virtual SpinButton* weld_spin_button(const OString& id, bool bTakeOwnership = false) = 0; - MetricSpinButton* weld_metric_spin_button(const OString& id, FieldUnit eUnit, - bool bTakeOwnership = false) - { - return new MetricSpinButton(weld_spin_button(id, bTakeOwnership), eUnit); - } - virtual TimeSpinButton* weld_time_spin_button(const OString& id, TimeFieldFormat eFormat, - bool bTakeOwnership = false) + virtual std::unique_ptr<Dialog> weld_dialog(const OString& id, bool bTakeOwnership = true) = 0; + virtual std::unique_ptr<Window> weld_window(const OString& id, bool bTakeOwnership = true) = 0; + virtual std::unique_ptr<Widget> weld_widget(const OString& id, bool bTakeOwnership = false) = 0; + virtual std::unique_ptr<Container> weld_container(const OString& id, + bool bTakeOwnership = false) = 0; - virtual ComboBoxText* weld_combo_box_text(const OString& id, bool bTakeOwnership = false) = 0; - virtual TreeView* weld_tree_view(const OString& id, bool bTakeOwnership = false) = 0; - virtual Label* weld_label(const OString& id, bool bTakeOwnership = false) = 0; - virtual TextView* weld_text_view(const OString& id, bool bTakeOwnership = false) = 0; - virtual Expander* weld_expander(const OString& id, bool bTakeOwnership = false) = 0; - virtual Entry* weld_entry(const OString& id, bool bTakeOwnership = false) = 0; - virtual Scale* weld_scale(const OString& id, bool bTakeOwnership = false) = 0; - virtual ProgressBar* weld_progress_bar(const OString& id, bool bTakeOwnership = false) = 0; - virtual DrawingArea* weld_drawing_area(const OString& id, const a11yref& rA11yImpl = nullptr, - FactoryFunction pUITestFactoryFunction = nullptr, - void* pUserData = nullptr, bool bTakeOwnership = false) + virtual std::unique_ptr<Button> weld_button(const OString& id, bool bTakeOwnership = false) = 0; + virtual std::unique_ptr<MenuButton> weld_menu_button(const OString& id, + bool bTakeOwnership = false) = 0; - virtual Menu* weld_menu(const OString& id, bool bTakeOwnership = true) = 0; - virtual SizeGroup* create_size_group() = 0; + virtual std::unique_ptr<Frame> weld_frame(const OString& id, bool bTakeOwnership = false) = 0; + virtual std::unique_ptr<ScrolledWindow> weld_scrolled_window(const OString& id, + bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<Notebook> weld_notebook(const OString& id, bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<ToggleButton> weld_toggle_button(const OString& id, + bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<RadioButton> weld_radio_button(const OString& id, + bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<CheckButton> weld_check_button(const OString& id, + bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<SpinButton> weld_spin_button(const OString& id, + bool bTakeOwnership = false) + = 0; + std::unique_ptr<MetricSpinButton> weld_metric_spin_button(const OString& id, FieldUnit eUnit, + bool bTakeOwnership = false) + { + return o3tl::make_unique<MetricSpinButton>(weld_spin_button(id, bTakeOwnership), eUnit); + } + virtual std::unique_ptr<TimeSpinButton> + weld_time_spin_button(const OString& id, TimeFieldFormat eFormat, bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<ComboBoxText> weld_combo_box_text(const OString& id, + bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<TreeView> weld_tree_view(const OString& id, bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<Label> weld_label(const OString& id, bool bTakeOwnership = false) = 0; + virtual std::unique_ptr<TextView> weld_text_view(const OString& id, bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<Expander> weld_expander(const OString& id, bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<Entry> weld_entry(const OString& id, bool bTakeOwnership = false) = 0; + virtual std::unique_ptr<Scale> weld_scale(const OString& id, bool bTakeOwnership = false) = 0; + virtual std::unique_ptr<ProgressBar> weld_progress_bar(const OString& id, + bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<DrawingArea> + weld_drawing_area(const OString& id, const a11yref& rA11yImpl = nullptr, + FactoryFunction pUITestFactoryFunction = nullptr, void* pUserData = nullptr, + bool bTakeOwnership = false) + = 0; + virtual std::unique_ptr<Menu> weld_menu(const OString& id, bool bTakeOwnership = true) = 0; + virtual std::unique_ptr<SizeGroup> create_size_group() = 0; virtual ~Builder() {} }; |