summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/weld.hxx2
-rw-r--r--sfx2/source/appl/sfxhelp.cxx2
-rw-r--r--vcl/source/app/salvtables.cxx10
-rw-r--r--vcl/unx/gtk3/gtk3gtkinst.cxx8
4 files changed, 13 insertions, 9 deletions
diff --git a/include/vcl/weld.hxx b/include/vcl/weld.hxx
index a180243019df..91fc19f65a87 100644
--- a/include/vcl/weld.hxx
+++ b/include/vcl/weld.hxx
@@ -211,7 +211,7 @@ public:
virtual void freeze() = 0;
virtual void thaw() = 0;
- virtual Container* weld_parent() const = 0;
+ virtual std::unique_ptr<Container> weld_parent() const = 0;
//iterate upwards through the hierarchy starting at this widgets parent,
//calling func with their helpid until func returns true or we run out of
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index 99042b9e0f04..8567731b0b77 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -649,7 +649,7 @@ OUString SfxHelp::GetHelpText(const OUString& aCommandURL, const weld::Widget* p
if (!sHelpText.isEmpty())
xParent.reset();
else
- xParent.reset(xParent->weld_parent());
+ xParent = xParent->weld_parent();
}
if (bIsDebug && sHelpText.isEmpty())
diff --git a/vcl/source/app/salvtables.cxx b/vcl/source/app/salvtables.cxx
index 01069b134a81..a2746d772b30 100644
--- a/vcl/source/app/salvtables.cxx
+++ b/vcl/source/app/salvtables.cxx
@@ -593,7 +593,7 @@ public:
m_xWidget->SetUpdateMode(true);
}
- virtual weld::Container* weld_parent() const override;
+ virtual std::unique_ptr<weld::Container> weld_parent() const override;
virtual ~SalInstanceWidget() override
{
@@ -832,10 +832,12 @@ public:
}
};
-weld::Container* SalInstanceWidget::weld_parent() const
+std::unique_ptr<weld::Container> SalInstanceWidget::weld_parent() const
{
vcl::Window* pParent = m_xWidget->GetParent();
- return pParent ? new SalInstanceContainer(pParent, m_pBuilder, false) : nullptr;
+ if (!pParent)
+ return nullptr;
+ return std::make_unique<SalInstanceContainer>(pParent, m_pBuilder, false);
}
class SalInstanceWindow : public SalInstanceContainer, public virtual weld::Window
@@ -4686,7 +4688,7 @@ namespace weld
if (!rRelocateId.isEmpty())
{
m_xRelocate = m_xBuilder->weld_container(rRelocateId);
- m_xOrigParent.reset(m_xRelocate->weld_parent());
+ m_xOrigParent = m_xRelocate->weld_parent();
//fdo#75121, a bit tricky because the widgets we want to align with
//don't actually exist in the ui description, they're implied
m_xOrigParent->move(m_xRelocate.get(), m_xContentArea.get());
diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx
index 4dd06f61b4eb..0235b1b0f5b6 100644
--- a/vcl/unx/gtk3/gtk3gtkinst.cxx
+++ b/vcl/unx/gtk3/gtk3gtkinst.cxx
@@ -1809,7 +1809,7 @@ public:
return OUString(pStr, pStr ? strlen(pStr) : 0, RTL_TEXTENCODING_UTF8);
}
- virtual weld::Container* weld_parent() const override;
+ virtual std::unique_ptr<weld::Container> weld_parent() const override;
virtual OString get_buildable_name() const override
{
@@ -2368,10 +2368,12 @@ public:
}
};
-weld::Container* GtkInstanceWidget::weld_parent() const
+std::unique_ptr<weld::Container> GtkInstanceWidget::weld_parent() const
{
GtkWidget* pParent = gtk_widget_get_parent(m_pWidget);
- return pParent ? new GtkInstanceContainer(GTK_CONTAINER(pParent), m_pBuilder, false) : nullptr;
+ if (!pParent)
+ return nullptr;
+ return std::make_unique<GtkInstanceContainer>(GTK_CONTAINER(pParent), m_pBuilder, false);
}
class GtkInstanceWindow : public GtkInstanceContainer, public virtual weld::Window