[Libreoffice-commits] core.git: chart2/source comphelper/source include/comphelper include/sfx2 include/svx officecfg/registry sc/qa sc/source sd/qa sd/source sfx2/inc sfx2/source sfx2/uiconfig sfx2/UIConfig_sfx.mk solenv/sanitizers svx/inc svx/source sw/qa sw/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 11 16:43:14 UTC 2021


 chart2/source/controller/sidebar/Chart2PanelFactory.cxx        |   38 +-
 chart2/source/controller/sidebar/ChartAreaPanel.cxx            |   16 -
 chart2/source/controller/sidebar/ChartAreaPanel.hxx            |    8 
 chart2/source/controller/sidebar/ChartAxisPanel.cxx            |   29 --
 chart2/source/controller/sidebar/ChartAxisPanel.hxx            |   10 
 chart2/source/controller/sidebar/ChartElementsPanel.cxx        |   28 -
 chart2/source/controller/sidebar/ChartElementsPanel.hxx        |   10 
 chart2/source/controller/sidebar/ChartErrorBarPanel.cxx        |   30 --
 chart2/source/controller/sidebar/ChartErrorBarPanel.hxx        |   10 
 chart2/source/controller/sidebar/ChartLinePanel.cxx            |   16 -
 chart2/source/controller/sidebar/ChartLinePanel.hxx            |    8 
 chart2/source/controller/sidebar/ChartSeriesPanel.cxx          |   28 -
 chart2/source/controller/sidebar/ChartSeriesPanel.hxx          |    9 
 chart2/source/controller/sidebar/ChartTypePanel.cxx            |   20 -
 chart2/source/controller/sidebar/ChartTypePanel.hxx            |    5 
 comphelper/source/misc/configuration.cxx                       |    1 
 include/comphelper/configurationlistener.hxx                   |    4 
 include/sfx2/navigat.hxx                                       |    2 
 include/sfx2/sidebar/Panel.hxx                                 |    3 
 include/sfx2/sidebar/PanelLayout.hxx                           |   48 +--
 include/sfx2/sidebar/SidebarPanelBase.hxx                      |   12 
 include/sfx2/templdlg.hxx                                      |    3 
 include/svx/sidebar/AreaPropertyPanelBase.hxx                  |    9 
 include/svx/sidebar/InspectorTextPanel.hxx                     |    7 
 include/svx/sidebar/LinePropertyPanelBase.hxx                  |    4 
 officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu   |  145 ++++++++++
 officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs |    8 
 sc/qa/uitest/calc_tests8/navigator.py                          |   10 
 sc/source/ui/formdlg/dwfunctr.cxx                              |   27 -
 sc/source/ui/inc/content.hxx                                   |    2 
 sc/source/ui/inc/dwfunctr.hxx                                  |    7 
 sc/source/ui/inc/navipi.hxx                                    |    9 
 sc/source/ui/navipi/content.cxx                                |    1 
 sc/source/ui/navipi/navipi.cxx                                 |   58 ++--
 sc/source/ui/sidebar/AlignmentPropertyPanel.cxx                |   23 -
 sc/source/ui/sidebar/AlignmentPropertyPanel.hxx                |   10 
 sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx           |   22 -
 sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx           |   11 
 sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx             |   23 -
 sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx             |   10 
 sc/source/ui/sidebar/ScPanelFactory.cxx                        |   26 -
 sd/qa/unit/tiledrendering/tiledrendering.cxx                   |   13 
 sd/source/ui/animations/CustomAnimationPane.cxx                |   28 -
 sd/source/ui/animations/SlideTransitionPane.cxx                |   28 -
 sd/source/ui/dlg/NavigatorChildWindow.cxx                      |   14 
 sd/source/ui/dlg/navigatr.cxx                                  |   18 -
 sd/source/ui/dlg/sdtreelb.cxx                                  |    8 
 sd/source/ui/inc/CustomAnimationPane.hxx                       |    8 
 sd/source/ui/inc/SlideTransitionPane.hxx                       |   11 
 sd/source/ui/inc/TableDesignPane.hxx                           |   10 
 sd/source/ui/inc/navigatr.hxx                                  |   13 
 sd/source/ui/inc/sdtreelb.hxx                                  |    2 
 sd/source/ui/sidebar/AllMasterPagesSelector.cxx                |   16 -
 sd/source/ui/sidebar/AllMasterPagesSelector.hxx                |   21 -
 sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx            |   23 -
 sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx            |   21 -
 sd/source/ui/sidebar/LayoutMenu.cxx                            |   15 -
 sd/source/ui/sidebar/LayoutMenu.hxx                            |    5 
 sd/source/ui/sidebar/MasterPagesSelector.cxx                   |   13 
 sd/source/ui/sidebar/MasterPagesSelector.hxx                   |    3 
 sd/source/ui/sidebar/NavigatorWrapper.cxx                      |    9 
 sd/source/ui/sidebar/NavigatorWrapper.hxx                      |    2 
 sd/source/ui/sidebar/PanelFactory.cxx                          |   34 +-
 sd/source/ui/sidebar/RecentMasterPagesSelector.cxx             |   22 -
 sd/source/ui/sidebar/RecentMasterPagesSelector.hxx             |   21 -
 sd/source/ui/sidebar/SlideBackground.cxx                       |   28 -
 sd/source/ui/sidebar/SlideBackground.hxx                       |    4 
 sfx2/UIConfig_sfx.mk                                           |    1 
 sfx2/inc/sidebar/PanelDescriptor.hxx                           |    1 
 sfx2/source/appl/childwin.cxx                                  |    6 
 sfx2/source/dialog/navigat.cxx                                 |   15 -
 sfx2/source/dialog/templdlg.cxx                                |   12 
 sfx2/source/inc/templdgi.hxx                                   |    2 
 sfx2/source/sidebar/Panel.cxx                                  |   35 +-
 sfx2/source/sidebar/PanelDescriptor.cxx                        |    2 
 sfx2/source/sidebar/PanelLayout.cxx                            |  124 ++------
 sfx2/source/sidebar/ResourceManager.cxx                        |    3 
 sfx2/source/sidebar/SidebarPanelBase.cxx                       |   76 ++---
 sfx2/uiconfig/ui/navigator.ui                                  |   14 
 solenv/sanitizers/ui/sfx.suppr                                 |    1 
 svx/inc/GalleryControl.hxx                                     |    8 
 svx/source/gallery2/GalleryControl.cxx                         |   20 -
 svx/source/inc/DefaultShapesPanel.hxx                          |    7 
 svx/source/sidebar/EmptyPanel.cxx                              |   12 
 svx/source/sidebar/EmptyPanel.hxx                              |    3 
 svx/source/sidebar/PanelFactory.cxx                            |   46 +--
 svx/source/sidebar/area/AreaPropertyPanel.cxx                  |   18 -
 svx/source/sidebar/area/AreaPropertyPanel.hxx                  |    8 
 svx/source/sidebar/area/AreaPropertyPanelBase.cxx              |   53 +--
 svx/source/sidebar/effect/EffectPropertyPanel.cxx              |   24 -
 svx/source/sidebar/effect/EffectPropertyPanel.hxx              |   10 
 svx/source/sidebar/graphic/GraphicPropertyPanel.cxx            |   31 --
 svx/source/sidebar/graphic/GraphicPropertyPanel.hxx            |   12 
 svx/source/sidebar/inspector/InspectorTextPanel.cxx            |   25 -
 svx/source/sidebar/line/LinePropertyPanel.cxx                  |   15 -
 svx/source/sidebar/line/LinePropertyPanel.hxx                  |    7 
 svx/source/sidebar/line/LinePropertyPanelBase.cxx              |   11 
 svx/source/sidebar/lists/ListsPropertyPanel.cxx                |   18 -
 svx/source/sidebar/lists/ListsPropertyPanel.hxx                |    7 
 svx/source/sidebar/media/MediaPlaybackPanel.cxx                |   27 -
 svx/source/sidebar/media/MediaPlaybackPanel.hxx                |   11 
 svx/source/sidebar/paragraph/ParaPropertyPanel.cxx             |   24 -
 svx/source/sidebar/paragraph/ParaPropertyPanel.hxx             |    8 
 svx/source/sidebar/possize/PosSizePropertyPanel.cxx            |   27 -
 svx/source/sidebar/possize/PosSizePropertyPanel.hxx            |   10 
 svx/source/sidebar/shadow/ShadowPropertyPanel.cxx              |   24 -
 svx/source/sidebar/shadow/ShadowPropertyPanel.hxx              |   13 
 svx/source/sidebar/shapes/DefaultShapesPanel.cxx               |   25 -
 svx/source/sidebar/styles/StylesPropertyPanel.cxx              |   23 -
 svx/source/sidebar/styles/StylesPropertyPanel.hxx              |   10 
 svx/source/sidebar/text/TextPropertyPanel.cxx                  |   19 -
 svx/source/sidebar/text/TextPropertyPanel.hxx                  |    7 
 sw/qa/uitest/navigator/tdf114724.py                            |    2 
 sw/qa/uitest/navigator/tdf137274.py                            |    2 
 sw/qa/uitest/navigator/tdf140257.py                            |    4 
 sw/qa/uitest/navigator/tdf140661.py                            |    2 
 sw/qa/uitest/navigator/tdf40427.py                             |    2 
 sw/source/uibase/inc/conttree.hxx                              |    4 
 sw/source/uibase/inc/navipi.hxx                                |   15 -
 sw/source/uibase/inc/redlndlg.hxx                              |    3 
 sw/source/uibase/misc/redlndlg.cxx                             |   12 
 sw/source/uibase/sidebar/PageFooterPanel.cxx                   |   22 -
 sw/source/uibase/sidebar/PageFooterPanel.hxx                   |   17 -
 sw/source/uibase/sidebar/PageFormatPanel.cxx                   |   23 -
 sw/source/uibase/sidebar/PageFormatPanel.hxx                   |   14 
 sw/source/uibase/sidebar/PageHeaderPanel.cxx                   |   21 -
 sw/source/uibase/sidebar/PageHeaderPanel.hxx                   |   18 -
 sw/source/uibase/sidebar/PageStylesPanel.cxx                   |   21 -
 sw/source/uibase/sidebar/PageStylesPanel.hxx                   |   15 -
 sw/source/uibase/sidebar/StylePresetsPanel.cxx                 |   23 -
 sw/source/uibase/sidebar/StylePresetsPanel.hxx                 |   17 -
 sw/source/uibase/sidebar/SwPanelFactory.cxx                    |   54 +--
 sw/source/uibase/sidebar/TableEditPanel.cxx                    |   21 -
 sw/source/uibase/sidebar/TableEditPanel.hxx                    |   17 -
 sw/source/uibase/sidebar/ThemePanel.cxx                        |   21 -
 sw/source/uibase/sidebar/ThemePanel.hxx                        |   14 
 sw/source/uibase/sidebar/WrapPropertyPanel.cxx                 |   23 -
 sw/source/uibase/sidebar/WrapPropertyPanel.hxx                 |    7 
 sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx          |   24 -
 sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx          |    7 
 sw/source/uibase/utlui/content.cxx                             |    5 
 sw/source/uibase/utlui/glbltree.cxx                            |    8 
 sw/source/uibase/utlui/navipi.cxx                              |  100 +++---
 143 files changed, 982 insertions(+), 1551 deletions(-)

New commits:
commit 1653bb9bffaa84a40b7d81a8277e887ea28df4e4
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Mar 4 17:22:14 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Mar 11 17:42:22 2021 +0100

    remove intermediate containers in sidebars
    
    tested extension sidebars of:
    a) Wollmux extension sidebars
    b) Analog Clock Extension demo
       https://wiki.openoffice.org/wiki/Sidebar_for_Developers#Example:_Analog_Clock_Extension
    
    Change-Id: If9729e20526681928137989f01a8ae733a9b0cb5
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112035
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
index 62d1ab65753f..b5bde521d031 100644
--- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
+++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
@@ -20,12 +20,11 @@
 #include "Chart2PanelFactory.hxx"
 
 #include <sfx2/sidebar/SidebarPanelBase.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
-#include <vcl/window.hxx>
 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
 #include <cppuhelper/exc_hlp.hxx>
 #include <comphelper/namedvaluecollection.hxx>
 #include <cppuhelper/supportsservice.hxx>
+#include <vcl/weldutils.hxx>
 
 #include "ChartElementsPanel.hxx"
 #include "ChartTypePanel.hxx"
@@ -62,8 +61,11 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
         Reference<css::awt::XWindow> xParentWindow (aArguments.getOrDefault("ParentWindow", Reference<css::awt::XWindow>()));
         Reference<css::frame::XController> xController (aArguments.getOrDefault("Controller", Reference<css::frame::XController>()));
 
-        VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(xParentWindow);
-        if ( ! xParentWindow.is() || pParentWindow==nullptr)
+        weld::Widget* pParent(nullptr);
+        if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get()))
+            pParent = pTunnel->getWidget();
+
+        if (!pParent)
             throw RuntimeException(
                 "PanelFactory::createUIElement called without ParentWindow",
                 nullptr);
@@ -82,35 +84,27 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement (
                 "ChartPanelFactory::createUIElement called without valid ChartController",
                 nullptr);
 
-        VclPtr<PanelLayout> pPanel;
+        std::unique_ptr<PanelLayout> xPanel;
         if (rsResourceURL.endsWith("/ElementsPanel"))
