From 66ce7a7bcae0e0e38fc56f6780eec86e06acfd90 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 6 Oct 2020 09:45:54 +0100 Subject: drop ownership argument MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit we have never needed to diverge from the defaults of true for toplevels and false for non-toplevels Change-Id: I884b1e221d0ec44895214363d391c27e3e1707f5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/104019 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- vcl/inc/jsdialog/jsdialogbuilder.hxx | 37 +++----- vcl/inc/salvtables.hxx | 104 +++++++-------------- vcl/jsdialog/jsdialogbuilder.cxx | 68 ++++++-------- vcl/source/app/salvtables.cxx | 175 ++++++++++++++--------------------- vcl/unx/gtk3/gtk3gtkinst.cxx | 147 +++++++++++++++-------------- 5 files changed, 223 insertions(+), 308 deletions(-) (limited to 'vcl') diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx index b141287cf89a..f486685c7dd9 100644 --- a/vcl/inc/jsdialog/jsdialogbuilder.hxx +++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx @@ -74,30 +74,20 @@ public: const css::uno::Reference& rFrame, sal_uInt64 nWindowId = 0); virtual ~JSInstanceBuilder() override; - virtual std::unique_ptr weld_dialog(const OString& id, - bool bTakeOwnership = true) override; - virtual std::unique_ptr weld_label(const OString& id, - bool bTakeOwnership = false) override; - virtual std::unique_ptr weld_button(const OString& id, - bool bTakeOwnership = false) override; - virtual std::unique_ptr weld_entry(const OString& id, - bool bTakeOwnership = false) override; - virtual std::unique_ptr weld_combo_box(const OString& id, - bool bTakeOwnership = false) override; - virtual std::unique_ptr weld_notebook(const OString& id, - bool bTakeOwnership = false) override; - virtual std::unique_ptr - weld_spin_button(const OString& id, bool bTakeOwnership = false) override; - virtual std::unique_ptr - weld_check_button(const OString& id, bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_dialog(const OString& id) override; + virtual std::unique_ptr weld_label(const OString& id) override; + virtual std::unique_ptr weld_button(const OString& id) override; + virtual std::unique_ptr weld_entry(const OString& id) override; + virtual std::unique_ptr weld_combo_box(const OString& id) override; + virtual std::unique_ptr weld_notebook(const OString& id) override; + virtual std::unique_ptr weld_spin_button(const OString& id) override; + virtual std::unique_ptr weld_check_button(const OString& id) override; virtual std::unique_ptr weld_drawing_area(const OString& id, const a11yref& rA11yImpl = nullptr, - FactoryFunction pUITestFactoryFunction = nullptr, void* pUserData = nullptr, - bool bTakeOwnership = false) override; - std::unique_ptr weld_toolbar(const OString& id, - bool bTakeOwnership = false) override; - std::unique_ptr weld_text_view(const OString& id, - bool bTakeOwnership = false) override; + FactoryFunction pUITestFactoryFunction = nullptr, + void* pUserData = nullptr) override; + std::unique_ptr weld_toolbar(const OString& id) override; + std::unique_ptr weld_text_view(const OString& id) override; static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType, @@ -239,8 +229,7 @@ class JSDrawingArea : public SalInstanceDrawingArea, public JSDialogSender public: JSDrawingArea(VclPtr aOwnedToplevel, VclDrawingArea* pDrawingArea, SalInstanceBuilder* pBuilder, const a11yref& rAlly, - FactoryFunction pUITestFactoryFunction, void* pUserData, - bool bTakeOwnership = false); + FactoryFunction pUITestFactoryFunction, void* pUserData); virtual void queue_draw() override; virtual void queue_draw_area(int x, int y, int width, int height) override; diff --git a/vcl/inc/salvtables.hxx b/vcl/inc/salvtables.hxx index 391e61ea3c65..affca7347051 100644 --- a/vcl/inc/salvtables.hxx +++ b/vcl/inc/salvtables.hxx @@ -36,116 +36,84 @@ public: const css::uno::Reference& rFrame = css::uno::Reference()); - virtual std::unique_ptr - weld_message_dialog(const OString& id, bool bTakeOwnership = true) override; + virtual std::unique_ptr weld_message_dialog(const OString& id) override; - virtual std::unique_ptr weld_dialog(const OString& id, - bool bTakeOwnership = true) override; + virtual std::unique_ptr weld_dialog(const OString& id) override; - virtual std::unique_ptr weld_assistant(const OString& id, - bool bTakeOwnership = true) override; + virtual std::unique_ptr weld_assistant(const OString& id) override; virtual std::unique_ptr create_screenshot_window() override; - virtual std::unique_ptr weld_widget(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_widget(const OString& id) override; - virtual std::unique_ptr weld_container(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_container(const OString& id) override; - virtual std::unique_ptr weld_box(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_box(const OString& id) override; - virtual std::unique_ptr weld_paned(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_paned(const OString& id) override; - virtual std::unique_ptr weld_frame(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_frame(const OString& id) override; - virtual std::unique_ptr - weld_scrolled_window(const OString& id, bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_scrolled_window(const OString& id) override; - virtual std::unique_ptr weld_notebook(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_notebook(const OString& id) override; - virtual std::unique_ptr weld_button(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_button(const OString& id) override; - virtual std::unique_ptr - weld_menu_button(const OString& id, bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_menu_button(const OString& id) override; - virtual std::unique_ptr - weld_link_button(const OString& id, bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_link_button(const OString& id) override; - virtual std::unique_ptr - weld_toggle_button(const OString& id, bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_toggle_button(const OString& id) override; - virtual std::unique_ptr - weld_radio_button(const OString& id, bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_radio_button(const OString& id) override; - virtual std::unique_ptr - weld_check_button(const OString& id, bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_check_button(const OString& id) override; - virtual std::unique_ptr weld_scale(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_scale(const OString& id) override; - virtual std::unique_ptr - weld_progress_bar(const OString& id, bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_progress_bar(const OString& id) override; - virtual std::unique_ptr weld_spinner(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_spinner(const OString& id) override; - virtual std::unique_ptr weld_image(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_image(const OString& id) override; - virtual std::unique_ptr weld_calendar(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_calendar(const OString& id) override; - virtual std::unique_ptr weld_entry(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_entry(const OString& id) override; - virtual std::unique_ptr - weld_spin_button(const OString& id, bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_spin_button(const OString& id) override; virtual std::unique_ptr - weld_metric_spin_button(const OString& id, FieldUnit eUnit, - bool bTakeOwnership = false) override; + weld_metric_spin_button(const OString& id, FieldUnit eUnit) override; virtual std::unique_ptr - weld_formatted_spin_button(const OString& id, bool bTakeOwnership = false) override; + weld_formatted_spin_button(const OString& id) override; - virtual std::unique_ptr weld_combo_box(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_combo_box(const OString& id) override; virtual std::unique_ptr weld_entry_tree_view(const OString& containerid, const OString& entryid, - const OString& treeviewid, bool bTakeOwnership = false) override; + const OString& treeviewid) override; - virtual std::unique_ptr weld_tree_view(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_tree_view(const OString& id) override; - virtual std::unique_ptr weld_icon_view(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_icon_view(const OString& id) override; - virtual std::unique_ptr weld_label(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_label(const OString& id) override; - virtual std::unique_ptr weld_text_view(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_text_view(const OString& id) override; - virtual std::unique_ptr weld_expander(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_expander(const OString& id) override; virtual std::unique_ptr weld_drawing_area(const OString& id, const a11yref& rA11yImpl = nullptr, - FactoryFunction pUITestFactoryFunction = nullptr, void* pUserData = nullptr, - bool bTakeOwnership = false) override; + FactoryFunction pUITestFactoryFunction = nullptr, + void* pUserData = nullptr) override; - virtual std::unique_ptr weld_menu(const OString& id, - bool bTakeOwnership = true) override; + virtual std::unique_ptr weld_menu(const OString& id) override; - virtual std::unique_ptr weld_toolbar(const OString& id, - bool bTakeOwnership = false) override; + virtual std::unique_ptr weld_toolbar(const OString& id) override; virtual std::unique_ptr create_size_group() override; diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx index af48c181bff6..d18561d80e3b 100644 --- a/vcl/jsdialog/jsdialogbuilder.cxx +++ b/vcl/jsdialog/jsdialogbuilder.cxx @@ -167,7 +167,7 @@ void JSInstanceBuilder::RememberWidget(const OString& id, weld::Widget* pWidget) } } -std::unique_ptr JSInstanceBuilder::weld_dialog(const OString& id, bool bTakeOwnership) +std::unique_ptr JSInstanceBuilder::weld_dialog(const OString& id) { ::Dialog* pDialog = m_xBuilder->get<::Dialog>(id); m_nWindowId = pDialog->GetLOKWindowId(); @@ -176,7 +176,7 @@ std::unique_ptr JSInstanceBuilder::weld_dialog(const OString& id, std::unique_ptr pRet( pDialog ? new JSDialog(m_aOwnedToplevel, pDialog, this, false) : nullptr); - if (bTakeOwnership && pDialog) + if (pDialog) { assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed"); m_aOwnedToplevel.set(pDialog); @@ -196,11 +196,11 @@ std::unique_ptr JSInstanceBuilder::weld_dialog(const OString& id, return pRet; } -std::unique_ptr JSInstanceBuilder::weld_label(const OString& id, bool bTakeOwnership) +std::unique_ptr JSInstanceBuilder::weld_label(const OString& id) { ::FixedText* pLabel = m_xBuilder->get(id); auto pWeldWidget = std::make_unique( - m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, pLabel, this, bTakeOwnership); + m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, pLabel, this, false); if (pWeldWidget) RememberWidget(id, pWeldWidget.get()); @@ -208,12 +208,12 @@ std::unique_ptr JSInstanceBuilder::weld_label(const OString& id, bo return pWeldWidget; } -std::unique_ptr JSInstanceBuilder::weld_button(const OString& id, bool bTakeOwnership) +std::unique_ptr JSInstanceBuilder::weld_button(const OString& id) { ::Button* pButton = m_xBuilder->get<::Button>(id); auto pWeldWidget = pButton ? std::make_unique(m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, - pButton, this, bTakeOwnership) + pButton, this, false) : nullptr; if (pWeldWidget) @@ -222,12 +222,12 @@ std::unique_ptr JSInstanceBuilder::weld_button(const OString& id, return pWeldWidget; } -std::unique_ptr JSInstanceBuilder::weld_entry(const OString& id, bool bTakeOwnership) +std::unique_ptr JSInstanceBuilder::weld_entry(const OString& id) { Edit* pEntry = m_xBuilder->get(id); auto pWeldWidget = pEntry ? std::make_unique(m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, - pEntry, this, bTakeOwnership) + pEntry, this, false) : nullptr; if (pWeldWidget) @@ -236,8 +236,7 @@ std::unique_ptr JSInstanceBuilder::weld_entry(const OString& id, bo return pWeldWidget; } -std::unique_ptr JSInstanceBuilder::weld_combo_box(const OString& id, - bool bTakeOwnership) +std::unique_ptr JSInstanceBuilder::weld_combo_box(const OString& id) { vcl::Window* pWidget = m_xBuilder->get(id); ::ComboBox* pComboBox = dynamic_cast<::ComboBox*>(pWidget); @@ -245,16 +244,15 @@ std::unique_ptr JSInstanceBuilder::weld_combo_box(const OString& if (pComboBox) { - pWeldWidget = std::make_unique(m_bHasTopLevelDialog ? m_aOwnedToplevel - : m_aParentDialog, - pComboBox, this, bTakeOwnership); + pWeldWidget = std::make_unique( + m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, pComboBox, this, false); } else { ListBox* pListBox = dynamic_cast(pWidget); pWeldWidget = pListBox ? std::make_unique(m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, - pListBox, this, bTakeOwnership) + pListBox, this, false) : nullptr; } @@ -264,13 +262,12 @@ std::unique_ptr JSInstanceBuilder::weld_combo_box(const OString& return pWeldWidget; } -std::unique_ptr JSInstanceBuilder::weld_notebook(const OString& id, - bool bTakeOwnership) +std::unique_ptr JSInstanceBuilder::weld_notebook(const OString& id) { TabControl* pNotebook = m_xBuilder->get(id); auto pWeldWidget = pNotebook ? std::make_unique( m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, - pNotebook, this, bTakeOwnership) + pNotebook, this, false) : nullptr; if (pWeldWidget) @@ -279,13 +276,12 @@ std::unique_ptr JSInstanceBuilder::weld_notebook(const OString& return pWeldWidget; } -std::unique_ptr JSInstanceBuilder::weld_spin_button(const OString& id, - bool bTakeOwnership) +std::unique_ptr JSInstanceBuilder::weld_spin_button(const OString& id) { FormattedField* pSpinButton = m_xBuilder->get(id); auto pWeldWidget = pSpinButton ? std::make_unique( m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, - pSpinButton, this, bTakeOwnership) + pSpinButton, this, false) : nullptr; if (pWeldWidget) @@ -294,13 +290,12 @@ std::unique_ptr JSInstanceBuilder::weld_spin_button(const OStr return pWeldWidget; } -std::unique_ptr JSInstanceBuilder::weld_check_button(const OString& id, - bool bTakeOwnership) +std::unique_ptr JSInstanceBuilder::weld_check_button(const OString& id) { CheckBox* pCheckButton = m_xBuilder->get(id); auto pWeldWidget = pCheckButton ? std::make_unique( m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, - pCheckButton, this, bTakeOwnership) + pCheckButton, this, false) : nullptr; if (pWeldWidget) @@ -311,15 +306,13 @@ std::unique_ptr JSInstanceBuilder::weld_check_button(const OS std::unique_ptr JSInstanceBuilder::weld_drawing_area(const OString& id, const a11yref& rA11yImpl, - FactoryFunction pUITestFactoryFunction, void* pUserData, - bool bTakeOwnership) + FactoryFunction pUITestFactoryFunction, void* pUserData) { VclDrawingArea* pArea = m_xBuilder->get(id); - auto pWeldWidget = pArea - ? std::make_unique( - m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, pArea, - this, rA11yImpl, pUITestFactoryFunction, pUserData, bTakeOwnership) - : nullptr; + auto pWeldWidget = pArea ? std::make_unique( + m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, pArea, + this, rA11yImpl, pUITestFactoryFunction, pUserData) + : nullptr; if (pWeldWidget) RememberWidget(id, pWeldWidget.get()); @@ -327,13 +320,12 @@ JSInstanceBuilder::weld_drawing_area(const OString& id, const a11yref& rA11yImpl return pWeldWidget; } -std::unique_ptr JSInstanceBuilder::weld_toolbar(const OString& id, - bool bTakeOwnership) +std::unique_ptr JSInstanceBuilder::weld_toolbar(const OString& id) { ToolBox* pToolBox = m_xBuilder->get(id); auto pWeldWidget = pToolBox ? std::make_unique( m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, - pToolBox, this, bTakeOwnership) + pToolBox, this, false) : nullptr; if (pWeldWidget) @@ -342,13 +334,12 @@ std::unique_ptr JSInstanceBuilder::weld_toolbar(const OString& id return pWeldWidget; } -std::unique_ptr JSInstanceBuilder::weld_text_view(const OString& id, - bool bTakeOwnership) +std::unique_ptr JSInstanceBuilder::weld_text_view(const OString& id) { VclMultiLineEdit* pTextView = m_xBuilder->get(id); auto pWeldWidget = pTextView ? std::make_unique( m_bHasTopLevelDialog ? m_aOwnedToplevel : m_aParentDialog, - pTextView, this, bTakeOwnership) + pTextView, this, false) : nullptr; if (pWeldWidget) @@ -574,10 +565,9 @@ void JSCheckButton::set_active(bool active) JSDrawingArea::JSDrawingArea(VclPtr aOwnedToplevel, VclDrawingArea* pDrawingArea, SalInstanceBuilder* pBuilder, const a11yref& rAlly, - FactoryFunction pUITestFactoryFunction, void* pUserData, - bool bTakeOwnership) + FactoryFunction pUITestFactoryFunction, void* pUserData) : SalInstanceDrawingArea(pDrawingArea, pBuilder, rAlly, pUITestFactoryFunction, pUserData, - bTakeOwnership) + false) , JSDialogSender(aOwnedToplevel) { } diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx index 40f5ef8be163..28deb03208aa 100644 --- a/vcl/source/app/salvtables.cxx +++ b/vcl/source/app/salvtables.cxx @@ -6540,13 +6540,12 @@ SalInstanceBuilder::SalInstanceBuilder(vcl::Window* pParent, const OUString& rUI { } -std::unique_ptr SalInstanceBuilder::weld_message_dialog(const OString& id, - bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_message_dialog(const OString& id) { MessageDialog* pMessageDialog = m_xBuilder->get(id); std::unique_ptr pRet( pMessageDialog ? new SalInstanceMessageDialog(pMessageDialog, this, false) : nullptr); - if (bTakeOwnership && pMessageDialog) + if (pMessageDialog) { assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed"); m_aOwnedToplevel.set(pMessageDialog); @@ -6555,13 +6554,12 @@ std::unique_ptr SalInstanceBuilder::weld_message_dialog(con return pRet; } -std::unique_ptr SalInstanceBuilder::weld_dialog(const OString& id, - bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_dialog(const OString& id) { Dialog* pDialog = m_xBuilder->get(id); std::unique_ptr pRet(pDialog ? new SalInstanceDialog(pDialog, this, false) : nullptr); - if (bTakeOwnership && pDialog) + if (pDialog) { assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed"); m_aOwnedToplevel.set(pDialog); @@ -6570,13 +6568,12 @@ std::unique_ptr SalInstanceBuilder::weld_dialog(const OString& id, return pRet; } -std::unique_ptr SalInstanceBuilder::weld_assistant(const OString& id, - bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_assistant(const OString& id) { vcl::RoadmapWizard* pDialog = m_xBuilder->get(id); std::unique_ptr pRet(pDialog ? new SalInstanceAssistant(pDialog, this, false) : nullptr); - if (bTakeOwnership && pDialog) + if (pDialog) { assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed"); m_aOwnedToplevel.set(pDialog); @@ -6614,177 +6611,156 @@ std::unique_ptr SalInstanceBuilder::create_screenshot_window() return std::unique_ptr(new SalInstanceDialog(xDialog, this, false)); } -std::unique_ptr SalInstanceBuilder::weld_widget(const OString& id, - bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_widget(const OString& id) { vcl::Window* pWidget = m_xBuilder->get(id); - return pWidget ? std::make_unique(pWidget, this, bTakeOwnership) : nullptr; + return pWidget ? std::make_unique(pWidget, this, false) : nullptr; } -std::unique_ptr SalInstanceBuilder::weld_container(const OString& id, - bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_container(const OString& id) { vcl::Window* pContainer = m_xBuilder->get(id); - return pContainer ? std::make_unique(pContainer, this, bTakeOwnership) + return pContainer ? std::make_unique(pContainer, this, false) : nullptr; } -std::unique_ptr SalInstanceBuilder::weld_box(const OString& id, bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_box(const OString& id) { VclBox* pContainer = m_xBuilder->get(id); - return pContainer ? std::make_unique(pContainer, this, bTakeOwnership) + return pContainer ? std::make_unique(pContainer, this, false) : nullptr; } -std::unique_ptr SalInstanceBuilder::weld_paned(const OString& id, - bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_paned(const OString& id) { VclPaned* pPaned = m_xBuilder->get(id); - return pPaned ? std::make_unique(pPaned, this, bTakeOwnership) + return pPaned ? std::make_unique(pPaned, this, false) : nullptr; } -std::unique_ptr SalInstanceBuilder::weld_frame(const OString& id, bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_frame(const OString& id) { VclFrame* pFrame = m_xBuilder->get(id); std::unique_ptr pRet(pFrame ? new SalInstanceFrame(pFrame, this, false) : nullptr); - if (bTakeOwnership && pFrame) - { - assert(!m_aOwnedToplevel && "only one toplevel per .ui allowed"); - m_aOwnedToplevel.set(pFrame); - m_xBuilder->drop_ownership(pFrame); - } return pRet; } -std::unique_ptr SalInstanceBuilder::weld_scrolled_window(const OString& id, - bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_scrolled_window(const OString& id) { VclScrolledWindow* pScrolledWindow = m_xBuilder->get(id); return pScrolledWindow - ? std::make_unique(pScrolledWindow, this, bTakeOwnership) + ? std::make_unique(pScrolledWindow, this, false) : nullptr; } -std::unique_ptr SalInstanceBuilder::weld_notebook(const OString& id, - bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_notebook(const OString& id) { vcl::Window* pNotebook = m_xBuilder->get(id); if (!pNotebook) return nullptr; if (pNotebook->GetType() == WindowType::TABCONTROL) return std::make_unique(static_cast(pNotebook), this, - bTakeOwnership); + false); if (pNotebook->GetType() == WindowType::VERTICALTABCONTROL) return std::make_unique( - static_cast(pNotebook), this, bTakeOwnership); + static_cast(pNotebook), this, false); return nullptr; } -std::unique_ptr SalInstanceBuilder::weld_button(const OString& id, - bool bTakeOwnership) +std::unique_ptr SalInstanceBuilder::weld_button(const OString& id) { Button* pButton = m_xBuilder->get