summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2021-10-22 10:36:14 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-10-22 12:05:19 +0200
commit426be29029ffec9a721f83d65d0d320455ff9503 (patch)
tree77f7710c6963b588bf7eff650158e08d419dd0d4
parentde0581c77228eb00ff84a3996bfd252d6928a056 (diff)
return weld::Builder by unique_ptr
Change-Id: Ifa4f5951d200eaad6c8aebd3f29eed053c927ff0 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124051 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--basctl/source/basicide/bastypes.cxx2
-rw-r--r--extensions/source/propctrlr/handlerhelper.cxx2
-rw-r--r--extensions/source/propctrlr/propcontroller.cxx4
-rw-r--r--framework/source/uielement/toolbarwrapper.cxx2
-rw-r--r--include/vcl/svapp.hxx4
-rw-r--r--sfx2/source/appl/newhelp.cxx2
-rw-r--r--sfx2/source/dialog/StyleList.cxx2
-rw-r--r--sfx2/source/dialog/dockwin.cxx2
-rw-r--r--sw/source/core/crsr/DateFormFieldButton.cxx4
-rw-r--r--sw/source/core/crsr/DropDownFormFieldButton.cxx4
-rw-r--r--vcl/inc/jsdialog/jsdialogbuilder.hxx25
-rw-r--r--vcl/inc/salinst.hxx4
-rw-r--r--vcl/inc/unx/gtk/gtkinst.hxx4
-rw-r--r--vcl/jsdialog/jsdialogbuilder.cxx38
-rw-r--r--vcl/source/app/salvtables.cxx14
-rw-r--r--vcl/source/control/InterimItemWindow.cxx4
-rw-r--r--vcl/source/window/builder.cxx4
-rw-r--r--vcl/source/window/printdlg.cxx2
-rw-r--r--vcl/unx/gtk3/gtkinst.cxx8
19 files changed, 67 insertions, 64 deletions
diff --git a/basctl/source/basicide/bastypes.cxx b/basctl/source/basicide/bastypes.cxx
index 82e43490b28c..e0ad3daceca5 100644
--- a/basctl/source/basicide/bastypes.cxx
+++ b/basctl/source/basicide/bastypes.cxx
@@ -261,10 +261,10 @@ WinBits const DockingWindow::StyleBits =
DockingWindow::DockingWindow(vcl::Window* pParent, const OUString& rUIXMLDescription, const OString& rID)
: ResizableDockingWindow(pParent)
+ , m_xBuilder(Application::CreateInterimBuilder(m_xBox.get(), rUIXMLDescription, true))
, pLayout(nullptr)
, nShowCount(0)
{
- m_xBuilder.reset(Application::CreateInterimBuilder(m_xBox.get(), rUIXMLDescription, true));
m_xContainer = m_xBuilder->weld_container(rID);
}
diff --git a/extensions/source/propctrlr/handlerhelper.cxx b/extensions/source/propctrlr/handlerhelper.cxx
index 5897840b7e4e..1f274def355f 100644
--- a/extensions/source/propctrlr/handlerhelper.cxx
+++ b/extensions/source/propctrlr/handlerhelper.cxx
@@ -292,7 +292,7 @@ namespace pcr
{
Reference<XWindow> xWindow(rContext->getValueByName("BuilderParent"), UNO_QUERY_THROW);
weld::TransportAsXWindow& rTunnel = dynamic_cast<weld::TransportAsXWindow&>(*xWindow);
- return std::unique_ptr<weld::Builder>(Application::CreateBuilder(rTunnel.getWidget(), rUIFile));
+ return Application::CreateBuilder(rTunnel.getWidget(), rUIFile);
}
void PropertyHandlerHelper::setBuilderParent(const css::uno::Reference<css::uno::XComponentContext>& rContext, weld::Widget* pParent)
diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx
index 6f73dd80a437..4fd878441f90 100644
--- a/extensions/source/propctrlr/propcontroller.cxx
+++ b/extensions/source/propctrlr/propcontroller.cxx
@@ -340,14 +340,14 @@ namespace pcr
if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xContainerWindow.get()))
{
- xBuilder.reset(Application::CreateBuilder(pTunnel->getWidget(), sUIFile));
+ xBuilder = Application::CreateBuilder(pTunnel->getWidget(), sUIFile);
}
else
{
VclPtr<vcl::Window> pParentWin = VCLUnoHelper::GetWindow(xContainerWindow);
if (!pParentWin)
throw RuntimeException("The frame is invalid. Unable to extract the container window.",*this);
- xBuilder.reset(Application::CreateInterimBuilder(pParentWin, sUIFile, true));
+ xBuilder = Application::CreateInterimBuilder(pParentWin, sUIFile, true);
}
Construct(xContainerWindow, std::move(xBuilder));
diff --git a/framework/source/uielement/toolbarwrapper.cxx b/framework/source/uielement/toolbarwrapper.cxx
index 05e39fc9ccc2..9bf9a4bd714a 100644
--- a/framework/source/uielement/toolbarwrapper.cxx
+++ b/framework/source/uielement/toolbarwrapper.cxx
@@ -154,7 +154,7 @@ void SAL_CALL ToolBarWrapper::initialize( const Sequence< Any >& aArguments )
}
else if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get()))
{
- m_xBuilder.reset(Application::CreateBuilder(pTunnel->getWidget(), "svt/ui/managedtoolbar.ui"));
+ m_xBuilder = Application::CreateBuilder(pTunnel->getWidget(), "svt/ui/managedtoolbar.ui");
m_xTopLevel = m_xBuilder->weld_container("toolbarcontainer");
m_xWeldedToolbar = m_xBuilder->weld_toolbar("managedtoolbar");
if ( m_xWeldedToolbar )
diff --git a/include/vcl/svapp.hxx b/include/vcl/svapp.hxx
index e422c47c66ad..c2c5779911c8 100644
--- a/include/vcl/svapp.hxx
+++ b/include/vcl/svapp.hxx
@@ -1321,9 +1321,9 @@ public:
// For vclbootstrapprotector:
static void setDeInitHook(Link<LinkParamNone*,void> const & hook);
- static weld::Builder* CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, bool bMobile = false, sal_uInt64 nLOKWindowId = 0);
+ static std::unique_ptr<weld::Builder> CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, bool bMobile = false, sal_uInt64 nLOKWindowId = 0);
// For the duration of vcl parent windows
- static weld::Builder* CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId = 0);
+ static std::unique_ptr<weld::Builder> CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId = 0);
static weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType,
VclButtonsType eButtonType, const OUString& rPrimaryMessage,
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 1325dff8ce71..92007f02afcf 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -2424,7 +2424,7 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl(
SetHelpId( HID_HELP_WINDOW );
- m_xBuilder.reset(Application::CreateInterimBuilder(m_xBox.get(), "sfx/ui/helpwindow.ui", false));
+ m_xBuilder = Application::CreateInterimBuilder(m_xBox.get(), "sfx/ui/helpwindow.ui", false);
m_xContainer = m_xBuilder->weld_paned("HelpWindow");
m_xContainer->connect_size_allocate(LINK(this, SfxHelpWindow_Impl, ResizeHdl));
m_xHelpPaneWindow = m_xBuilder->weld_container("helppanewindow");
diff --git a/sfx2/source/dialog/StyleList.cxx b/sfx2/source/dialog/StyleList.cxx
index 691780df0863..a76a0dd094fb 100644
--- a/sfx2/source/dialog/StyleList.cxx
+++ b/sfx2/source/dialog/StyleList.cxx
@@ -135,7 +135,7 @@ void StyleList::CreateContextMenu()
m_bBindingUpdate = false;
}
mxMenu.reset();
- mxMenuBuilder.reset(Application::CreateBuilder(nullptr, "sfx/ui/stylecontextmenu.ui"));
+ mxMenuBuilder = Application::CreateBuilder(nullptr, "sfx/ui/stylecontextmenu.ui");
mxMenu = mxMenuBuilder->weld_menu("menu");
mxMenu->set_sensitive("edit", m_bCanEdit);
mxMenu->set_sensitive("delete", m_bCanDel);
diff --git a/sfx2/source/dialog/dockwin.cxx b/sfx2/source/dialog/dockwin.cxx
index cd70cbd7feb6..eb419d7c1656 100644
--- a/sfx2/source/dialog/dockwin.cxx
+++ b/sfx2/source/dialog/dockwin.cxx
@@ -764,7 +764,7 @@ SfxDockingWindow::SfxDockingWindow( SfxBindings *pBindinx, SfxChildWindow *pCW,
, pBindings(pBindinx)
, pMgr(pCW)
{
- m_xBuilder.reset(Application::CreateInterimBuilder(m_xBox, rUIXMLDescription, true));
+ m_xBuilder = Application::CreateInterimBuilder(m_xBox, rUIXMLDescription, true);
m_xContainer = m_xBuilder->weld_box(rID);
pImpl.reset(new SfxDockingWindow_Impl(this));
diff --git a/sw/source/core/crsr/DateFormFieldButton.cxx b/sw/source/core/crsr/DateFormFieldButton.cxx
index aee3bf326f1e..4d6510f9b6a2 100644
--- a/sw/source/core/crsr/DateFormFieldButton.cxx
+++ b/sw/source/core/crsr/DateFormFieldButton.cxx
@@ -38,8 +38,8 @@ DateFormFieldButton::~DateFormFieldButton() { disposeOnce(); }
void DateFormFieldButton::LaunchPopup()
{
- m_xFieldPopupBuilder.reset(
- Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/calendar.ui"));
+ m_xFieldPopupBuilder
+ = Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/calendar.ui");
m_xFieldPopup = m_xFieldPopupBuilder->weld_popover("Calendar");
m_xCalendar = m_xFieldPopupBuilder->weld_calendar("date");
if (m_pDateFieldmark)
diff --git a/sw/source/core/crsr/DropDownFormFieldButton.cxx b/sw/source/core/crsr/DropDownFormFieldButton.cxx
index 0bf317bc6757..eb06bcc5ac2a 100644
--- a/sw/source/core/crsr/DropDownFormFieldButton.cxx
+++ b/sw/source/core/crsr/DropDownFormFieldButton.cxx
@@ -98,8 +98,8 @@ DropDownFormFieldButton::~DropDownFormFieldButton() { disposeOnce(); }
void DropDownFormFieldButton::LaunchPopup()
{
- m_xFieldPopupBuilder.reset(
- Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/formdropdown.ui"));
+ m_xFieldPopupBuilder
+ = Application::CreateBuilder(GetFrameWeld(), "modules/swriter/ui/formdropdown.ui");
m_xFieldPopup = m_xFieldPopupBuilder->weld_popover("FormDropDown");
m_xTreeView = m_xFieldPopupBuilder->weld_tree_view("list");
InitDropdown();
diff --git a/vcl/inc/jsdialog/jsdialogbuilder.hxx b/vcl/inc/jsdialog/jsdialogbuilder.hxx
index 282857341cdf..3d14a1150576 100644
--- a/vcl/inc/jsdialog/jsdialogbuilder.hxx
+++ b/vcl/inc/jsdialog/jsdialogbuilder.hxx
@@ -221,6 +221,7 @@ class JSInstanceBuilder final : public SalInstanceBuilder, public JSDialogSender
void RememberWidget(const OString& id, weld::Widget* pWidget);
static weld::Widget* FindWeldWidgetsMap(sal_uInt64 nWindowId, const OString& rWidget);
+public:
/// used for dialogs or popups
JSInstanceBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile,
bool bPopup = false);
@@ -234,21 +235,21 @@ class JSInstanceBuilder final : public SalInstanceBuilder, public JSDialogSender
/// for autofilter dropdown
JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile);
-public:
- static JSInstanceBuilder* CreateDialogBuilder(weld::Widget* pParent, const OUString& rUIRoot,
- const OUString& rUIFile);
- static JSInstanceBuilder*
+ static std::unique_ptr<JSInstanceBuilder>
+ CreateDialogBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
+ static std::unique_ptr<JSInstanceBuilder>
CreateNotebookbarBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
const css::uno::Reference<css::frame::XFrame>& rFrame,
sal_uInt64 nWindowId = 0);
- static JSInstanceBuilder* CreateAutofilterWindowBuilder(vcl::Window* pParent,
- const OUString& rUIRoot,
- const OUString& rUIFile);
- static JSInstanceBuilder* CreateSidebarBuilder(weld::Widget* pParent, const OUString& rUIRoot,
- const OUString& rUIFile,
- sal_uInt64 nLOKWindowId = 0);
- static JSInstanceBuilder* CreatePopupBuilder(weld::Widget* pParent, const OUString& rUIRoot,
- const OUString& rUIFile);
+ static std::unique_ptr<JSInstanceBuilder>
+ CreateAutofilterWindowBuilder(vcl::Window* pParent, const OUString& rUIRoot,
+ const OUString& rUIFile);
+ static std::unique_ptr<JSInstanceBuilder> CreateSidebarBuilder(weld::Widget* pParent,
+ const OUString& rUIRoot,
+ const OUString& rUIFile,
+ sal_uInt64 nLOKWindowId = 0);
+ static std::unique_ptr<JSInstanceBuilder>
+ CreatePopupBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
virtual ~JSInstanceBuilder() override;
virtual std::unique_ptr<weld::MessageDialog> weld_message_dialog(const OString& id) override;
diff --git a/vcl/inc/salinst.hxx b/vcl/inc/salinst.hxx
index 9694d30f4939..7d42cb51011b 100644
--- a/vcl/inc/salinst.hxx
+++ b/vcl/inc/salinst.hxx
@@ -161,8 +161,8 @@ public:
// also needs to set m_bSupportsOpenGL = true in your SalInstance implementation!
virtual OpenGLContext* CreateOpenGLContext();
- virtual weld::Builder* CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
- virtual weld::Builder* CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
+ virtual std::unique_ptr<weld::Builder> CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile);
+ virtual std::unique_ptr<weld::Builder> CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId = 0);
virtual weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType,
VclButtonsType eButtonType, const OUString& rPrimaryMessage);
diff --git a/vcl/inc/unx/gtk/gtkinst.hxx b/vcl/inc/unx/gtk/gtkinst.hxx
index 581b1fe212c5..d40779d7f18f 100644
--- a/vcl/inc/unx/gtk/gtkinst.hxx
+++ b/vcl/inc/unx/gtk/gtkinst.hxx
@@ -289,8 +289,8 @@ public:
virtual css::uno::Reference< css::uno::XInterface > CreateDragSource() override;
virtual css::uno::Reference< css::uno::XInterface > CreateDropTarget() override;
virtual OpenGLContext* CreateOpenGLContext() override;
- virtual weld::Builder* CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile) override;
- virtual weld::Builder* CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
+ virtual std::unique_ptr<weld::Builder> CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile) override;
+ virtual std::unique_ptr<weld::Builder> CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId = 0) override;
virtual weld::MessageDialog* CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage) override;
virtual weld::Window* GetFrameWeld(const css::uno::Reference<css::awt::XWindow>& rWindow) override;
diff --git a/vcl/jsdialog/jsdialogbuilder.cxx b/vcl/jsdialog/jsdialogbuilder.cxx
index 3471efd6f0ad..e4718f7302ac 100644
--- a/vcl/jsdialog/jsdialogbuilder.cxx
+++ b/vcl/jsdialog/jsdialogbuilder.cxx
@@ -602,40 +602,40 @@ JSInstanceBuilder::JSInstanceBuilder(vcl::Window* pParent, const OUString& rUIRo
sendFullUpdate();
}
-JSInstanceBuilder* JSInstanceBuilder::CreateDialogBuilder(weld::Widget* pParent,
- const OUString& rUIRoot,
- const OUString& rUIFile)
+std::unique_ptr<JSInstanceBuilder> JSInstanceBuilder::CreateDialogBuilder(weld::Widget* pParent,
+ const OUString& rUIRoot,
+ const OUString& rUIFile)
{
- return new JSInstanceBuilder(pParent, rUIRoot, rUIFile);
+ return std::make_unique<JSInstanceBuilder>(pParent, rUIRoot, rUIFile);
}
-JSInstanceBuilder* JSInstanceBuilder::CreateNotebookbarBuilder(
+std::unique_ptr<JSInstanceBuilder> JSInstanceBuilder::CreateNotebookbarBuilder(
vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
const css::uno::Reference<css::frame::XFrame>& rFrame, sal_uInt64 nWindowId)
{
- return new JSInstanceBuilder(pParent, rUIRoot, rUIFile, rFrame, nWindowId);
+ return std::make_unique<JSInstanceBuilder>(pParent, rUIRoot, rUIFile, rFrame, nWindowId);
}
-JSInstanceBuilder* JSInstanceBuilder::CreateAutofilterWindowBuilder(vcl::Window* pParent,
- const OUString& rUIRoot,
- const OUString& rUIFile)
+std::unique_ptr<JSInstanceBuilder>
+JSInstanceBuilder::CreateAutofilterWindowBuilder(vcl::Window* pParent, const OUString& rUIRoot,
+ const OUString& rUIFile)
{
- return new JSInstanceBuilder(pParent, rUIRoot, rUIFile);
+ return std::make_unique<JSInstanceBuilder>(pParent, rUIRoot, rUIFile);
}
-JSInstanceBuilder* JSInstanceBuilder::CreateSidebarBuilder(weld::Widget* pParent,
- const OUString& rUIRoot,
- const OUString& rUIFile,
- sal_uInt64 nLOKWindowId)
+std::unique_ptr<JSInstanceBuilder> JSInstanceBuilder::CreateSidebarBuilder(weld::Widget* pParent,
+ const OUString& rUIRoot,
+ const OUString& rUIFile,
+ sal_uInt64 nLOKWindowId)
{
- return new JSInstanceBuilder(pParent, rUIRoot, rUIFile, nLOKWindowId);
+ return std::make_unique<JSInstanceBuilder>(pParent, rUIRoot, rUIFile, nLOKWindowId);
}
-JSInstanceBuilder* JSInstanceBuilder::CreatePopupBuilder(weld::Widget* pParent,
- const OUString& rUIRoot,
- const OUString& rUIFile)
+std::unique_ptr<JSInstanceBuilder> JSInstanceBuilder::CreatePopupBuilder(weld::Widget* pParent,
+ const OUString& rUIRoot,
+ const OUString& rUIFile)
{
- return new JSInstanceBuilder(pParent, rUIRoot, rUIFile, true);
+ return std::make_unique<JSInstanceBuilder>(pParent, rUIRoot, rUIFile, true);
}
JSInstanceBuilder::~JSInstanceBuilder()
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index f783841991c3..792534a92517 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -7094,18 +7094,20 @@ SalInstanceBuilder::~SalInstanceBuilder()
m_aOwnedToplevel.disposeAndClear();
}
-weld::Builder* SalInstance::CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot,
- const OUString& rUIFile)
+std::unique_ptr<weld::Builder>
+SalInstance::CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile)
{
SalInstanceWidget* pParentInstance = dynamic_cast<SalInstanceWidget*>(pParent);
vcl::Window* pParentWidget = pParentInstance ? pParentInstance->getWidget() : nullptr;
- return new SalInstanceBuilder(pParentWidget, rUIRoot, rUIFile);
+ return std::make_unique<SalInstanceBuilder>(pParentWidget, rUIRoot, rUIFile);
}
-weld::Builder* SalInstance::CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot,
- const OUString& rUIFile, bool, sal_uInt64)
+std::unique_ptr<weld::Builder> SalInstance::CreateInterimBuilder(vcl::Window* pParent,
+ const OUString& rUIRoot,
+ const OUString& rUIFile, bool,
+ sal_uInt64)
{
- return new SalInstanceBuilder(pParent, rUIRoot, rUIFile);
+ return std::make_unique<SalInstanceBuilder>(pParent, rUIRoot, rUIFile);
}
void SalInstanceWindow::help()
diff --git a/vcl/source/control/InterimItemWindow.cxx b/vcl/source/control/InterimItemWindow.cxx
index ac7c2ab44596..d47da4a02d19 100644
--- a/vcl/source/control/InterimItemWindow.cxx
+++ b/vcl/source/control/InterimItemWindow.cxx
@@ -22,8 +22,8 @@ InterimItemWindow::InterimItemWindow(vcl::Window* pParent, const OUString& rUIXM
m_xVclContentArea = VclPtr<VclVBox>::Create(this);
m_xVclContentArea->Show();
- m_xBuilder.reset(Application::CreateInterimBuilder(m_xVclContentArea, rUIXMLDescription,
- bAllowCycleFocusOut, nLOKWindowId));
+ m_xBuilder = Application::CreateInterimBuilder(m_xVclContentArea, rUIXMLDescription,
+ bAllowCycleFocusOut, nLOKWindowId);
m_xContainer = m_xBuilder->weld_container(rID);
SetBackground();
diff --git a/vcl/source/window/builder.cxx b/vcl/source/window/builder.cxx
index a1e4f4bedf97..1e0e8a047f81 100644
--- a/vcl/source/window/builder.cxx
+++ b/vcl/source/window/builder.cxx
@@ -178,7 +178,7 @@ namespace
}
-weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, bool bMobile, sal_uInt64 nLOKWindowId)
+std::unique_ptr<weld::Builder> Application::CreateBuilder(weld::Widget* pParent, const OUString &rUIFile, bool bMobile, sal_uInt64 nLOKWindowId)
{
if (comphelper::LibreOfficeKit::isActive())
{
@@ -193,7 +193,7 @@ weld::Builder* Application::CreateBuilder(weld::Widget* pParent, const OUString
return ImplGetSVData()->mpDefInst->CreateBuilder(pParent, AllSettings::GetUIRootDir(), rUIFile);
}
-weld::Builder* Application::CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId)
+std::unique_ptr<weld::Builder> Application::CreateInterimBuilder(vcl::Window* pParent, const OUString &rUIFile, bool bAllowCycleFocusOut, sal_uInt64 nLOKWindowId)
{
// Notebookbar sub controls
if (comphelper::LibreOfficeKit::isActive() && jsdialog::isInterimBuilderEnabledForNotebookbar(rUIFile))
diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx
index 6f1e2a008c2d..9909b087e02d 100644
--- a/vcl/source/window/printdlg.cxx
+++ b/vcl/source/window/printdlg.cxx
@@ -1342,7 +1342,7 @@ void PrintDialog::setupOptionalUI()
{
OUString sOptionsUIFile;
rOption.Value >>= sOptionsUIFile;
- mxCustomOptionsUIBuilder.reset(Application::CreateBuilder(mxCustom.get(), sOptionsUIFile));
+ mxCustomOptionsUIBuilder = Application::CreateBuilder(mxCustom.get(), sOptionsUIFile);
std::unique_ptr<weld::Container> xWindow = mxCustomOptionsUIBuilder->weld_container("box");
xWindow->show();
continue;
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 6a69b9909b7f..f2dc45eca6c4 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -22876,11 +22876,11 @@ void GtkInstanceWidget::help_hierarchy_foreach(const std::function<bool(const OS
}
}
-weld::Builder* GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile)
+std::unique_ptr<weld::Builder> GtkInstance::CreateBuilder(weld::Widget* pParent, const OUString& rUIRoot, const OUString& rUIFile)
{
GtkInstanceWidget* pParentWidget = dynamic_cast<GtkInstanceWidget*>(pParent);
GtkWidget* pBuilderParent = pParentWidget ? pParentWidget->getWidget() : nullptr;
- return new GtkInstanceBuilder(pBuilderParent, rUIRoot, rUIFile, nullptr, true);
+ return std::make_unique<GtkInstanceBuilder>(pBuilderParent, rUIRoot, rUIFile, nullptr, true);
}
#if !GTK_CHECK_VERSION(4, 0, 0)
@@ -22938,7 +22938,7 @@ gboolean GtkSalFrame::NativeWidgetHelpPressed(GtkAccelGroup*, GObject*, guint, G
}
#endif
-weld::Builder* GtkInstance::CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
+std::unique_ptr<weld::Builder> GtkInstance::CreateInterimBuilder(vcl::Window* pParent, const OUString& rUIRoot, const OUString& rUIFile,
bool bAllowCycleFocusOut, sal_uInt64)
{
// Create a foreign window which we know is a GtkGrid and make the native widgets a child of that, so we can
@@ -22961,7 +22961,7 @@ weld::Builder* GtkInstance::CreateInterimBuilder(vcl::Window* pParent, const OUS
#endif
// build the widget tree as a child of the GtkEventBox GtkGrid parent
- return new GtkInstanceBuilder(pWindow, rUIRoot, rUIFile, xEmbedWindow.get(), bAllowCycleFocusOut);
+ return std::make_unique<GtkInstanceBuilder>(pWindow, rUIRoot, rUIFile, xEmbedWindow.get(), bAllowCycleFocusOut);
}
weld::MessageDialog* GtkInstance::CreateMessageDialog(weld::Widget* pParent, VclMessageType eMessageType, VclButtonsType eButtonsType, const OUString &rPrimaryMessage)