-            pPanel = ChartElementsPanel::Create( pParentWindow, xFrame, pController );
+            xPanel = ChartElementsPanel::Create( pParent, pController );
         else if (rsResourceURL.endsWith("/TypePanel"))
-        {
-            //pPanel = ChartTypePanel::Create( pParentWindow, xFrame, pController );
-            VclPtrInstance<ChartTypePanel> ppPanel(pParentWindow, xFrame, pController);
-            xElement = sfx2::sidebar::SidebarPanelBase::Create(
-                rsResourceURL,
-                xFrame,
-                ppPanel,
-                css::ui::LayoutSize(-1,-1,-1));
-        }
+            xPanel = std::make_unique<ChartTypePanel>(pParent, pController);
         else if (rsResourceURL.endsWith("/SeriesPanel"))
-            pPanel = ChartSeriesPanel::Create(pParentWindow, xFrame, pController);
+            xPanel = ChartSeriesPanel::Create(pParent, pController);
         else if (rsResourceURL.endsWith("/AxisPanel"))
-            pPanel = ChartAxisPanel::Create(pParentWindow, xFrame, pController);
+            xPanel = ChartAxisPanel::Create(pParent, pController);
         else if (rsResourceURL.endsWith("/ErrorBarPanel"))
-            pPanel = ChartErrorBarPanel::Create(pParentWindow, xFrame, pController);
+            xPanel = ChartErrorBarPanel::Create(pParent, pController);
         else if (rsResourceURL.endsWith("/AreaPanel"))
-            pPanel = ChartAreaPanel::Create(pParentWindow, xFrame, pController);
+            xPanel = ChartAreaPanel::Create(pParent, xFrame, pController);
         else if (rsResourceURL.endsWith("/LinePanel"))
-            pPanel = ChartLinePanel::Create(pParentWindow, xFrame, pController);
+            xPanel = ChartLinePanel::Create(pParent, xFrame, pController);
 
-        if (pPanel)
+        if (xPanel)
             xElement = sfx2::sidebar::SidebarPanelBase::Create(
                 rsResourceURL,
                 xFrame,
-                pPanel,
+                std::move(xPanel),
                 css::ui::LayoutSize(-1,-1,-1));
     }
     catch (const css::uno::RuntimeException &)
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
index 6d25025d460f..51e71e22cf33 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
@@ -256,8 +256,8 @@ private:
 
 }
 
-VclPtr<PanelLayout> ChartAreaPanel::Create(
-        vcl::Window* pParent,
+std::unique_ptr<PanelLayout> ChartAreaPanel::Create(
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         ChartController* pController)
 {
@@ -266,11 +266,10 @@ VclPtr<PanelLayout> ChartAreaPanel::Create(
     if (!rxFrame.is())
         throw css::lang::IllegalArgumentException("no XFrame given to ChartAxisPanel::Create", nullptr, 1);
 
-    return VclPtr<ChartAreaPanel>::Create(
-                        pParent, rxFrame, pController);
+    return std::make_unique<ChartAreaPanel>(pParent, rxFrame, pController);
 }
 
-ChartAreaPanel::ChartAreaPanel(vcl::Window* pParent,
+ChartAreaPanel::ChartAreaPanel(weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         ChartController* pController):
     svx::sidebar::AreaPropertyPanelBase(pParent, rxFrame),
@@ -289,11 +288,6 @@ ChartAreaPanel::ChartAreaPanel(vcl::Window* pParent,
 }
 
 ChartAreaPanel::~ChartAreaPanel()
-{
-    disposeOnce();
-}
-
-void ChartAreaPanel::dispose()
 {
     css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
     xBroadcaster->removeModifyListener(mxListener);
@@ -301,8 +295,6 @@ void ChartAreaPanel::dispose()
     css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
     if (xSelectionSupplier.is())
         xSelectionSupplier->removeSelectionChangeListener(mxSelectionListener);
-
-    AreaPropertyPanelBase::dispose();
 }
 
 void ChartAreaPanel::Initialize()
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.hxx b/chart2/source/controller/sidebar/ChartAreaPanel.hxx
index c7d171f20e38..01fb9077a178 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.hxx
@@ -37,14 +37,14 @@ class ChartAreaPanel : public svx::sidebar::AreaPropertyPanelBase,
     public ChartSidebarSelectionListenerParent
 {
 public:
-    static VclPtr<PanelLayout> Create(
-        vcl::Window* pParent,
+    static std::unique_ptr<PanelLayout> Create(
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         ChartController* pController);
 
     // constructor/destructor
     ChartAreaPanel(
-        vcl::Window* pParent,
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         ChartController* pController);
 
@@ -63,8 +63,6 @@ public:
 
     virtual void selectionChanged(bool bCorrectType) override;
 
-    virtual void dispose() override;
-
     virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) override;
 
 private:
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.cxx b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
index bf84d253961d..f35a57bdf232 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.cxx
@@ -204,10 +204,9 @@ double getAxisRotation(const css::uno::Reference<css::frame::XModel>& xModel,
 }
 
 ChartAxisPanel::ChartAxisPanel(
-    vcl::Window* pParent,
-    const css::uno::Reference<css::frame::XFrame>& rxFrame,
+    weld::Widget* pParent,
     ChartController* pController)
-    : PanelLayout(pParent, "ChartAxisPanel", "modules/schart/ui/sidebaraxis.ui", rxFrame)
+    : PanelLayout(pParent, "ChartAxisPanel", "modules/schart/ui/sidebaraxis.ui")
     , mxCBShowLabel(m_xBuilder->weld_check_button("checkbutton_show_label"))
     , mxCBReverse(m_xBuilder->weld_check_button("checkbutton_reverse"))
     , mxLBLabelPos(m_xBuilder->weld_combo_box("comboboxtext_label_position"))
@@ -219,16 +218,9 @@ ChartAxisPanel::ChartAxisPanel(
     , mbModelValid(true)
 {
     Initialize();
-
-    m_pInitialFocusWidget = mxCBShowLabel.get();
 }
 
 ChartAxisPanel::~ChartAxisPanel()
-{
-    disposeOnce();
-}
-
-void ChartAxisPanel::dispose()
 {
     css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
     xBroadcaster->removeModifyListener(mxModifyListener);
@@ -244,8 +236,6 @@ void ChartAxisPanel::dispose()
     mxGridLabel.reset();
 
     mxNFRotation.reset();
-
-    PanelLayout::dispose();
 }
 
 void ChartAxisPanel::Initialize()
@@ -288,23 +278,18 @@ void ChartAxisPanel::updateData()
     mxNFRotation->set_value(getAxisRotation(mxModel, aCID), FieldUnit::DEGREE);
 }
 
-VclPtr<PanelLayout> ChartAxisPanel::Create (
-    vcl::Window* pParent,
-    const css::uno::Reference<css::frame::XFrame>& rxFrame,
+std::unique_ptr<PanelLayout> ChartAxisPanel::Create (
+    weld::Widget* pParent,
     ChartController* pController)
 {
     if (pParent == nullptr)
         throw lang::IllegalArgumentException("no parent Window given to ChartAxisPanel::Create", nullptr, 0);
-    if ( ! rxFrame.is())
-        throw lang::IllegalArgumentException("no XFrame given to ChartAxisPanel::Create", nullptr, 1);
-
-    return  VclPtr<ChartAxisPanel>::Create(
-                        pParent, rxFrame, pController);
+    return std::make_unique<ChartAxisPanel>(pParent, pController);
 }
 
-void ChartAxisPanel::DataChanged(
-    const DataChangedEvent& )
+void ChartAxisPanel::DataChanged(const DataChangedEvent& rEvent)
 {
+    PanelLayout::DataChanged(rEvent);
     updateData();
 }
 
diff --git a/chart2/source/controller/sidebar/ChartAxisPanel.hxx b/chart2/source/controller/sidebar/ChartAxisPanel.hxx
index f662c9f27cf5..b5f36d90ad89 100644
--- a/chart2/source/controller/sidebar/ChartAxisPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartAxisPanel.hxx
@@ -14,7 +14,6 @@
 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
 #include <sfx2/sidebar/SidebarModelUpdate.hxx>
 #include <sfx2/sidebar/PanelLayout.hxx>
-
 #include "ChartSidebarModifyListener.hxx"
 #include "ChartSidebarSelectionListener.hxx"
 
@@ -35,9 +34,8 @@ class ChartAxisPanel : public PanelLayout,
     public ChartSidebarSelectionListenerParent
 {
 public:
-    static VclPtr<PanelLayout> Create(
-        vcl::Window* pParent,
-        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+    static std::unique_ptr<PanelLayout> Create(
+        weld::Widget* pParent,
         ChartController* pController);
 
     virtual void DataChanged(
@@ -57,11 +55,9 @@ public:
 
     // constructor/destructor
     ChartAxisPanel(
-        vcl::Window* pParent,
-        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+        weld::Widget* pParent,
         ChartController* pController);
     virtual ~ChartAxisPanel() override;
-    virtual void dispose() override;
 
     virtual void updateData() override;
     virtual void modelInvalid() override;
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.cxx b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
index f740fa7319ac..582ac621ee12 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.cxx
@@ -298,9 +298,8 @@ void setLegendPos(const css::uno::Reference<css::frame::XModel>& xModel, sal_Int
 }
 
 ChartElementsPanel::ChartElementsPanel(
-    vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame,
-    ChartController* pController)
-    : PanelLayout(pParent, "ChartElementsPanel", "modules/schart/ui/sidebarelements.ui", rxFrame)
+    weld::Widget* pParent, ChartController* pController)
+    : PanelLayout(pParent, "ChartElementsPanel", "modules/schart/ui/sidebarelements.ui")
     , mxCBTitle(m_xBuilder->weld_check_button("checkbutton_title"))
     , mxEditTitle(m_xBuilder->weld_entry("edit_title"))
     , mxCBSubtitle(m_xBuilder->weld_check_button("checkbutton_subtitle"))
@@ -336,16 +335,9 @@ ChartElementsPanel::ChartElementsPanel(
     maTextSubTitle = mxTextSubTitle->get_label();
 
     Initialize();
-
-    m_pInitialFocusWidget = mxCBTitle.get();
 }
 
 ChartElementsPanel::~ChartElementsPanel()
-{
-    disposeOnce();
-}
-
-void ChartElementsPanel::dispose()
 {
     css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
     xBroadcaster->removeModifyListener(mxListener);
@@ -378,8 +370,6 @@ void ChartElementsPanel::dispose()
 
     mxTextTitle.reset();
     mxTextSubTitle.reset();
-
-    PanelLayout::dispose();
 }
 
 void ChartElementsPanel::Initialize()
@@ -540,22 +530,18 @@ void ChartElementsPanel::updateData()
     mxLBLegendPosition->set_active(getLegendPos(mxModel));
 }
 
-VclPtr<PanelLayout> ChartElementsPanel::Create (
-    vcl::Window* pParent,
-    const css::uno::Reference<css::frame::XFrame>& rxFrame,
+std::unique_ptr<PanelLayout> ChartElementsPanel::Create (
+    weld::Widget* pParent,
     ChartController* pController)
 {
     if (pParent == nullptr)
         throw lang::IllegalArgumentException("no parent Window given to ChartElementsPanel::Create", nullptr, 0);
-    if ( ! rxFrame.is())
-        throw lang::IllegalArgumentException("no XFrame given to ChartElementsPanel::Create", nullptr, 1);
-    return  VclPtr<ChartElementsPanel>::Create(
-                        pParent, rxFrame, pController);
+    return std::make_unique<ChartElementsPanel>(pParent, pController);
 }
 
-void ChartElementsPanel::DataChanged(
-    const DataChangedEvent& )
+void ChartElementsPanel::DataChanged(const DataChangedEvent& rEvent)
 {
+    PanelLayout::DataChanged(rEvent);
     updateData();
 }
 
diff --git a/chart2/source/controller/sidebar/ChartElementsPanel.hxx b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
index 75ad788d7319..801b40efdb72 100644
--- a/chart2/source/controller/sidebar/ChartElementsPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartElementsPanel.hxx
@@ -39,9 +39,8 @@ class ChartElementsPanel : public PanelLayout,
     public ChartSidebarModifyListenerParent
 {
 public:
-    static VclPtr<PanelLayout> Create(
-        vcl::Window* pParent,
-        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+    static std::unique_ptr<PanelLayout> Create(
+        weld::Widget* pParent,
         ChartController* pController);
 
     virtual void DataChanged(
@@ -52,14 +51,11 @@ public:
 
     // constructor/destructor
     ChartElementsPanel(
-        vcl::Window* pParent,
-        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+        weld::Widget* pParent,
         ChartController* pController);
 
     virtual ~ChartElementsPanel() override;
 
-    virtual void dispose() override;
-
     virtual void updateData() override;
     virtual void modelInvalid() override;
 
diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
index 6799a147339d..943abdbdd66c 100644
--- a/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.cxx
@@ -234,10 +234,8 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
 
 }
 
-ChartErrorBarPanel::ChartErrorBarPanel(
-    vcl::Window* pParent,
-    const css::uno::Reference<css::frame::XFrame>& rxFrame, ChartController* pController)
-    : PanelLayout(pParent, "ChartErrorBarPanel", "modules/schart/ui/sidebarerrorbar.ui", rxFrame)
+ChartErrorBarPanel::ChartErrorBarPanel(weld::Widget* pParent, ChartController* pController)
+    : PanelLayout(pParent, "ChartErrorBarPanel", "modules/schart/ui/sidebarerrorbar.ui")
     , mxRBPosAndNeg(m_xBuilder->weld_radio_button("radiobutton_positive_negative"))
     , mxRBPos(m_xBuilder->weld_radio_button("radiobutton_positive"))
     , mxRBNeg(m_xBuilder->weld_radio_button("radiobutton_negative"))
@@ -249,16 +247,9 @@ ChartErrorBarPanel::ChartErrorBarPanel(
     , mbModelValid(true)
 {
     Initialize();
-
-    m_pInitialFocusWidget = mxRBPosAndNeg.get();
 }
 
 ChartErrorBarPanel::~ChartErrorBarPanel()
-{
-    disposeOnce();
-}
-
-void ChartErrorBarPanel::dispose()
 {
     css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
     xBroadcaster->removeModifyListener(mxListener);
@@ -271,8 +262,6 @@ void ChartErrorBarPanel::dispose()
 
     mxMFPos.reset();
     mxMFNeg.reset();
-
-    PanelLayout::dispose();
 }
 
 void ChartErrorBarPanel::Initialize()
@@ -349,23 +338,18 @@ void ChartErrorBarPanel::updateData()
     }
 }
 
-VclPtr<PanelLayout> ChartErrorBarPanel::Create (
-    vcl::Window* pParent,
-    const css::uno::Reference<css::frame::XFrame>& rxFrame,
+std::unique_ptr<PanelLayout> ChartErrorBarPanel::Create (
+    weld::Widget* pParent,
     ChartController* pController)
 {
     if (pParent == nullptr)
         throw lang::IllegalArgumentException("no parent Window given to ChartErrorBarPanel::Create", nullptr, 0);
-    if ( ! rxFrame.is())
-        throw lang::IllegalArgumentException("no XFrame given to ChartErrorBarPanel::Create", nullptr, 1);
-
-    return  VclPtr<ChartErrorBarPanel>::Create(
-                        pParent, rxFrame, pController);
+    return std::make_unique<ChartErrorBarPanel>(pParent, pController);
 }
 
-void ChartErrorBarPanel::DataChanged(
-    const DataChangedEvent& )
+void ChartErrorBarPanel::DataChanged(const DataChangedEvent& rEvent)
 {
+    PanelLayout::DataChanged(rEvent);
     updateData();
 }
 
diff --git a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx
index df8d0b621317..0b95a565bf01 100644
--- a/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartErrorBarPanel.hxx
@@ -14,7 +14,6 @@
 #include <sfx2/sidebar/IContextChangeReceiver.hxx>
 #include <sfx2/sidebar/SidebarModelUpdate.hxx>
 #include <sfx2/sidebar/PanelLayout.hxx>
-
 #include "ChartSidebarModifyListener.hxx"
 
 namespace com::sun::star::util { class XModifyListener; }
@@ -32,9 +31,8 @@ class ChartErrorBarPanel : public PanelLayout,
     public ChartSidebarModifyListenerParent
 {
 public:
-    static VclPtr<PanelLayout> Create(
-        vcl::Window* pParent,
-        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+    static std::unique_ptr<PanelLayout> Create(
+        weld::Widget* pParent,
         ChartController* pController);
 
     virtual void DataChanged(
@@ -54,11 +52,9 @@ public:
 
     // constructor/destructor
     ChartErrorBarPanel(
-        vcl::Window* pParent,
-        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+        weld::Widget* pParent,
         ChartController* pController);
     virtual ~ChartErrorBarPanel() override;
-    virtual void dispose() override;
 
     virtual void updateData() override;
     virtual void modelInvalid() override;
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx
index 58280f19fcdb..d36c1bf7ce31 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx
@@ -107,8 +107,8 @@ private:
 
 }
 
-VclPtr<PanelLayout> ChartLinePanel::Create(
-        vcl::Window* pParent,
+std::unique_ptr<PanelLayout> ChartLinePanel::Create(
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         ChartController* pController)
 {
@@ -117,11 +117,10 @@ VclPtr<PanelLayout> ChartLinePanel::Create(
     if (!rxFrame.is())
         throw css::lang::IllegalArgumentException("no XFrame given to ChartAxisPanel::Create", nullptr, 1);
 
-    return VclPtr<ChartLinePanel>::Create(
-                        pParent, rxFrame, pController);
+    return std::make_unique<ChartLinePanel>(pParent, rxFrame, pController);
 }
 
-ChartLinePanel::ChartLinePanel(vcl::Window* pParent,
+ChartLinePanel::ChartLinePanel(weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         ChartController* pController):
     svx::sidebar::LinePropertyPanelBase(pParent, rxFrame),
@@ -143,11 +142,6 @@ ChartLinePanel::ChartLinePanel(vcl::Window* pParent,
 }
 
 ChartLinePanel::~ChartLinePanel()
-{
-    disposeOnce();
-}
-
-void ChartLinePanel::dispose()
 {
     css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
     xBroadcaster->removeModifyListener(mxListener);
@@ -155,8 +149,6 @@ void ChartLinePanel::dispose()
     css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
     if (xSelectionSupplier.is())
         xSelectionSupplier->removeSelectionChangeListener(mxSelectionListener);
-
-    LinePropertyPanelBase::dispose();
 }
 
 void ChartLinePanel::Initialize()
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.hxx b/chart2/source/controller/sidebar/ChartLinePanel.hxx
index b30775353b08..b46452467fec 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.hxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.hxx
@@ -37,14 +37,14 @@ class ChartLinePanel : public svx::sidebar::LinePropertyPanelBase,
     public ChartSidebarSelectionListenerParent
 {
 public:
-    static VclPtr<PanelLayout> Create(
-        vcl::Window* pParent,
+    static std::unique_ptr<PanelLayout> Create(
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         ChartController* pController);
 
     // constructor/destructor
     ChartLinePanel(
-        vcl::Window* pParent,
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         ChartController* pController);
 
@@ -55,8 +55,6 @@ public:
 
     virtual void selectionChanged(bool bCorrectType) override;
 
-    virtual void dispose() override;
-
     virtual void updateModel(css::uno::Reference<css::frame::XModel> xModel) override;
 
     virtual void setLineWidth(const XLineWidthItem& rItem) override;
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
index 80153beaa80d..4ce23d66811c 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.cxx
@@ -277,10 +277,9 @@ OUString getCID(const css::uno::Reference<css::frame::XModel>& xModel)
 }
 
 ChartSeriesPanel::ChartSeriesPanel(
-    vcl::Window* pParent,
-    const css::uno::Reference<css::frame::XFrame>& rxFrame,
+    weld::Widget* pParent,
     ChartController* pController)
-    : PanelLayout(pParent, "ChartSeriesPanel", "modules/schart/ui/sidebarseries.ui", rxFrame)
+    : PanelLayout(pParent, "ChartSeriesPanel", "modules/schart/ui/sidebarseries.ui")
     , mxCBLabel(m_xBuilder->weld_check_button("checkbutton_label"))
     , mxCBTrendline(m_xBuilder->weld_check_button("checkbutton_trendline"))
     , mxCBXError(m_xBuilder->weld_check_button("checkbutton_x_error"))
@@ -297,16 +296,9 @@ ChartSeriesPanel::ChartSeriesPanel(
     , mbModelValid(true)
 {
     Initialize();
-
-    m_pInitialFocusWidget = mxCBLabel.get();
 }
 
 ChartSeriesPanel::~ChartSeriesPanel()
-{
-    disposeOnce();
-}
-
-void ChartSeriesPanel::dispose()
 {
     css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel, css::uno::UNO_QUERY_THROW);
     xBroadcaster->removeModifyListener(mxListener);
@@ -327,8 +319,6 @@ void ChartSeriesPanel::dispose()
 
     mxFTSeriesName.reset();
     mxFTSeriesTemplate.reset();
-
-    PanelLayout::dispose();
 }
 
 void ChartSeriesPanel::Initialize()
@@ -385,23 +375,19 @@ void ChartSeriesPanel::updateData()
     mxFTSeriesName->set_label(aFrameLabel);
 }
 
-VclPtr<PanelLayout> ChartSeriesPanel::Create (
-    vcl::Window* pParent,
-    const css::uno::Reference<css::frame::XFrame>& rxFrame,
+std::unique_ptr<PanelLayout> ChartSeriesPanel::Create (
+    weld::Widget* pParent,
     ChartController* pController)
 {
     if (pParent == nullptr)
         throw lang::IllegalArgumentException("no parent Window given to ChartSeriesPanel::Create", nullptr, 0);
-    if ( ! rxFrame.is())
-        throw lang::IllegalArgumentException("no XFrame given to ChartSeriesPanel::Create", nullptr, 1);
 
-    return  VclPtr<ChartSeriesPanel>::Create(
-                        pParent, rxFrame, pController);
+    return std::make_unique<ChartSeriesPanel>(pParent, pController);
 }
 
-void ChartSeriesPanel::DataChanged(
-    const DataChangedEvent& )
+void ChartSeriesPanel::DataChanged(const DataChangedEvent& rEvent)
 {
+    PanelLayout::DataChanged(rEvent);
     updateData();
 }
 
diff --git a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
index 485b46fe68d6..2844051001fe 100644
--- a/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
+++ b/chart2/source/controller/sidebar/ChartSeriesPanel.hxx
@@ -43,9 +43,8 @@ class ChartSeriesPanel : public PanelLayout,
     public ChartSidebarSelectionListenerParent
 {
 public:
-    static VclPtr<PanelLayout> Create(
-        vcl::Window* pParent,
-        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+    static std::unique_ptr<PanelLayout> Create(
+        weld::Widget* pParent,
         ChartController* pController);
 
     virtual void DataChanged(
@@ -65,11 +64,9 @@ public:
 
     // constructor/destructor
     ChartSeriesPanel(
-        vcl::Window* pParent,
-        const css::uno::Reference<css::frame::XFrame>& rxFrame,
+        weld::Widget* pParent,
         ChartController* pController);
     virtual ~ChartSeriesPanel() override;
-    virtual void dispose() override;
 
     virtual void updateData() override;
     virtual void modelInvalid() override;
diff --git a/chart2/source/controller/sidebar/ChartTypePanel.cxx b/chart2/source/controller/sidebar/ChartTypePanel.cxx
index a0e38bdb393a..66ffaa97c819 100644
--- a/chart2/source/controller/sidebar/ChartTypePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartTypePanel.cxx
@@ -39,10 +39,8 @@ using namespace css::uno;
 
 namespace chart::sidebar
 {
-ChartTypePanel::ChartTypePanel(vcl::Window* pParent,
-                               const css::uno::Reference<css::frame::XFrame>& rxFrame,
-                               ::chart::ChartController* pController)
-    : PanelLayout(pParent, "ChartTypePanel", "modules/schart/ui/sidebartype.ui", rxFrame)
+ChartTypePanel::ChartTypePanel(weld::Widget* pParent, ::chart::ChartController* pController)
+    : PanelLayout(pParent, "ChartTypePanel", "modules/schart/ui/sidebartype.ui")
     , maContext()
     , mxModel(pController->getModel())
     , mxListener(new ChartSidebarModifyListener(this))
@@ -119,13 +117,9 @@ ChartTypePanel::ChartTypePanel(vcl::Window* pParent,
     m_pSortByXValuesResourceGroup->setChangeListener(this);
 
     Initialize();
-
-    m_pInitialFocusWidget = m_xMainTypeList.get();
 }
 
-ChartTypePanel::~ChartTypePanel() { disposeOnce(); }
-
-void ChartTypePanel::dispose()
+ChartTypePanel::~ChartTypePanel()
 {
     css::uno::Reference<css::util::XModifyBroadcaster> xBroadcaster(mxModel,
                                                                     css::uno::UNO_QUERY_THROW);
@@ -146,8 +140,6 @@ void ChartTypePanel::dispose()
     m_xSubTypeListWin.reset();
     m_xSubTypeList.reset();
     m_xMainTypeList.reset();
-
-    PanelLayout::dispose();
 }
 
 IMPL_LINK_NOARG(ChartTypePanel, SelectMainTypeHdl, weld::ComboBox&, void) { selectMainType(); }
@@ -251,7 +243,11 @@ void ChartTypePanel::updateData()
     }
 }
 
-void ChartTypePanel::DataChanged(const DataChangedEvent&) { updateData(); }
+void ChartTypePanel::DataChanged(const DataChangedEvent& rEvent)
+{
+    PanelLayout::DataChanged(rEvent);
+    updateData();
+}
 
 void ChartTypePanel::HandleContextChange(const vcl::EnumContext& rContext)
 {
diff --git a/chart2/source/controller/sidebar/ChartTypePanel.hxx b/chart2/source/controller/sidebar/ChartTypePanel.hxx
index 7c4e27246ca3..6a9036ebaa02 100644
--- a/chart2/source/controller/sidebar/ChartTypePanel.hxx
+++ b/chart2/source/controller/sidebar/ChartTypePanel.hxx
@@ -62,13 +62,10 @@ public:
     virtual void HandleContextChange(const vcl::EnumContext& rContext) override;
 
     // constructor/destructor
-    ChartTypePanel(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame,
-                   ::chart::ChartController* pController);
+    ChartTypePanel(weld::Widget* pParent, ::chart::ChartController* pController);
 
     virtual ~ChartTypePanel() override;
 
-    virtual void dispose() override;
-
     virtual void updateData() override;
     virtual void modelInvalid() override;
 
diff --git a/comphelper/source/misc/configuration.cxx b/comphelper/source/misc/configuration.cxx
index 56b186dea805..873c34b93a91 100644
--- a/comphelper/source/misc/configuration.cxx
+++ b/comphelper/source/misc/configuration.cxx
@@ -231,6 +231,7 @@ void comphelper::ConfigurationListener::dispose()
         listener->dispose();
     }
     maListeners.clear();
+    mbDisposed = true;
 }
 
 void SAL_CALL comphelper::ConfigurationListener::disposing(css::lang::EventObject const &)
diff --git a/include/comphelper/configurationlistener.hxx b/include/comphelper/configurationlistener.hxx
index 29a2b578b588..bc7994a12c3a 100644
--- a/include/comphelper/configurationlistener.hxx
+++ b/include/comphelper/configurationlistener.hxx
@@ -64,6 +64,7 @@ class COMPHELPER_DLLPUBLIC ConfigurationListener :
 {
     css::uno::Reference< css::beans::XPropertySet > mxConfig;
     std::vector< ConfigurationListenerPropertyBase * > maListeners;
+    bool mbDisposed;
 public:
     /// Public health warning, you -must- dispose this if you use it.
     ConfigurationListener(const OUString &rPath,
@@ -71,6 +72,7 @@ public:
                           const & xContext = comphelper::getProcessComponentContext())
         : mxConfig( ConfigurationHelper::openConfig( xContext, rPath, EConfigurationModes::ReadOnly ),
                     css::uno::UNO_QUERY_THROW )
+        , mbDisposed(false)
     { }
 
     virtual ~ConfigurationListener() override
@@ -93,6 +95,8 @@ public:
     /// Notify of the property change
     virtual void SAL_CALL propertyChange(
         css::beans::PropertyChangeEvent const &rEvt ) override;
+
+    bool isDisposed() const { return mbDisposed; }
 };
 
 template< typename uno_type > ConfigurationListenerProperty< uno_type >::ConfigurationListenerProperty(const rtl::Reference< ConfigurationListener > &xListener, const OUString &rProp )
diff --git a/include/sfx2/navigat.hxx b/include/sfx2/navigat.hxx
index f5fc9acb3fd7..f26321d658c3 100644
--- a/include/sfx2/navigat.hxx
+++ b/include/sfx2/navigat.hxx
@@ -39,8 +39,6 @@ class SFX2_DLLPUBLIC SfxNavigator : public SfxDockingWindow
 public:
     SfxNavigator(SfxBindings* pBindings, SfxChildWindow* pChildWin,
                  vcl::Window* pParent);
-
-    virtual void Resize() override;
 };
 
 #endif
diff --git a/include/sfx2/sidebar/Panel.hxx b/include/sfx2/sidebar/Panel.hxx
index 92e57abc13fd..28fa9cdda1b7 100644
--- a/include/sfx2/sidebar/Panel.hxx
+++ b/include/sfx2/sidebar/Panel.hxx
@@ -89,6 +89,7 @@ public:
 private:
     const OUString msPanelId;
     const bool mbIsTitleBarOptional;
+    const bool mbWantsAWT;
     css::uno::Reference<css::ui::XUIElement> mxElement;
     css::uno::Reference<css::ui::XSidebarPanel> mxPanelComponent;
     bool mbIsExpanded;
@@ -98,7 +99,7 @@ private:
     const css::uno::Reference<css::frame::XFrame>& mxFrame;
     std::unique_ptr<PanelTitleBar> mxTitleBar;
     std::unique_ptr<weld::Container> mxContents;
-    css::uno::Reference<css::awt::XWindow> mxAwtXWindow;
+    css::uno::Reference<css::awt::XWindow> mxXWindow;
 };
 typedef std::vector<VclPtr<Panel>> SharedPanelContainer;
 
diff --git a/include/sfx2/sidebar/PanelLayout.hxx b/include/sfx2/sidebar/PanelLayout.hxx
index 0e9e56875ff1..b03ebf97bb22 100644
--- a/include/sfx2/sidebar/PanelLayout.hxx
+++ b/include/sfx2/sidebar/PanelLayout.hxx
@@ -10,41 +10,43 @@
 #pragma once
 
 #include <sfx2/dllapi.h>
-
-#include <vcl/ctrl.hxx>
-#include <vcl/timer.hxx>
-#include <vcl/idle.hxx>
 #include <vcl/weld.hxx>
 
-#include <com/sun/star/frame/XFrame.hpp>
+class DataChangedEvent;
+class VclSimpleEvent;
+namespace sfx2 { namespace sidebar { class Panel; } }
+namespace tools { class JsonWriter; }
 
 /// This class is the base for the Widget Layout-based sidebar panels.
-class SFX2_DLLPUBLIC PanelLayout : public Control
+class SFX2_DLLPUBLIC PanelLayout
 {
 protected:
+    VclPtr<sfx2::sidebar::Panel> m_xPanel;
     std::unique_ptr<weld::Builder> m_xBuilder;
-    VclPtr<vcl::Window> m_xVclContentArea;
     std::unique_ptr<weld::Container> m_xContainer;
-    weld::Widget* m_pInitialFocusWidget;
 
-private:
-    Idle m_aPanelLayoutIdle;
-    bool m_bInClose;
-    css::uno::Reference<css::frame::XFrame> mxFrame;
+    virtual void DataChanged(const DataChangedEvent& rEvent);
+    virtual void DumpAsPropertyTree(tools::JsonWriter&);
 
-    DECL_DLLPRIVATE_LINK(ImplHandlePanelLayoutTimerHdl, Timer*, void);
+    virtual weld::Window* GetFrameWeld() const;
+
+private:
+    DECL_LINK(DataChangedEventListener, VclSimpleEvent&, void);
+    DECL_LINK(DumpAsPropertyTreeHdl, tools::JsonWriter&, void);
 
 public:
-    PanelLayout(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
-                const css::uno::Reference<css::frame::XFrame> &rFrame);
-    virtual ~PanelLayout() override;
-    virtual void dispose() override;
-
-    virtual Size GetOptimalSize() const override;
-    virtual void GetFocus() override;
-    virtual void setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags = PosSizeFlags::All) override;
-    virtual void queue_resize(StateChangedType eReason = StateChangedType::Layout) override;
-    virtual bool EventNotify(NotifyEvent& rNEvt) override;
+    PanelLayout(weld::Widget* pParent, const OString& rID, const OUString& rUIXMLDescription);
+
+    void SetPanel(sfx2::sidebar::Panel* pPanel);
+
+    virtual ~PanelLayout();
+
+    Size get_preferred_size() const
+    {
+        return m_xContainer->get_preferred_size();
+    }
+
+    void queue_resize();
 };
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/include/sfx2/sidebar/SidebarPanelBase.hxx b/include/sfx2/sidebar/SidebarPanelBase.hxx
index a12727cfafad..971e286ca74f 100644
--- a/include/sfx2/sidebar/SidebarPanelBase.hxx
+++ b/include/sfx2/sidebar/SidebarPanelBase.hxx
@@ -29,12 +29,12 @@
 #include <com/sun/star/ui/XSidebarPanel.hpp>
 #include <com/sun/star/ui/XUpdateModel.hpp>
 
-#include <vcl/vclptr.hxx>
-
 class PanelLayout;
 
 namespace sfx2::sidebar {
 
+class Panel;
+
 typedef cppu::WeakComponentImplHelper<css::ui::XContextChangeEventListener,
                                        css::ui::XUIElement,
                                        css::ui::XToolPanel,
@@ -51,7 +51,7 @@ class SFX2_DLLPUBLIC SidebarPanelBase final : private ::cppu::BaseMutex,
 public:
     static css::uno::Reference<css::ui::XUIElement> Create(const OUString& rsResourceURL,
                                                            const css::uno::Reference<css::frame::XFrame>& rxFrame,
-                                                           PanelLayout* pControl,
+                                                           std::unique_ptr<PanelLayout> xControl,
                                                            const css::ui::LayoutSize& rLayoutSize);
 
     // XContextChangeEventListener
@@ -78,9 +78,11 @@ public:
     // XUpdateModel
     virtual void SAL_CALL updateModel(const css::uno::Reference<css::frame::XModel>& xModel) override;
 
+    void SetParentPanel(sfx2::sidebar::Panel* pPanel);
+
 private:
     SidebarPanelBase(const OUString& rsResourceURL, const css::uno::Reference<css::frame::XFrame>& rxFrame,
-                     PanelLayout* pWindow, const css::ui::LayoutSize& rLayoutSize);
+                     std::unique_ptr<PanelLayout> xControl, const css::ui::LayoutSize& rLayoutSize);
     virtual ~SidebarPanelBase() override;
     SidebarPanelBase(const SidebarPanelBase&) = delete;
     SidebarPanelBase& operator=( const SidebarPanelBase& ) = delete;
@@ -88,7 +90,7 @@ private:
     virtual void SAL_CALL disposing() override;
 
     css::uno::Reference<css::frame::XFrame> mxFrame;
-    VclPtr<PanelLayout> mpControl;
+    std::unique_ptr<PanelLayout> mxControl;
     const OUString msResourceURL;
     const css::ui::LayoutSize maLayoutSize;
 };
diff --git a/include/sfx2/templdlg.hxx b/include/sfx2/templdlg.hxx
index 81febcf7f01f..5dd5b8b6b178 100644
--- a/include/sfx2/templdlg.hxx
+++ b/include/sfx2/templdlg.hxx
@@ -31,9 +31,8 @@ class SfxTemplateDialog_Impl;
 class UNLESS_MERGELIBS(SFX2_DLLPUBLIC) SfxTemplatePanelControl final : public PanelLayout
 {
 public:
-    SfxTemplatePanelControl(SfxBindings* pBindings, vcl::Window* pParentWindow);
+    SfxTemplatePanelControl(SfxBindings* pBindings, weld::Widget* pParent);
     virtual ~SfxTemplatePanelControl() override;
-    virtual void dispose() override;
 
     weld::Builder* get_builder() { return m_xBuilder.get(); }
     weld::Container* get_container() { return m_xContainer.get(); }
diff --git a/include/svx/sidebar/AreaPropertyPanelBase.hxx b/include/svx/sidebar/AreaPropertyPanelBase.hxx
index a3103b6c04c2..434a6397d4e2 100644
--- a/include/svx/sidebar/AreaPropertyPanelBase.hxx
+++ b/include/svx/sidebar/AreaPropertyPanelBase.hxx
@@ -51,11 +51,6 @@ class SVX_DLLPUBLIC AreaPropertyPanelBase
 {
 public:
 
-    virtual void dispose() override;
-
-    virtual void DataChanged(
-        const DataChangedEvent& rEvent) override;
-
     virtual void NotifyItemUpdate(
         const sal_uInt16 nSId,
         const SfxItemState eState,
@@ -78,7 +73,7 @@ public:
 
     // constructor/destructor
     AreaPropertyPanelBase(
-        vcl::Window* pParent,
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame);
 
     virtual ~AreaPropertyPanelBase() override;
@@ -148,8 +143,6 @@ protected:
     OUString maImgSquare;
     OUString  maImgLinear;
 
-    VclPtr<sfx2::sidebar::Panel>                    mpPanel;
-
     std::unique_ptr< XFillFloatTransparenceItem >   mpFloatTransparenceItem;
     std::unique_ptr< SfxUInt16Item >                mpTransparanceItem;
 
diff --git a/include/svx/sidebar/InspectorTextPanel.hxx b/include/svx/sidebar/InspectorTextPanel.hxx
index 10ddf932fe06..ce4eecf8ad64 100644
--- a/include/svx/sidebar/InspectorTextPanel.hxx
+++ b/include/svx/sidebar/InspectorTextPanel.hxx
@@ -45,13 +45,10 @@ class SVX_DLLPUBLIC InspectorTextPanel : public PanelLayout
 {
 public:
     virtual ~InspectorTextPanel() override;
-    virtual void dispose() override;
 
-    static VclPtr<vcl::Window> Create(vcl::Window* pParent,
-                                      const css::uno::Reference<css::frame::XFrame>& rxFrame);
+    static std::unique_ptr<PanelLayout> Create(weld::Widget* pParent);
 
-    InspectorTextPanel(vcl::Window* pParent,
-                       const css::uno::Reference<css::frame::XFrame>& rxFrame);
+    InspectorTextPanel(weld::Widget* pParent);
 
     void updateEntries(const std::vector<TreeNode>& rStore);
 
diff --git a/include/svx/sidebar/LinePropertyPanelBase.hxx b/include/svx/sidebar/LinePropertyPanelBase.hxx
index 52411be57d2c..34668f486061 100644
--- a/include/svx/sidebar/LinePropertyPanelBase.hxx
+++ b/include/svx/sidebar/LinePropertyPanelBase.hxx
@@ -25,6 +25,7 @@
 #include <sfx2/sidebar/PanelLayout.hxx>
 #include <svx/sidebar/LineWidthPopup.hxx>
 #include <svx/svxdllapi.h>
+#include <com/sun/star/frame/XFrame.hpp>
 
 class ToolbarUnoDispatcher;
 class XLineStyleItem;
@@ -46,7 +47,6 @@ class SVX_DLLPUBLIC LinePropertyPanelBase : public PanelLayout
 {
 public:
     virtual ~LinePropertyPanelBase() override;
-    virtual void dispose() override;
 
     void SetWidth(tools::Long nWidth);
     void SetWidthIcon(int n);
@@ -55,7 +55,7 @@ public:
     void EndLineWidthPopup();
 
     // constructor/destructor
-    LinePropertyPanelBase(vcl::Window* pParent,
+    LinePropertyPanelBase(weld::Widget* pParent,
                           const css::uno::Reference<css::frame::XFrame>& rxFrame);
 
     virtual void setLineWidth(const XLineWidthItem& rItem) = 0;
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
index 5df1db5c1b95..2c37dec8fe65 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu
@@ -348,6 +348,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="TextPropertyPanel" oor:op="replace">
@@ -392,6 +395,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>120</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="InspectorTextPanel" oor:op="replace">
@@ -418,6 +424,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="MediaPlaybackPanel" oor:op="replace">
@@ -441,6 +450,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="PageStylesPanel" oor:op="replace">
@@ -467,6 +479,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>200</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="PageFormatPanel" oor:op="replace">
@@ -493,6 +508,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="PageHeaderPanel" oor:op="replace">
@@ -519,6 +537,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>400</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="PageFooterPanel" oor:op="replace">
@@ -545,6 +566,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>500</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="AreaPropertyPanel" oor:op="replace">
@@ -581,6 +605,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>300</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="EffectPropertyPanel" oor:op="replace">
@@ -607,6 +634,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>300</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ShadowPropertyPanel" oor:op="replace">
@@ -639,6 +669,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>300</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="LinePropertyPanel" oor:op="replace">
@@ -675,6 +708,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>400</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="GalleryPanel" oor:op="replace">
@@ -701,6 +737,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="PosSizePropertyPanel" oor:op="replace">
@@ -748,6 +787,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>500</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="GraphicPropertyPanel" oor:op="replace">
@@ -773,6 +815,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>300</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="DefaultShapesPanel" oor:op="replace">
@@ -796,6 +841,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SlideBackgroundPanel" oor:op="replace">
@@ -827,7 +875,11 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
+
       <node oor:name="SdLayoutsPanel" oor:op="replace">
         <prop oor:name="Title" oor:type="xs:string">
           <value xml:lang="en-US">Layouts</value>
@@ -856,7 +908,11 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>200</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
+
       <node oor:name="SdUsedMasterPagesPanel" oor:op="replace">
         <prop oor:name="Title" oor:type="xs:string">
           <value xml:lang="en-US">Used in This Presentation</value>
@@ -881,6 +937,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SdRecentMasterPagesPanel" oor:op="replace">
@@ -907,6 +966,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>200</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SdAllMasterPagesPanel" oor:op="replace">
@@ -933,6 +995,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>300</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SdCustomAnimationPanel" oor:op="replace">
@@ -959,6 +1024,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SdSlideTransitionPanel" oor:op="replace">
@@ -985,6 +1053,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SdTableDesignPanel" oor:op="replace">
@@ -1011,6 +1082,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>300</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="EmptyPanel" oor:op="replace">
@@ -1037,6 +1111,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ScAlignmentPropertyPanel" oor:op="replace">
@@ -1067,6 +1144,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>200</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ScCellAppearancePropertyPanel" oor:op="replace">
@@ -1097,6 +1177,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>300</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ScNumberFormatPropertyPanel" oor:op="replace">
@@ -1127,6 +1210,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>150</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ParaPropertyPanel" oor:op="replace">
@@ -1166,6 +1252,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>200</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ListsPropertyPanel" oor:op="replace">
@@ -1194,6 +1283,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>120</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SwWrapPropertyPanel" oor:op="replace">
@@ -1226,6 +1318,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>500</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SwNavigatorPanel" oor:op="replace">
@@ -1255,6 +1350,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ScNavigatorPanel" oor:op="replace">
@@ -1284,6 +1382,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SdNavigatorPanel" oor:op="replace">
@@ -1313,6 +1414,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SwManageChangesPanel" oor:op="replace">
@@ -1342,6 +1446,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="StyleListPanel" oor:op="replace">
@@ -1368,6 +1475,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ScFunctionsPanel" oor:op="replace">
@@ -1394,7 +1504,11 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>100</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
+
       <node oor:name="SwStylePresetsPanel" oor:op="replace">
         <prop oor:name="Title" oor:type="xs:string">
           <value xml:lang="en-US">Style Presets</value>
@@ -1419,6 +1533,9 @@
         <prop oor:name="IsExperimental" oor:type="xs:boolean">
           <value>true</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="SwThemePanel" oor:op="replace">
@@ -1445,6 +1562,9 @@
         <prop oor:name="IsExperimental" oor:type="xs:boolean">
           <value>true</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ChartElementsPanel" oor:op="replace">
@@ -1468,6 +1588,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>1</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ChartSeriesPanel" oor:op="replace">
@@ -1494,6 +1617,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>2</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ChartErrorBarPanel" oor:op="replace">
@@ -1520,6 +1646,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>4</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ChartAxisPanel" oor:op="replace">
@@ -1546,6 +1675,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>5</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ChartAreaPanel" oor:op="replace">
@@ -1573,6 +1705,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>6</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ChartLinePanel" oor:op="replace">
@@ -1604,6 +1739,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>7</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="TableEditPanel" oor:op="replace">
@@ -1633,6 +1771,9 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>300</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
 
       <node oor:name="ChartTypePanel" oor:op="replace">
@@ -1656,7 +1797,11 @@
         <prop oor:name="OrderIndex" oor:type="xs:int">
           <value>0</value>
         </prop>
+        <prop oor:name="WantsAWT" oor:type="xs:boolean">
+          <value>false</value>
+        </prop>
       </node>
+
     </node>
   </node>
 </oor:component-data>
diff --git a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
index 6ed1d79d80cf..9fbb0fbbcbee 100644
--- a/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs
@@ -228,6 +228,14 @@
         </info>
         <value>false</value>
       </prop>
+      <prop oor:name="WantsAWT" oor:type="xs:boolean">
+        <info>
+          <desc>This flag controls whether the panel requires a awt::XWindow parent. This option cannot be false if WantsCanvas
+          is also true. The default of true is suitable for third party sidebar panels, false is only useful for built-in
+          internal panels.</desc>
+        </info>
+        <value>true</value>
+      </prop>
     </group>
   </templates>
   <component>
diff --git a/sc/qa/uitest/calc_tests8/navigator.py b/sc/qa/uitest/calc_tests8/navigator.py
index 5e8cb99e01e3..1589e45f4763 100644
--- a/sc/qa/uitest/calc_tests8/navigator.py
+++ b/sc/qa/uitest/calc_tests8/navigator.py
@@ -18,7 +18,7 @@ class navigator(UITestCase):
         xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
 
         xCalcDoc = self.xUITest.getTopFocusWindow()
-        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanelParent")
+        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
         xContentBox = xNavigatorPanel.getChild('contentbox')
         xSheets = xContentBox.getChild("0")
         self.assertEqual(get_state_as_dict(xSheets)['Text'], 'Sheets')
@@ -45,7 +45,7 @@ class navigator(UITestCase):
         self.ui_test.close_dialog_through_button(xOKBtn)
 
         xCalcDoc = self.xUITest.getTopFocusWindow()
-        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanelParent")
+        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
         xContentBox = xNavigatorPanel.getChild('contentbox')
         xSheets = xContentBox.getChild("0")
         self.assertEqual(get_state_as_dict(xSheets)['Text'], 'Sheets')
@@ -61,7 +61,7 @@ class navigator(UITestCase):
         self.xUITest.executeCommand(".uno:Undo")
 
         xCalcDoc = self.xUITest.getTopFocusWindow()
-        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanelParent")
+        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
         xContentBox = xNavigatorPanel.getChild('contentbox')
         xSheets = xContentBox.getChild("0")
         self.assertEqual(get_state_as_dict(xSheets)['Text'], 'Sheets')
@@ -90,7 +90,7 @@ class navigator(UITestCase):
         xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
 
         xCalcDoc = self.xUITest.getTopFocusWindow()
-        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanelParent")
+        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
         xToolBar = xNavigatorPanel.getChild("toolbox2")
         xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'toggle' button
 
@@ -124,7 +124,7 @@ class navigator(UITestCase):
         xGridWin.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "ScNavigatorPanel"}))
 
         xCalcDoc = self.xUITest.getTopFocusWindow()
-        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanelParent")
+        xNavigatorPanel = xCalcDoc.getChild("NavigatorPanel")
         xToolBar = xNavigatorPanel.getChild("toolbox2")
         xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'toggle' button
 
diff --git a/sc/source/ui/formdlg/dwfunctr.cxx b/sc/source/ui/formdlg/dwfunctr.cxx
index e5adb6859be2..68aacb9275ba 100644
--- a/sc/source/ui/formdlg/dwfunctr.cxx
+++ b/sc/source/ui/formdlg/dwfunctr.cxx
@@ -44,8 +44,8 @@
 #*
 #************************************************************************/
 
-ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame> &rFrame)
-    : PanelLayout(pParent, "FunctionPanel", "modules/scalc/ui/functionpanel.ui", rFrame)
+ScFunctionWin::ScFunctionWin(weld::Widget* pParent)
+    : PanelLayout(pParent, "FunctionPanel", "modules/scalc/ui/functionpanel.ui")
     , xCatBox(m_xBuilder->weld_combo_box("category"))
     , xFuncList(m_xBuilder->weld_tree_view("funclist"))
     , xInsertButton(m_xBuilder->weld_button("insert"))
@@ -70,8 +70,6 @@ ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const css::uno::Reference<css
     xCatBox->set_active(0);
 
     SelComboHdl(*xCatBox);
-
-    m_pInitialFocusWidget = xCatBox.get();
 }
 
 /*************************************************************************
@@ -90,22 +88,14 @@ ScFunctionWin::ScFunctionWin(vcl::Window* pParent, const css::uno::Reference<css
 
 ScFunctionWin::~ScFunctionWin()
 {
-    disposeOnce();
-}
+    xConfigChange.reset();
+    xConfigListener->dispose();
+    xConfigListener.clear();
 
-void ScFunctionWin::dispose()
-{
-    if (xConfigChange)
-    {
-        xConfigChange.reset();
-        xConfigListener->dispose();
-        xConfigListener.clear();
-    }
     xCatBox.reset();
     xFuncList.reset();
     xInsertButton.reset();
     xFiFuncDesc.reset();
-    PanelLayout::dispose();
 }
 
 /*************************************************************************
@@ -277,9 +267,10 @@ void ScFunctionWin::DoEnter()
         ScInputHandler* pHdl = pScMod->GetInputHdl( pViewSh );
         if(!pScMod->IsEditMode())
         {
+            rtl::Reference<comphelper::ConfigurationListener> xDetectDisposed(xConfigListener);
             pScMod->SetInputMode(SC_INPUT_TABLE);
             // the above call can result in us being disposed
-            if (OutputDevice::isDisposed())
+            if (xDetectDisposed->isDisposed())
                 return;
             aString = "=" + xFuncList->get_selected_text();
             if (pHdl)
@@ -412,8 +403,8 @@ IMPL_LINK_NOARG( ScFunctionWin, SetRowActivatedHdl, weld::TreeView&, bool )
 void EnglishFunctionNameChange::setProperty(const css::uno::Any &rProperty)
 {
     ConfigurationListenerProperty::setProperty(rProperty);
-    m_xFunctionWin->InitLRUList();
-    m_xFunctionWin->UpdateFunctionList();
+    m_pFunctionWin->InitLRUList();
+    m_pFunctionWin->UpdateFunctionList();
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/content.hxx b/sc/source/ui/inc/content.hxx
index a32aab9f48a2..70cf3fff38ba 100644
--- a/sc/source/ui/inc/content.hxx
+++ b/sc/source/ui/inc/content.hxx
@@ -45,7 +45,7 @@ class ScContentTree
     std::unique_ptr<weld::TreeView> m_xTreeView;
     std::unique_ptr<weld::TreeIter> m_xScratchIter;
     rtl::Reference<ScLinkTransferObj> m_xTransferObj;
-    VclPtr<ScNavigatorDlg>  pParentWindow;
+    ScNavigatorDlg*  pParentWindow;
     o3tl::enumarray<ScContentId, std::unique_ptr<weld::TreeIter>> m_aRootNodes;
     ScContentId             nRootType;          // set as Root
     OUString                aManualDoc;         // Switched in Navigator (Title)
diff --git a/sc/source/ui/inc/dwfunctr.hxx b/sc/source/ui/inc/dwfunctr.hxx
index e9dc66132fa0..742d15c30a5d 100644
--- a/sc/source/ui/inc/dwfunctr.hxx
+++ b/sc/source/ui/inc/dwfunctr.hxx
@@ -29,13 +29,13 @@ class ScFunctionWin;
 
 class EnglishFunctionNameChange : public comphelper::ConfigurationListenerProperty<bool>
 {
-    VclPtr<ScFunctionWin> m_xFunctionWin;
+    ScFunctionWin* m_pFunctionWin;
 protected:
     virtual void setProperty(const css::uno::Any &rProperty) override;
 public:
     EnglishFunctionNameChange(const rtl::Reference<comphelper::ConfigurationListener> &rListener, ScFunctionWin* pFunctionWin)
         : ConfigurationListenerProperty(rListener, "EnglishFunctionName")
-        , m_xFunctionWin(pFunctionWin)
+        , m_pFunctionWin(pFunctionWin)
     {
     }
 };
@@ -66,10 +66,9 @@ private:
                     DECL_LINK( SelTreeHdl, weld::TreeView&, void );
 
 public:
-    ScFunctionWin(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame> &rFrame);
+    ScFunctionWin(weld::Widget* pParent);
 
     virtual ~ScFunctionWin() override;
-    virtual void    dispose() override;
 
     void            InitLRUList();
     void            UpdateFunctionList();
diff --git a/sc/source/ui/inc/navipi.hxx b/sc/source/ui/inc/navipi.hxx
index 37f6bffffbb1..1229f812a59d 100644
--- a/sc/source/ui/inc/navipi.hxx
+++ b/sc/source/ui/inc/navipi.hxx
@@ -105,6 +105,8 @@ private:
     std::unique_ptr<weld::ComboBox> m_xLbDocuments;
     std::unique_ptr<weld::Menu> m_xDragModeMenu;
 
+    VclPtr<SfxNavigator> m_xNavigatorDlg;
+
     Size            aExpandedSize;
     Idle            aContentIdle;
 
@@ -168,16 +170,17 @@ private:
     void    StartOfDataArea ();
     void    EndOfDataArea   ();
 
+    void    UpdateInitShow();
+
     static void ReleaseFocus();
 
 public:
-    ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent);
+    ScNavigatorDlg(SfxBindings* pB, weld::Widget* pParent, SfxNavigator* pNavigatorDlg);
+    virtual weld::Window* GetFrameWeld() const override;
     virtual ~ScNavigatorDlg() override;
-    virtual void dispose() override;
 
     virtual void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) override;
 
-    virtual void StateChanged(StateChangedType nStateChange) override;
 };
 
 class ScNavigatorWrapper final : public SfxNavigatorWrapper
diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx
index 8a9b221ab8d0..90098d4fa68e 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -160,7 +160,6 @@ ScContentTree::~ScContentTree()
         Application::RemoveUserEvent(m_nAsyncMouseReleaseId);
         m_nAsyncMouseReleaseId = nullptr;
     }
-    pParentWindow.clear();
 }
 
 static const char* SCSTR_CONTENT_ARY[] =
diff --git a/sc/source/ui/navipi/navipi.cxx b/sc/source/ui/navipi/navipi.cxx
index 1759bf7cea23..f36a740dce9a 100644
--- a/sc/source/ui/navipi/navipi.cxx
+++ b/sc/source/ui/navipi/navipi.cxx
@@ -312,12 +312,13 @@ ScNavigatorSettings::ScNavigatorSettings()
 class ScNavigatorWin : public SfxNavigator
 {
 private:
-    VclPtr<ScNavigatorDlg> pNavigator;
+    std::unique_ptr<ScNavigatorDlg> m_xNavigator;
 public:
     ScNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* pMgr, vcl::Window* pParent);
+    virtual void StateChanged(StateChangedType nStateChange) override;
     virtual void dispose() override
     {
-        pNavigator.disposeAndClear();
+        m_xNavigator.reset();
         SfxNavigator::dispose();
     }
     virtual ~ScNavigatorWin() override
@@ -329,13 +330,12 @@ public:
 ScNavigatorWin::ScNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Window* _pParent)
     : SfxNavigator(_pBindings, _pMgr, _pParent)
 {
-    pNavigator = VclPtr<ScNavigatorDlg>::Create(_pBindings, this);
-    pNavigator->Show();
-    SetMinOutputSizePixel(pNavigator->GetOptimalSize());
+    m_xNavigator = std::make_unique<ScNavigatorDlg>(_pBindings, m_xContainer.get(), this);
+    SetMinOutputSizePixel(GetOptimalSize());
 }
 
-ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent)
-    : PanelLayout(pParent, "NavigatorPanel", "modules/scalc/ui/navigatorpanel.ui", nullptr)
+ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, weld::Widget* pParent, SfxNavigator* pNavigatorDlg)
+    : PanelLayout(pParent, "NavigatorPanel", "modules/scalc/ui/navigatorpanel.ui")
     , rBindings(*pB)
     , m_xEdCol(m_xBuilder->weld_spin_button("column"))
     , m_xEdRow(m_xBuilder->weld_spin_button("row"))
@@ -347,6 +347,7 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent)
         ScResId(SCSTR_QHLP_SCEN_LISTBOX), ScResId(SCSTR_QHLP_SCEN_COMMENT)))
     , m_xLbDocuments(m_xBuilder->weld_combo_box("documents"))
     , m_xDragModeMenu(m_xBuilder->weld_menu("dragmodemenu"))
+    , m_xNavigatorDlg(pNavigatorDlg)
     , aStrActiveWin(ScResId(SCSTR_ACTIVEWIN))
     , pViewData(nullptr )
     , eListMode(NAV_LMODE_NONE)
@@ -355,7 +356,7 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent)
     , nCurRow(0)
     , nCurTab(0)
 {
-    set_id("NavigatorPanelParent"); // for uitests
+    UpdateInitShow();
 
     UpdateSheetLimits();
     m_xEdRow->set_width_chars(5);
@@ -422,10 +423,13 @@ ScNavigatorDlg::ScNavigatorDlg(SfxBindings* pB, vcl::Window* pParent)
     else
         eNavMode = NAV_LMODE_AREAS;
     SetListMode(eNavMode);
+}
 
-    aExpandedSize = m_xContainer->get_preferred_size();
-
-    m_pInitialFocusWidget = m_xEdCol.get();
+weld::Window* ScNavigatorDlg::GetFrameWeld() const
+{
+    if (m_xNavigatorDlg)
+        return m_xNavigatorDlg->GetFrameWeld();
+    return PanelLayout::GetFrameWeld();
 }
 
 void ScNavigatorDlg::UpdateSheetLimits()
@@ -439,24 +443,22 @@ void ScNavigatorDlg::UpdateSheetLimits()
     }
 }
 
-void ScNavigatorDlg::StateChanged(StateChangedType nStateChange)
+void ScNavigatorDlg::UpdateInitShow()
 {
-    PanelLayout::StateChanged(nStateChange);
-    if (nStateChange == StateChangedType::InitShow)
-    {
-        // When the navigator is displayed in the sidebar, or is otherwise
-        // docked, it has the whole deck to fill. Therefore hide the button that
-        // hides all controls below the top two rows of buttons.
-        m_xTbxCmd1->set_item_visible("contents", ParentIsFloatingWindow(GetParent()));
-    }
+    // When the navigator is displayed in the sidebar, or is otherwise
+    // docked, it has the whole deck to fill. Therefore hide the button that
+    // hides all controls below the top two rows of buttons.
+    m_xTbxCmd1->set_item_visible("contents", ParentIsFloatingWindow(m_xNavigatorDlg));
 }
 
-ScNavigatorDlg::~ScNavigatorDlg()
+void ScNavigatorWin::StateChanged(StateChangedType nStateChange)
 {
-    disposeOnce();
+    SfxNavigator::StateChanged(nStateChange);
+    if (nStateChange == StateChangedType::InitShow)
+        m_xNavigator->UpdateInitShow();
 }
 
-void ScNavigatorDlg::dispose()
+ScNavigatorDlg::~ScNavigatorDlg()
 {
     aContentIdle.Stop();
 
@@ -476,7 +478,6 @@ void ScNavigatorDlg::dispose()
     m_xWndScenarios.reset();
     m_xScenarioBox.reset();
     m_xLbDocuments.reset();
-    PanelLayout::dispose();
 }
 
 void ScNavigatorDlg::Notify( SfxBroadcaster&, const SfxHint& rHint )
@@ -764,11 +765,11 @@ void ScNavigatorDlg::SetListMode(NavListMode eMode)
 {
     if (eMode != eListMode)
     {
-        bool bForceParentResize = ParentIsFloatingWindow(GetParent()) &&
+        bool bForceParentResize = ParentIsFloatingWindow(m_xNavigatorDlg) &&
                                   (eMode == NAV_LMODE_NONE || eListMode == NAV_LMODE_NONE);
-        SfxNavigator* pNav = bForceParentResize ? dynamic_cast<SfxNavigator*>(GetParent()) : nullptr;
+        SfxNavigator* pNav = bForceParentResize ? m_xNavigatorDlg.get() : nullptr;
         if (pNav && eMode == NAV_LMODE_NONE) //save last normal size on minimizing
-            aExpandedSize = GetSizePixel();
+            aExpandedSize = pNav->GetSizePixel();
 
         eListMode = eMode;
 
@@ -796,7 +797,8 @@ void ScNavigatorDlg::SetListMode(NavListMode eMode)
 
         if (pNav)
         {
-            Size aOptimalSize(m_xContainer->get_preferred_size());
+            pNav->InvalidateChildSizeCache();
+            Size aOptimalSize(pNav->GetOptimalSize());
             Size aNewSize(pNav->GetOutputSizePixel());
             aNewSize.setHeight( eMode == NAV_LMODE_NONE ? aOptimalSize.Height() : aExpandedSize.Height() );
             pNav->SetMinOutputSizePixel(aOptimalSize);
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
index 135772d669d9..ff91ad41c0b0 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -37,10 +37,10 @@ using namespace css::uno;
 namespace sc::sidebar {
 
 AlignmentPropertyPanel::AlignmentPropertyPanel(
-    vcl::Window* pParent,
+    weld::Widget* pParent,
     const css::uno::Reference<css::frame::XFrame>& rxFrame,
     SfxBindings* pBindings)
-    : PanelLayout(pParent, "AlignmentPropertyPanel", "modules/scalc/ui/sidebaralignment.ui", rxFrame)
+    : PanelLayout(pParent, "AlignmentPropertyPanel", "modules/scalc/ui/sidebaralignment.ui")
     , mxFTLeftIndent(m_xBuilder->weld_label("leftindentlabel"))
     , mxMFLeftIndent(m_xBuilder->weld_metric_spin_button("leftindent", FieldUnit::POINT))
     , mxCBXWrapText(m_xBuilder->weld_check_button("wraptext"))
@@ -73,15 +73,9 @@ AlignmentPropertyPanel::AlignmentPropertyPanel(
     , mpBindings(pBindings)
 {
     Initialize();
-    m_pInitialFocusWidget = &mxMFLeftIndent->get_widget();
 }
 
 AlignmentPropertyPanel::~AlignmentPropertyPanel()
-{
-    disposeOnce();
-}
-
-void AlignmentPropertyPanel::dispose()
 {
     mxIndentButtonsDispatch.reset();
     mxIndentButtons.reset();
@@ -111,8 +105,6 @@ void AlignmentPropertyPanel::dispose()
     maAngleControl.dispose();
     maVrtStackControl.dispose();
     maRefEdgeControl.dispose();
-
-    PanelLayout::dispose();
 }
 
 void AlignmentPropertyPanel::Initialize()
@@ -199,8 +191,8 @@ IMPL_LINK_NOARG(AlignmentPropertyPanel, CBOXWrapTextClkHdl, weld::ToggleButton&,
             SfxCallMode::RECORD, { &aItem });
 }
 
-VclPtr<PanelLayout> AlignmentPropertyPanel::Create (
-    vcl::Window* pParent,
+std::unique_ptr<PanelLayout> AlignmentPropertyPanel::Create (
+    weld::Widget* pParent,
     const css::uno::Reference<css::frame::XFrame>& rxFrame,
     SfxBindings* pBindings)
 {
@@ -211,14 +203,9 @@ VclPtr<PanelLayout> AlignmentPropertyPanel::Create (
     if (pBindings == nullptr)
         throw lang::IllegalArgumentException("no SfxBindings given to AlignmentPropertyPanel::Create", nullptr, 2);
 
-    return  VclPtr<AlignmentPropertyPanel>::Create(
-                        pParent, rxFrame, pBindings);
+    return std::make_unique<AlignmentPropertyPanel>(pParent, rxFrame, pBindings);
 }
 
-void AlignmentPropertyPanel::DataChanged(
-    const DataChangedEvent&)
-{}
-
 void AlignmentPropertyPanel::HandleContextChange(
     const vcl::EnumContext& rContext)
 {
diff --git a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
index f6f09c11e992..c849a7e9e3f3 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.hxx
@@ -33,14 +33,11 @@ class AlignmentPropertyPanel
     public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
 {
 public:
-    static VclPtr<PanelLayout> Create(
-        vcl::Window* pParent,
+    static std::unique_ptr<PanelLayout> Create(
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         SfxBindings* pBindings);
 
-    virtual void DataChanged(
-        const DataChangedEvent& rEvent) override;
-
     virtual void HandleContextChange(
         const vcl::EnumContext& rContext) override;
 
@@ -57,11 +54,10 @@ public:
 
     // constructor/destructor
     AlignmentPropertyPanel(
-        vcl::Window* pParent,
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         SfxBindings* pBindings);
     virtual ~AlignmentPropertyPanel() override;
-    virtual void dispose() override;
 
 private:
     //ui controls
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
index 15b1ffad6396..188a638e7315 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -44,10 +44,10 @@ constexpr OStringLiteral LINESTYLE = "LineStyle";
 namespace sc::sidebar {
 
 CellAppearancePropertyPanel::CellAppearancePropertyPanel(
-    vcl::Window* pParent,
+    weld::Widget* pParent,
     const css::uno::Reference<css::frame::XFrame>& rxFrame,
     SfxBindings* pBindings)
-:   PanelLayout(pParent, "CellAppearancePropertyPanel", "modules/scalc/ui/sidebarcellappearance.ui", rxFrame),
+:   PanelLayout(pParent, "CellAppearancePropertyPanel", "modules/scalc/ui/sidebarcellappearance.ui"),
 
     mxTBCellBorder(m_xBuilder->weld_toolbar("cellbordertype")),
     mxTBCellBackground(m_xBuilder->weld_toolbar("cellbackgroundcolor")),
@@ -105,11 +105,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
 }
 
 CellAppearancePropertyPanel::~CellAppearancePropertyPanel()
-{
-    disposeOnce();
-}
-
-void CellAppearancePropertyPanel::dispose()
 {
     mxCellBorderPopoverContainer.reset();
     mxTBCellBorder.reset();
@@ -126,8 +121,6 @@ void CellAppearancePropertyPanel::dispose()
     maGridShowControl.dispose();
     maBorderTLBRControl.dispose();
     maBorderBLTRControl.dispose();
-
-    PanelLayout::dispose();
 }
 
 void CellAppearancePropertyPanel::Initialize()
@@ -184,8 +177,8 @@ IMPL_LINK_NOARG(CellAppearancePropertyPanel, TbxLineStyleMenuHdl, const OString&
     pPopup->GrabFocus();
 }
 
-VclPtr<PanelLayout> CellAppearancePropertyPanel::Create (
-    vcl::Window* pParent,
+std::unique_ptr<PanelLayout> CellAppearancePropertyPanel::Create (
+    weld::Widget* pParent,
     const css::uno::Reference<css::frame::XFrame>& rxFrame,
     SfxBindings* pBindings)
 {
@@ -196,14 +189,9 @@ VclPtr<PanelLayout> CellAppearancePropertyPanel::Create (
     if (pBindings == nullptr)
         throw lang::IllegalArgumentException("no SfxBindings given to CellAppearancePropertyPanel::Create", nullptr, 2);
 
-    return VclPtr<CellAppearancePropertyPanel>::Create(
-                        pParent, rxFrame, pBindings);
+    return std::make_unique<CellAppearancePropertyPanel>(pParent, rxFrame, pBindings);
 }
 
-void CellAppearancePropertyPanel::DataChanged(
-    const DataChangedEvent&)
-{}
-
 void CellAppearancePropertyPanel::HandleContextChange(const vcl::EnumContext& rContext)
 {
     if (maContext == rContext)
diff --git a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
index d90e57b0bc35..a0249a7249c2 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -24,6 +24,7 @@
 #include <sfx2/sidebar/PanelLayout.hxx>
 #include <vcl/EnumContext.hxx>
 #include <vcl/image.hxx>
+#include <com/sun/star/frame/XFrame.hpp>
 
 class ToolbarUnoDispatcher;
 class ToolbarPopupContainer;
@@ -40,14 +41,11 @@ private:
     friend class CellBorderStylePopup;
 
 public:
-    static VclPtr<PanelLayout> Create(
-        vcl::Window* pParent,
+    static std::unique_ptr<PanelLayout> Create(
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         SfxBindings* pBindings);
 
-    virtual void DataChanged(
-        const DataChangedEvent& rEvent) override;
-
     virtual void HandleContextChange(
         const vcl::EnumContext& rContext) override;
 
@@ -64,11 +62,10 @@ public:
 
     // constructor/destructor
     CellAppearancePropertyPanel(
-        vcl::Window* pParent,
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         SfxBindings* pBindings);
     virtual ~CellAppearancePropertyPanel() override;
-    virtual void dispose() override;
 
 private:
     //ui controls
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
index e3e95e50a710..93dd19da0c98 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx
@@ -31,10 +31,10 @@ using namespace css::uno;
 namespace sc::sidebar {
 
 NumberFormatPropertyPanel::NumberFormatPropertyPanel(
-    vcl::Window* pParent,
+    weld::Widget* pParent,
     const css::uno::Reference<css::frame::XFrame>& rxFrame,
     SfxBindings* pBindings)
-    : PanelLayout(pParent,"NumberFormatPropertyPanel", "modules/scalc/ui/sidebarnumberformat.ui", rxFrame)
+    : PanelLayout(pParent,"NumberFormatPropertyPanel", "modules/scalc/ui/sidebarnumberformat.ui")
     , mxLbCategory(m_xBuilder->weld_combo_box("numberformatcombobox"))
     , mxTBCategory(m_xBuilder->weld_toolbar("numberformat"))
     , mxCategoryDispatch(new ToolbarUnoDispatcher(*mxTBCategory, *m_xBuilder, rxFrame))
@@ -54,15 +54,9 @@ NumberFormatPropertyPanel::NumberFormatPropertyPanel(
     , mpBindings(pBindings)
 {
     Initialize();
-    m_pInitialFocusWidget = mxLbCategory.get();
 }
 
 NumberFormatPropertyPanel::~NumberFormatPropertyPanel()
-{
-    disposeOnce();
-}
-
-void NumberFormatPropertyPanel::dispose()
 {
     mxLbCategory.reset();
     mxCategoryDispatch.reset();
@@ -79,8 +73,6 @@ void NumberFormatPropertyPanel::dispose()
 
     maNumFormatControl.dispose();
     maFormatControl.dispose();
-
-    PanelLayout::dispose();
 }
 
 void NumberFormatPropertyPanel::Initialize()
@@ -151,8 +143,8 @@ IMPL_LINK_NOARG( NumberFormatPropertyPanel, NumFormatValueHdl, weld::SpinButton&
             SfxCallMode::RECORD, { &aItem });
 }
 
-VclPtr<PanelLayout> NumberFormatPropertyPanel::Create (
-    vcl::Window* pParent,
+std::unique_ptr<PanelLayout> NumberFormatPropertyPanel::Create (
+    weld::Widget* pParent,
     const css::uno::Reference<css::frame::XFrame>& rxFrame,
     SfxBindings* pBindings)
 {
@@ -163,14 +155,9 @@ VclPtr<PanelLayout> NumberFormatPropertyPanel::Create (
     if (pBindings == nullptr)
         throw lang::IllegalArgumentException("no SfxBindings given to NumberFormatPropertyPanel::Create", nullptr, 2);
 
-    return  VclPtr<NumberFormatPropertyPanel>::Create(
-                        pParent, rxFrame, pBindings);
+    return std::make_unique<NumberFormatPropertyPanel>(pParent, rxFrame, pBindings);
 }
 
-void NumberFormatPropertyPanel::DataChanged(
-    const DataChangedEvent&)
-{}
-
 void NumberFormatPropertyPanel::HandleContextChange(
     const vcl::EnumContext& rContext)
 {
diff --git a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
index 7d67d630dfdf..8505829c5a89 100644
--- a/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
+++ b/sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx
@@ -34,14 +34,11 @@ class NumberFormatPropertyPanel
 {
 public:
 public:
-    static VclPtr<PanelLayout> Create(
-        vcl::Window* pParent,
+    static std::unique_ptr<PanelLayout> Create(
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         SfxBindings* pBindings);
 
-    virtual void DataChanged(
-        const DataChangedEvent& rEvent) override;
-
     virtual void HandleContextChange(
         const vcl::EnumContext& rContext) override;
 
@@ -58,11 +55,10 @@ public:
 
     // constructor/destructor
     NumberFormatPropertyPanel(
-        vcl::Window* pParent,
+        weld::Widget* pParent,
         const css::uno::Reference<css::frame::XFrame>& rxFrame,
         SfxBindings* pBindings);
     virtual ~NumberFormatPropertyPanel() override;
-    virtual void dispose() override;
 private:
     //ui controls
     std::unique_ptr<weld::ComboBox> mxLbCategory;
diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx
index 9459178886b3..67c949475023 100644
--- a/sc/source/ui/sidebar/ScPanelFactory.cxx
+++ b/sc/source/ui/sidebar/ScPanelFactory.cxx
@@ -26,8 +26,7 @@
 #include <dwfunctr.hxx>
 
 #include <sfx2/sidebar/SidebarPanelBase.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
-#include <vcl/window.hxx>
+#include <vcl/weldutils.hxx>
 #include <com/sun/star/lang/WrappedTargetRuntimeException.hpp>
 #include <comphelper/namedvaluecollection.hxx>
 #include <cppuhelper/exc_hlp.hxx>
@@ -61,8 +60,11 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
         const sal_uInt64 nBindingsValue (aArguments.getOrDefault("SfxBindings", sal_uInt64(0)));
         SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue);
 
-        VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(xParentWindow);
-        if ( ! xParentWindow.is() || pParentWindow==nullptr)
+        weld::Widget* pParent(nullptr);
+        if (weld::TransportAsXWindow* pTunnel = dynamic_cast<weld::TransportAsXWindow*>(xParentWindow.get()))
+            pParent = pTunnel->getWidget();
+
+        if (!pParent)
             throw RuntimeException(
                 "PanelFactory::createUIElement called without ParentWindow",
                 nullptr);
@@ -76,29 +78,29 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement (
                 nullptr);
 
         sal_Int32 nMinimumSize = -1;
-        VclPtr<PanelLayout> pPanel;
+        std::unique_ptr<PanelLayout> xPanel;
         if (rsResourceURL.endsWith("/AlignmentPropertyPanel"))
-            pPanel = AlignmentPropertyPanel::Create( pParentWindow, xFrame, pBindings );
+            xPanel = AlignmentPropertyPanel::Create( pParent, xFrame, pBindings );
         else if (rsResourceURL.endsWith("/CellAppearancePropertyPanel"))
-            pPanel = CellAppearancePropertyPanel::Create( pParentWindow, xFrame, pBindings );
+            xPanel = CellAppearancePropertyPanel::Create( pParent, xFrame, pBindings );
         else if (rsResourceURL.endsWith("/NumberFormatPropertyPanel"))
-            pPanel = NumberFormatPropertyPanel::Create( pParentWindow, xFrame, pBindings );
+            xPanel = NumberFormatPropertyPanel::Create( pParent, xFrame, pBindings );
         else if (rsResourceURL.endsWith("/NavigatorPanel"))
         {
-            pPanel = VclPtr<ScNavigatorDlg>::Create(pBindings, pParentWindow);
+            xPanel = std::make_unique<ScNavigatorDlg>(pBindings, pParent, nullptr);
             nMinimumSize = 0;
         }
         else if (rsResourceURL.endsWith("/FunctionsPanel"))
         {
-            pPanel = VclPtr<ScFunctionWin>::Create(pParentWindow, xFrame);
+            xPanel = std::make_unique<ScFunctionWin>(pParent);
             nMinimumSize = 0;
         }
 
-        if (pPanel)
+        if (xPanel)
             xElement = sfx2::sidebar::SidebarPanelBase::Create(
                 rsResourceURL,
                 xFrame,
-                pPanel,
+                std::move(xPanel),
                 ui::LayoutSize(nMinimumSize,-1,-1));
     }
     catch (const uno::RuntimeException &)
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 25a3430b307e..3c7867d1b07a 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2306,10 +2306,9 @@ void SdTiledRenderingTest::testTdf115873()
     SfxViewShell* pViewShell = SfxViewShell::Current();
     CPPUNIT_ASSERT(pViewShell);
     SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
-    ScopedVclPtrInstance<SdNavigatorWin> pNavigator(nullptr, &rBindings);
-    pNavigator->InitTreeLB(pXImpressDocument->GetDoc());
-    pNavigator->Show();
-    SdPageObjsTLV& rObjects = pNavigator->GetObjects();
+    auto xNavigator = std::make_unique<SdNavigatorWin>(nullptr, &rBindings, nullptr);
+    xNavigator->InitTreeLB(pXImpressDocument->GetDoc());
+    SdPageObjsTLV& rObjects = xNavigator->GetObjects();
     rObjects.SelectEntry(u"Slide 1");
     rObjects.Select();
     sd::ViewShell* pSdViewShell = pXImpressDocument->GetDocShell()->GetViewShell();
@@ -2340,9 +2339,9 @@ void SdTiledRenderingTest::testTdf115873Group()
     SfxViewShell* pViewShell = SfxViewShell::Current();
     CPPUNIT_ASSERT(pViewShell);
     SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings();
-    ScopedVclPtrInstance<SdNavigatorWin> pNavigator(nullptr, &rBindings);
-    pNavigator->InitTreeLB(pXImpressDocument->GetDoc());
-    SdPageObjsTLV& rObjects = pNavigator->GetObjects();
+    auto xNavigator = std::make_unique<SdNavigatorWin>(nullptr, &rBindings, nullptr);
+    xNavigator->InitTreeLB(pXImpressDocument->GetDoc());
+    SdPageObjsTLV& rObjects = xNavigator->GetObjects();
     // This failed, Fill() and IsEqualToDoc() were out of sync for group
     // shapes.
     CPPUNIT_ASSERT(rObjects.IsEqualToDoc(pXImpressDocument->GetDoc()));
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 1764b4541c2d..4d1481872ae4 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -54,6 +54,7 @@
 
 #include <svx/unoapi.hxx>
 #include <svx/svxids.hrc>
+#include <svx/colorwindow.hxx>
 #include <DrawDocShell.hxx>
 #include <ViewShellBase.hxx>
 #include <DrawViewShell.hxx>
@@ -117,9 +118,8 @@ void fillRepeatComboBox(weld::ComboBox& rBox)
     rBox.append_text(aEndOfSlide);
 }
 
-CustomAnimationPane::CustomAnimationPane( Window* pParent, ViewShellBase& rBase,
-                                          const css::uno::Reference<css::frame::XFrame>& rxFrame )
-    : PanelLayout(pParent, "CustomAnimationsPanel", "modules/simpress/ui/customanimationspanel.ui", rxFrame)
+CustomAnimationPane::CustomAnimationPane( weld::Widget* pParent, ViewShellBase& rBase )
+    : PanelLayout(pParent, "CustomAnimationsPanel", "modules/simpress/ui/customanimationspanel.ui")
     , mrBase(rBase)
     // load resources
     , mxFTAnimation(m_xBuilder->weld_label("effectlabel"))
@@ -154,7 +154,6 @@ CustomAnimationPane::CustomAnimationPane( Window* pParent, ViewShellBase& rBase,
     , maLateInitTimer()
 {
     initialize();
-    m_pInitialFocusWidget = &mxCustomAnimationList->get_widget();
 }
 
 css::ui::LayoutSize CustomAnimationPane::GetHeightForWidth(const sal_Int32 /*nWidth*/)
@@ -212,15 +211,9 @@ void CustomAnimationPane::initialize()
     maLateInitTimer.SetTimeout(100);
     maLateInitTimer.SetInvokeHandler(LINK(this, CustomAnimationPane, lateInitCallback));
     maLateInitTimer.Start();
-    UpdateLook();
 }
 
 CustomAnimationPane::~CustomAnimationPane()
-{
-    disposeOnce();
-}
-
-void CustomAnimationPane::dispose()
 {
     maLateInitTimer.Stop();
 
@@ -253,8 +246,6 @@ void CustomAnimationPane::dispose()
     mxLBCategory.reset();
     mxFTAnimation.reset();
     mxLBAnimation.reset();
-
-    PanelLayout::dispose();
 }
 
 void CustomAnimationPane::addUndo()
@@ -866,19 +857,6 @@ void CustomAnimationPane::onContextMenu(const OString &rIdent)
     updateControls();
 }
 
-void CustomAnimationPane::DataChanged (const DataChangedEvent&)
-{
-    UpdateLook();
-}
-
-void CustomAnimationPane::UpdateLook()
-{
-    Color aBackground (
-        ::sfx2::sidebar::Theme::GetColor(
-            ::sfx2::sidebar::Theme::Color_PanelBackground));
-    SetBackground(aBackground);
-}
-
 static void addValue( const std::unique_ptr<STLPropertySet>& pSet, sal_Int32 nHandle, const Any& rValue )
 {
     switch( pSet->getPropertyState( nHandle ) )
diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx
index ea56c90f9902..5a509fb448a9 100644
--- a/sd/source/ui/animations/SlideTransitionPane.cxx
+++ b/sd/source/ui/animations/SlideTransitionPane.cxx
@@ -36,6 +36,7 @@
 #include <sal/log.hxx>
 #include <tools/debug.hxx>
 #include <svx/gallery.hxx>
+#include <svx/colorwindow.hxx>
 #include <vcl/stdtext.hxx>
 #include <vcl/svapp.hxx>
 #include <vcl/weld.hxx>
@@ -390,10 +391,9 @@ public:
 
 // SlideTransitionPane
 SlideTransitionPane::SlideTransitionPane(
-    Window * pParent,
-    ViewShellBase & rBase,
-    const css::uno::Reference<css::frame::XFrame>& rxFrame ) :
-        PanelLayout( pParent, "SlideTransitionsPanel", "modules/simpress/ui/slidetransitionspanel.ui", rxFrame ),
+    weld::Widget* pParent,
+    ViewShellBase & rBase) :
+        PanelLayout( pParent, "SlideTransitionsPanel", "modules/simpress/ui/slidetransitionspanel.ui" ),
 
         mrBase( rBase ),
         mpDrawDoc( rBase.GetDocShell() ? rBase.GetDocShell()->GetDoc() : nullptr ),
@@ -477,16 +477,9 @@ void SlideTransitionPane::Initialize(SdDrawDocument* pDoc)
     maLateInitTimer.SetTimeout(200);
     maLateInitTimer.SetInvokeHandler(LINK(this, SlideTransitionPane, LateInitCallback));
     maLateInitTimer.Start();
-
-    UpdateLook();
 }
 
 SlideTransitionPane::~SlideTransitionPane()
-{
-    disposeOnce();
-}
-
-void SlideTransitionPane::dispose()
 {
     maLateInitTimer.Stop();
     removeListener();
@@ -505,17 +498,6 @@ void SlideTransitionPane::dispose()
     mxPB_APPLY_TO_ALL.reset();
     mxPB_PLAY.reset();
     mxCB_AUTO_PREVIEW.reset();
-    PanelLayout::dispose();
-}
-
-void SlideTransitionPane::DataChanged (const DataChangedEvent&)
-{
-    UpdateLook();
-}
-
-void SlideTransitionPane::UpdateLook()
-{
-    SetBackground(::sfx2::sidebar::Theme::GetColor(::sfx2::sidebar::Theme::Color_PanelBackground));
 }
 
 void SlideTransitionPane::onSelectionChanged()
@@ -888,7 +870,7 @@ void SlideTransitionPane::applyToSelectedPages(bool bPreview = true)
     if(  mbUpdatingControls )
         return;
 
-    Window *pFocusWindow = Application::GetFocusWindow();
+    vcl::Window *pFocusWindow = Application::GetFocusWindow();
 
     ::sd::slidesorter::SharedPageSelection pSelectedPages( getSelectedPages());
     impl::TransitionEffect aEffect = getTransitionEffectFromControls();
diff --git a/sd/source/ui/dlg/NavigatorChildWindow.cxx b/sd/source/ui/dlg/NavigatorChildWindow.cxx
index 804a7ccad262..ba5d6a6154a9 100644
--- a/sd/source/ui/dlg/NavigatorChildWindow.cxx
+++ b/sd/source/ui/dlg/NavigatorChildWindow.cxx
@@ -42,29 +42,27 @@ static void RequestNavigatorUpdate (SfxBindings const * pBindings)
 
 SdNavigatorFloat::SdNavigatorFloat(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Window* _pParent)
     : SfxNavigator(_pBindings, _pMgr, _pParent)
+    , m_xNavWin(std::make_unique<SdNavigatorWin>(m_xContainer.get(), _pBindings, this))
 {
-    pNavWin = VclPtr<SdNavigatorWin>::Create(this, _pBindings);
-    pNavWin->Show();
-
-    pNavWin->SetUpdateRequestFunctor(
+    m_xNavWin->SetUpdateRequestFunctor(
         [_pBindings] () { return RequestNavigatorUpdate(_pBindings); });
 
-    SetMinOutputSizePixel(pNavWin->GetOptimalSize());
+    SetMinOutputSizePixel(GetOptimalSize());
 }
 
 void SdNavigatorFloat::InitTreeLB(const SdDrawDocument* pDoc)
 {
-    pNavWin->InitTreeLB(pDoc);
+    m_xNavWin->InitTreeLB(pDoc);
 }
 
 void SdNavigatorFloat::FreshTree(const SdDrawDocument* pDoc)
 {
-    pNavWin->FreshTree(pDoc);
+    m_xNavWin->FreshTree(pDoc);
 }
 
 void SdNavigatorFloat::dispose()
 {
-    pNavWin.disposeAndClear();
+    m_xNavWin.reset();
     SfxNavigator::dispose();
 }
 
diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx
index 569ff6a615a2..c0e2ec79992e 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -49,13 +49,14 @@
 /**
  * SdNavigatorWin - FloatingWindow
  */
-SdNavigatorWin::SdNavigatorWin(vcl::Window* pParent, SfxBindings* pInBindings)
-    : PanelLayout(pParent, "NavigatorPanel", "modules/simpress/ui/navigatorpanel.ui", nullptr)
+SdNavigatorWin::SdNavigatorWin(weld::Widget* pParent, SfxBindings* pInBindings, SfxNavigator* pNavigatorDlg)
+    : PanelLayout(pParent, "NavigatorPanel", "modules/simpress/ui/navigatorpanel.ui")
     , mxToolbox(m_xBuilder->weld_toolbar("toolbox"))
     , mxTlbObjects(new SdPageObjsTLV(m_xBuilder->weld_tree_view("tree")))
     , mxLbDocs(m_xBuilder->weld_combo_box("documents"))
     , mxDragModeMenu(m_xBuilder->weld_menu("dragmodemenu"))
     , mxShapeMenu(m_xBuilder->weld_menu("shapemenu"))
+    , mxNavigatorDlg(pNavigatorDlg)
     , mbDocImported ( false )
       // On changes of the DragType: adjust SelectionMode of TLB!
     , meDragType ( NAVIGATOR_DRAGTYPE_EMBEDDED )
@@ -90,8 +91,13 @@ SdNavigatorWin::SdNavigatorWin(vcl::Window* pParent, SfxBindings* pInBindings)
     mxToolbox->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl));
     mxTlbObjects->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl));
     mxLbDocs->connect_key_press(LINK(this, SdNavigatorWin, KeyInputHdl));
+}
 
-    m_pInitialFocusWidget = mxToolbox.get();
+weld::Window* SdNavigatorWin::GetFrameWeld() const
+{
+    if (mxNavigatorDlg)
+        return mxNavigatorDlg->GetFrameWeld();
+    return PanelLayout::GetFrameWeld();
 }
 
 void SdNavigatorWin::SetUpdateRequestFunctor(const UpdateRequestFunctor& rUpdateRequest)
@@ -105,11 +111,6 @@ void SdNavigatorWin::SetUpdateRequestFunctor(const UpdateRequestFunctor& rUpdate
 }
 
 SdNavigatorWin::~SdNavigatorWin()
-{
-    disposeOnce();
-}
-
-void SdNavigatorWin::dispose()
 {
     mpNavigatorCtrlItem.reset();
     mpPageNameCtrlItem.reset();
@@ -118,7 +119,6 @@ void SdNavigatorWin::dispose()
     mxToolbox.reset();
     mxTlbObjects.reset();
     mxLbDocs.reset();
-    PanelLayout::dispose();
 }
 
 //when object is marked , fresh the corresponding entry tree .
diff --git a/sd/source/ui/dlg/sdtreelb.cxx b/sd/source/ui/dlg/sdtreelb.cxx
index 1afad1a87d48..0f44d8971218 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -386,7 +386,7 @@ bool SdPageObjsTLV::StartDrag()
  */
 bool SdPageObjsTLV::DoDrag()
 {
-    if (!m_xNavigator)
+    if (!m_pNavigator)
         return true;
 
     if (!m_xHelper)
@@ -725,7 +725,7 @@ void SdPageObjsTLV::Select()
             m_aRowActivatedHdl.Call(*m_xTreeView);
     }
 
-    if (!m_xNavigator)
+    if (!m_pNavigator)
     {
         m_xHelper.clear();
         return;
@@ -733,7 +733,7 @@ void SdPageObjsTLV::Select()
 
     ::sd::DrawDocShell* pDocShell = m_pDoc->GetDocSh();
     OUString aURL = INetURLObject(pDocShell->GetMedium()->GetPhysicalName(), INetProtocol::File).GetMainURL(INetURLObject::DecodeMechanism::NONE);
-    NavigatorDragType eDragType = m_xNavigator->GetNavigatorDragType();
+    NavigatorDragType eDragType = m_pNavigator->GetNavigatorDragType();
 
     OUString sSelectedEntry = m_xTreeView->get_selected_text();
     aURL += "#" + sSelectedEntry;
@@ -943,7 +943,7 @@ IMPL_LINK(SdPageObjsTLV, RequestingChildrenHdl, const weld::TreeIter&, rFileEntr
 
 void SdPageObjsTLV::SetSdNavigator(SdNavigatorWin* pNavigator)
 {
-    m_xNavigator = pNavigator;
+    m_pNavigator = pNavigator;
 }
 
 void SdPageObjsTLV::SetViewFrame(const SfxViewFrame* pViewFrame)
diff --git a/sd/source/ui/inc/CustomAnimationPane.hxx b/sd/source/ui/inc/CustomAnimationPane.hxx
index 1d795b20ce68..edb1a0b634dc 100644
--- a/sd/source/ui/inc/CustomAnimationPane.hxx
+++ b/sd/source/ui/inc/CustomAnimationPane.hxx
@@ -22,6 +22,7 @@
 
 #include <sfx2/sidebar/ILayoutableWindow.hxx>
 #include <sfx2/sidebar/PanelLayout.hxx>
+#include <vcl/idle.hxx>
 #include "CustomAnimationList.hxx"
 #include <misc/scopelock.hxx>
 
@@ -50,9 +51,8 @@ class CustomAnimationPane : public PanelLayout
 {
     friend class MotionPathTag;
 public:
-    CustomAnimationPane( vcl::Window* pParent, ViewShellBase& rBase, const css::uno::Reference<css::frame::XFrame>& rxFrame );
+    CustomAnimationPane(weld::Widget* pParent, ViewShellBase& rBase);
     virtual ~CustomAnimationPane() override;
-    virtual void dispose() override;
 
     // ILayoutableWindow
     virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) override;
@@ -76,9 +76,6 @@ public:
     virtual void onContextMenu(const OString& rIdent) override;
     virtual void onDragNDropComplete( std::vector< CustomAnimationEffectPtr > pEffectsDragged, CustomAnimationEffectPtr pEffectInsertBefore ) override;
 
-    // Window
-    virtual void DataChanged (const DataChangedEvent& rEvent) override;
-
     void addUndo();
 
     double getDuration() const;
@@ -100,7 +97,6 @@ private:
 
     static css::uno::Any getProperty1Value( sal_Int32 nType, const CustomAnimationEffectPtr& pEffect );
     static bool setProperty1Value( sal_Int32 nType, const CustomAnimationEffectPtr& pEffect, const css::uno::Any& rValue );
-    void UpdateLook();
     sal_Int32 fillAnimationLB( bool bHasText );
     PathKind getCreatePathKind() const;
     void createPath( PathKind eKind, std::vector< ::com::sun::star::uno::Any >& rTargets, double fDuration );

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list