summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--chart2/source/controller/sidebar/Chart2PanelFactory.cxx38
-rw-r--r--chart2/source/controller/sidebar/ChartAreaPanel.cxx16
-rw-r--r--chart2/source/controller/sidebar/ChartAreaPanel.hxx8
-rw-r--r--chart2/source/controller/sidebar/ChartAxisPanel.cxx29
-rw-r--r--chart2/source/controller/sidebar/ChartAxisPanel.hxx10
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.cxx28
-rw-r--r--chart2/source/controller/sidebar/ChartElementsPanel.hxx10
-rw-r--r--chart2/source/controller/sidebar/ChartErrorBarPanel.cxx30
-rw-r--r--chart2/source/controller/sidebar/ChartErrorBarPanel.hxx10
-rw-r--r--chart2/source/controller/sidebar/ChartLinePanel.cxx16
-rw-r--r--chart2/source/controller/sidebar/ChartLinePanel.hxx8
-rw-r--r--chart2/source/controller/sidebar/ChartSeriesPanel.cxx28
-rw-r--r--chart2/source/controller/sidebar/ChartSeriesPanel.hxx9
-rw-r--r--chart2/source/controller/sidebar/ChartTypePanel.cxx20
-rw-r--r--chart2/source/controller/sidebar/ChartTypePanel.hxx5
-rw-r--r--comphelper/source/misc/configuration.cxx1
-rw-r--r--include/comphelper/configurationlistener.hxx4
-rw-r--r--include/sfx2/navigat.hxx2
-rw-r--r--include/sfx2/sidebar/Panel.hxx3
-rw-r--r--include/sfx2/sidebar/PanelLayout.hxx48
-rw-r--r--include/sfx2/sidebar/SidebarPanelBase.hxx15
-rw-r--r--include/sfx2/templdlg.hxx3
-rw-r--r--include/svx/sidebar/AreaPropertyPanelBase.hxx9
-rw-r--r--include/svx/sidebar/InspectorTextPanel.hxx7
-rw-r--r--include/svx/sidebar/LinePropertyPanelBase.hxx4
-rw-r--r--officecfg/registry/data/org/openoffice/Office/UI/Sidebar.xcu145
-rw-r--r--officecfg/registry/schema/org/openoffice/Office/UI/Sidebar.xcs8
-rw-r--r--sc/qa/uitest/calc_tests8/navigator.py10
-rw-r--r--sc/source/ui/formdlg/dwfunctr.cxx27
-rw-r--r--sc/source/ui/inc/content.hxx2
-rw-r--r--sc/source/ui/inc/dwfunctr.hxx7
-rw-r--r--sc/source/ui/inc/navipi.hxx9
-rw-r--r--sc/source/ui/navipi/content.cxx1
-rw-r--r--sc/source/ui/navipi/navipi.cxx58
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.cxx23
-rw-r--r--sc/source/ui/sidebar/AlignmentPropertyPanel.hxx10
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx22
-rw-r--r--sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx15
-rw-r--r--sc/source/ui/sidebar/NumberFormatPropertyPanel.cxx23
-rw-r--r--sc/source/ui/sidebar/NumberFormatPropertyPanel.hxx10
-rw-r--r--sc/source/ui/sidebar/ScPanelFactory.cxx26
-rw-r--r--sd/qa/unit/tiledrendering/tiledrendering.cxx15
-rw-r--r--sd/source/ui/animations/CustomAnimationPane.cxx28
-rw-r--r--sd/source/ui/animations/SlideTransitionPane.cxx28
-rw-r--r--sd/source/ui/dlg/NavigatorChildWindow.cxx14
-rw-r--r--sd/source/ui/dlg/navigatr.cxx18
-rw-r--r--sd/source/ui/dlg/sdtreelb.cxx8
-rw-r--r--sd/source/ui/inc/CustomAnimationPane.hxx8
-rw-r--r--sd/source/ui/inc/SlideTransitionPane.hxx13
-rw-r--r--sd/source/ui/inc/TableDesignPane.hxx10
-rw-r--r--sd/source/ui/inc/navigatr.hxx13
-rw-r--r--sd/source/ui/inc/sdtreelb.hxx2
-rw-r--r--sd/source/ui/sidebar/AllMasterPagesSelector.cxx16
-rw-r--r--sd/source/ui/sidebar/AllMasterPagesSelector.hxx21
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx23
-rw-r--r--sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx21
-rw-r--r--sd/source/ui/sidebar/LayoutMenu.cxx18
-rw-r--r--sd/source/ui/sidebar/LayoutMenu.hxx5
-rw-r--r--sd/source/ui/sidebar/MasterPagesSelector.cxx13
-rw-r--r--sd/source/ui/sidebar/MasterPagesSelector.hxx3
-rw-r--r--sd/source/ui/sidebar/NavigatorWrapper.cxx9
-rw-r--r--sd/source/ui/sidebar/NavigatorWrapper.hxx2
-rw-r--r--sd/source/ui/sidebar/PanelFactory.cxx34
-rw-r--r--sd/source/ui/sidebar/RecentMasterPagesSelector.cxx22
-rw-r--r--sd/source/ui/sidebar/RecentMasterPagesSelector.hxx21
-rw-r--r--sd/source/ui/sidebar/SlideBackground.cxx28
-rw-r--r--sd/source/ui/sidebar/SlideBackground.hxx4
-rw-r--r--sfx2/UIConfig_sfx.mk1
-rw-r--r--sfx2/inc/sidebar/PanelDescriptor.hxx1
-rw-r--r--sfx2/source/appl/childwin.cxx6
-rw-r--r--sfx2/source/dialog/navigat.cxx15
-rw-r--r--sfx2/source/dialog/templdlg.cxx12
-rw-r--r--sfx2/source/inc/templdgi.hxx2
-rw-r--r--sfx2/source/sidebar/Panel.cxx35
-rw-r--r--sfx2/source/sidebar/PanelDescriptor.cxx2
-rw-r--r--sfx2/source/sidebar/PanelLayout.cxx124
-rw-r--r--sfx2/source/sidebar/ResourceManager.cxx3
-rw-r--r--sfx2/source/sidebar/SidebarPanelBase.cxx77
-rw-r--r--sfx2/uiconfig/ui/navigator.ui14
-rw-r--r--solenv/sanitizers/ui/sfx.suppr2
-rw-r--r--svx/inc/GalleryControl.hxx8
-rw-r--r--svx/inc/galbrws2.hxx1
-rw-r--r--svx/source/gallery2/GalleryControl.cxx20
-rw-r--r--svx/source/inc/DefaultShapesPanel.hxx7
-rw-r--r--svx/source/sidebar/EmptyPanel.cxx12
-rw-r--r--svx/source/sidebar/EmptyPanel.hxx3
-rw-r--r--svx/source/sidebar/PanelFactory.cxx48
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.cxx18
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanel.hxx8
-rw-r--r--svx/source/sidebar/area/AreaPropertyPanelBase.cxx53
-rw-r--r--svx/source/sidebar/effect/EffectPropertyPanel.cxx24
-rw-r--r--svx/source/sidebar/effect/EffectPropertyPanel.hxx10
-rw-r--r--svx/source/sidebar/fontwork/FontworkPropertyPanel.cxx16
-rw-r--r--svx/source/sidebar/fontwork/FontworkPropertyPanel.hxx7
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.cxx33
-rw-r--r--svx/source/sidebar/graphic/GraphicPropertyPanel.hxx12
-rw-r--r--svx/source/sidebar/inspector/InspectorTextPanel.cxx25
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.cxx15
-rw-r--r--svx/source/sidebar/line/LinePropertyPanel.hxx7
-rw-r--r--svx/source/sidebar/line/LinePropertyPanelBase.cxx13
-rw-r--r--svx/source/sidebar/lists/ListsPropertyPanel.cxx18
-rw-r--r--svx/source/sidebar/lists/ListsPropertyPanel.hxx7
-rw-r--r--svx/source/sidebar/media/MediaPlaybackPanel.cxx27
-rw-r--r--svx/source/sidebar/media/MediaPlaybackPanel.hxx11
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.cxx24
-rw-r--r--svx/source/sidebar/paragraph/ParaPropertyPanel.hxx8
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.cxx28
-rw-r--r--svx/source/sidebar/possize/PosSizePropertyPanel.hxx10
-rw-r--r--svx/source/sidebar/shadow/ShadowPropertyPanel.cxx24
-rw-r--r--svx/source/sidebar/shadow/ShadowPropertyPanel.hxx13
-rw-r--r--svx/source/sidebar/shapes/DefaultShapesPanel.cxx25
-rw-r--r--svx/source/sidebar/styles/StylesPropertyPanel.cxx23
-rw-r--r--svx/source/sidebar/styles/StylesPropertyPanel.hxx10
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.cxx19
-rw-r--r--svx/source/sidebar/text/TextPropertyPanel.hxx7
-rw-r--r--sw/qa/uitest/navigator/tdf114724.py2
-rw-r--r--sw/qa/uitest/navigator/tdf137274.py4
-rw-r--r--sw/qa/uitest/navigator/tdf140257.py116
-rw-r--r--sw/source/uibase/inc/conttree.hxx4
-rw-r--r--sw/source/uibase/inc/navipi.hxx15
-rw-r--r--sw/source/uibase/inc/redlndlg.hxx3
-rw-r--r--sw/source/uibase/misc/redlndlg.cxx12
-rw-r--r--sw/source/uibase/sidebar/PageFooterPanel.cxx22
-rw-r--r--sw/source/uibase/sidebar/PageFooterPanel.hxx17
-rw-r--r--sw/source/uibase/sidebar/PageFormatPanel.cxx23
-rw-r--r--sw/source/uibase/sidebar/PageFormatPanel.hxx14
-rw-r--r--sw/source/uibase/sidebar/PageHeaderPanel.cxx21
-rw-r--r--sw/source/uibase/sidebar/PageHeaderPanel.hxx18
-rw-r--r--sw/source/uibase/sidebar/PageStylesPanel.cxx22
-rw-r--r--sw/source/uibase/sidebar/PageStylesPanel.hxx16
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.cxx23
-rw-r--r--sw/source/uibase/sidebar/StylePresetsPanel.hxx17
-rw-r--r--sw/source/uibase/sidebar/SwPanelFactory.cxx54
-rw-r--r--sw/source/uibase/sidebar/TableEditPanel.cxx21
-rw-r--r--sw/source/uibase/sidebar/TableEditPanel.hxx17
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.cxx21
-rw-r--r--sw/source/uibase/sidebar/ThemePanel.hxx14
-rw-r--r--sw/source/uibase/sidebar/WrapPropertyPanel.cxx23
-rw-r--r--sw/source/uibase/sidebar/WrapPropertyPanel.hxx7
-rw-r--r--sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx24
-rw-r--r--sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx7
-rw-r--r--sw/source/uibase/utlui/content.cxx5
-rw-r--r--sw/source/uibase/utlui/glbltree.cxx10
-rw-r--r--sw/source/uibase/utlui/navipi.cxx102
144 files changed, 1116 insertions, 1580 deletions
diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx
index 3ae73588075c..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<vcl::Window> 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 e1fdc3299e59..36fd21204b62 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
@@ -256,8 +256,8 @@ private:
}
-VclPtr<vcl::Window> 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<vcl::Window> 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),
@@ -290,19 +289,12 @@ 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);
css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
if (xSelectionSupplier.is())
xSelectionSupplier->removeSelectionChangeListener(mxSelectionListener.get());
-
- AreaPropertyPanelBase::dispose();
}
void ChartAreaPanel::Initialize()
diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.hxx b/chart2/source/controller/sidebar/ChartAreaPanel.hxx
index fb9a80e15342..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<vcl::Window> 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 c1d9a4e62871..0574878b8cb2 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,17 +218,10 @@ 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<vcl::Window> 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 f44192a26e15..ab7d87fedf77 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"
@@ -39,9 +38,8 @@ class ChartAxisPanel : public PanelLayout,
public ChartSidebarSelectionListenerParent
{
public:
- 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,
ChartController* pController);
virtual void DataChanged(
@@ -61,11 +59,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 b14705cc8080..26567f037029 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,17 +335,10 @@ 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);
mxCBTitle.reset();
@@ -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<vcl::Window> 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 059e7c4fe122..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<vcl::Window> 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 b435520c5968..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,17 +247,10 @@ 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<vcl::Window> 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 7111ce83717c..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<vcl::Window> 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 019b022bd1a3..e9603138a341 100644
--- a/chart2/source/controller/sidebar/ChartLinePanel.cxx
+++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx
@@ -107,8 +107,8 @@ private:
}
-VclPtr<vcl::Window> 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<vcl::Window> 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),
@@ -144,19 +143,12 @@ 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);
css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
if (xSelectionSupplier.is())
xSelectionSupplier->removeSelectionChangeListener(mxSelectionListener.get());
-
- LinePropertyPanelBase::dispose();
}
void ChartLinePanel::Initialize()
diff --git a/chart2/source/controller/sidebar/ChartLinePanel.hxx b/chart2/source/controller/sidebar/ChartLinePanel.hxx
index ef174a5ee3a9..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<vcl::Window> 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 727aabbc2458..03e16396daff 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,17 +296,10 @@ 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);
css::uno::Reference<css::view::XSelectionSupplier> xSelectionSupplier(mxModel->getCurrentController(), css::uno::UNO_QUERY);
@@ -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<vcl::Window> 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 72be7b208b9b..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<vcl::Window> 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 a4041de4bb54..b835f4f156e2 100644
--- a/comphelper/source/misc/configuration.cxx
+++ b/comphelper/source/misc/configuration.cxx
@@ -230,6 +230,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 b41d0acc7f03..9835ccd8207a 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 015406771c4f..971e286ca74f 100644
--- a/include/sfx2/sidebar/SidebarPanelBase.hxx
+++ b/include/sfx2/sidebar/SidebarPanelBase.hxx
@@ -29,13 +29,12 @@
#include <com/sun/star/ui/XSidebarPanel.hpp>
#include <com/sun/star/ui/XUpdateModel.hpp>
-#include <vcl/vclptr.hxx>
-
-
-namespace vcl { class Window; }
+class PanelLayout;
namespace sfx2::sidebar {
+class Panel;
+
typedef cppu::WeakComponentImplHelper<css::ui::XContextChangeEventListener,
css::ui::XUIElement,
css::ui::XToolPanel,
@@ -52,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,
- vcl::Window* pControl,
+ std::unique_ptr<PanelLayout> xControl,
const css::ui::LayoutSize& rLayoutSize);
// XContextChangeEventListener
@@ -79,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,
- vcl::Window* 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;
@@ -89,7 +90,7 @@ private:
virtual void SAL_CALL disposing() override;
css::uno::Reference<css::frame::XFrame> mxFrame;
- VclPtr<vcl::Window> 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 a9874f256608..f95ea703a464 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">
@@ -393,6 +396,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">
@@ -419,6 +425,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">
@@ -442,6 +451,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">
@@ -468,6 +480,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">
@@ -494,6 +509,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">
@@ -520,6 +538,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">
@@ -546,6 +567,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">
@@ -585,6 +609,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">
@@ -611,6 +638,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">
@@ -645,6 +675,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">
@@ -684,6 +717,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">
@@ -710,6 +746,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">
@@ -760,6 +799,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="FontworkPropertyPanel" oor:op="replace">
@@ -810,6 +852,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">
@@ -833,6 +878,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">
@@ -864,7 +912,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>
@@ -893,7 +945,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>
@@ -918,6 +974,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">
@@ -944,6 +1003,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">
@@ -970,6 +1032,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">
@@ -996,6 +1061,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">
@@ -1022,6 +1090,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">
@@ -1048,6 +1119,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">
@@ -1074,6 +1148,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">
@@ -1104,6 +1181,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">
@@ -1134,6 +1214,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">
@@ -1164,6 +1247,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">
@@ -1204,6 +1290,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">
@@ -1232,6 +1321,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">
@@ -1264,6 +1356,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">
@@ -1293,6 +1388,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">
@@ -1322,6 +1420,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">
@@ -1351,6 +1452,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">
@@ -1380,6 +1484,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">
@@ -1406,6 +1513,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">
@@ -1432,7 +1542,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>
@@ -1457,6 +1571,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">
@@ -1483,6 +1600,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">
@@ -1506,6 +1626,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">
@@ -1532,6 +1655,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="ChartTrendlinePanel" oor:op="replace">
@@ -1581,6 +1707,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">
@@ -1607,6 +1736,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">
@@ -1634,6 +1766,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">
@@ -1665,6 +1800,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">
@@ -1694,6 +1832,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">
@@ -1717,7 +1858,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 32a1bd3da4c0..d679211eb7de 100644
--- a/sc/qa/uitest/calc_tests8/navigator.py
+++ b/sc/qa/uitest/calc_tests8/navigator.py
@@ -23,7 +23,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')
@@ -50,7 +50,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')
@@ -66,7 +66,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')
@@ -95,7 +95,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
@@ -129,7 +129,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 78ae31ae0c5a..cd5a91b911a6 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 9db870bb1bd5..aba163f153c8 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;
@@ -169,16 +171,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 44cc140b34ca..9c3ab3772c8a 100644
--- a/sc/source/ui/navipi/content.cxx
+++ b/sc/source/ui/navipi/content.cxx
@@ -161,7 +161,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 117798383754..8854672c6fe2 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 = GetOptimalSize();
-
- 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 )
@@ -770,11 +771,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;
@@ -802,7 +803,8 @@ void ScNavigatorDlg::SetListMode(NavListMode eMode)
if (pNav)
{
- Size aOptimalSize(GetOptimalSize());
+ 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 c5714959b958..b8c4176b4eb0 100644
--- a/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
+++ b/sc/source/ui/sidebar/AlignmentPropertyPanel.cxx
@@ -42,10 +42,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"))
@@ -78,16 +78,10 @@ AlignmentPropertyPanel::AlignmentPropertyPanel(
, mpBindings(pBindings)
{
Initialize();
- m_pInitialFocusWidget = &mxMFLeftIndent->get_widget();
}
AlignmentPropertyPanel::~AlignmentPropertyPanel()
{
- disposeOnce();
-}
-
-void AlignmentPropertyPanel::dispose()
-{
mxIndentButtonsDispatch.reset();
mxIndentButtons.reset();
mxWriteDirectionDispatch.reset();
@@ -116,8 +110,6 @@ void AlignmentPropertyPanel::dispose()
maAngleControl.dispose();
maVrtStackControl.dispose();
maRefEdgeControl.dispose();
-
- PanelLayout::dispose();
}
void AlignmentPropertyPanel::Initialize()
@@ -204,8 +196,8 @@ IMPL_LINK_NOARG(AlignmentPropertyPanel, CBOXWrapTextClkHdl, weld::ToggleButton&,
SfxCallMode::RECORD, { &aItem });
}
-VclPtr<vcl::Window> AlignmentPropertyPanel::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> AlignmentPropertyPanel::Create (
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
{
@@ -216,14 +208,9 @@ VclPtr<vcl::Window> 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 3a1b8eb8201b..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<vcl::Window> 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 43bc3b857346..59abf60e7e0b 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.cxx
@@ -44,10 +44,10 @@ const char 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")),
@@ -106,11 +106,6 @@ CellAppearancePropertyPanel::CellAppearancePropertyPanel(
CellAppearancePropertyPanel::~CellAppearancePropertyPanel()
{
- disposeOnce();
-}
-
-void CellAppearancePropertyPanel::dispose()
-{
mxCellBorderPopoverContainer.reset();
mxTBCellBorder.reset();
mxBackColorDispatch.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<vcl::Window> 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<vcl::Window> 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 1747e9f0a37d..a0249a7249c2 100644
--- a/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
+++ b/sc/source/ui/sidebar/CellAppearancePropertyPanel.hxx
@@ -22,8 +22,9 @@
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <sfx2/sidebar/PanelLayout.hxx>
-#include "CellBorderStyleControl.hxx"
-#include "CellLineStyleControl.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<vcl::Window> 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 bd7069e34d26..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,16 +54,10 @@ NumberFormatPropertyPanel::NumberFormatPropertyPanel(
, mpBindings(pBindings)
{
Initialize();
- m_pInitialFocusWidget = mxLbCategory.get();
}
NumberFormatPropertyPanel::~NumberFormatPropertyPanel()
{
- disposeOnce();
-}
-
-void NumberFormatPropertyPanel::dispose()
-{
mxLbCategory.reset();
mxCategoryDispatch.reset();
mxTBCategory.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<vcl::Window> 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<vcl::Window> 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 685a02ac23d2..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<vcl::Window> 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 9bd54bf774bf..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<vcl::Window> 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 21a67f89a4ec..e243fde1c05b 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -2377,11 +2377,10 @@ 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();
- rObjects.SelectEntry("Slide 1");
+ 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();
SdrView* pSdrView = pSdViewShell->GetView();
@@ -2411,9 +2410,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 2edc197f26d4..1144e120bf73 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,16 +211,10 @@ void CustomAnimationPane::initialize()
maLateInitTimer.SetTimeout(100);
maLateInitTimer.SetInvokeHandler(LINK(this, CustomAnimationPane, lateInitCallback));
maLateInitTimer.Start();
- UpdateLook();
}
CustomAnimationPane::~CustomAnimationPane()
{
- disposeOnce();
-}
-
-void CustomAnimationPane::dispose()
-{
maLateInitTimer.Stop();
removeListener();
@@ -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 908f78df3f70..2075ef37351a 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 ),
@@ -478,17 +478,10 @@ 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();
mxVS_TRANSITION_ICONSWin.reset();
@@ -506,17 +499,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()
@@ -889,7 +871,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 bee5a2190f9c..f3f336ae1377 100644
--- a/sd/source/ui/dlg/navigatr.cxx
+++ b/sd/source/ui/dlg/navigatr.cxx
@@ -52,13 +52,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 )
@@ -93,8 +94,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)
@@ -109,11 +115,6 @@ void SdNavigatorWin::SetUpdateRequestFunctor(const UpdateRequestFunctor& rUpdate
SdNavigatorWin::~SdNavigatorWin()
{
- disposeOnce();
-}
-
-void SdNavigatorWin::dispose()
-{
mpNavigatorCtrlItem.reset();
mpPageNameCtrlItem.reset();
mxDragModeMenu.reset();
@@ -121,7 +122,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 c8917c827688..361ae670e159 100644
--- a/sd/source/ui/dlg/sdtreelb.cxx
+++ b/sd/source/ui/dlg/sdtreelb.cxx
@@ -389,7 +389,7 @@ bool SdPageObjsTLV::StartDrag()
*/
bool SdPageObjsTLV::DoDrag()
{
- if (!m_xNavigator)
+ if (!m_pNavigator)
return true;
if (!m_xHelper)
@@ -706,7 +706,7 @@ void SdPageObjsTLV::Select()
if (m_bSelectionHandlerNavigates)
m_aRowActivatedHdl.Call(*m_xTreeView);
- if (!m_xNavigator)
+ if (!m_pNavigator)
{
m_xHelper.clear();
return;
@@ -714,7 +714,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;
@@ -923,7 +923,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 );
diff --git a/sd/source/ui/inc/SlideTransitionPane.hxx b/sd/source/ui/inc/SlideTransitionPane.hxx
index b68fc63a4662..d1340b80665e 100644
--- a/sd/source/ui/inc/SlideTransitionPane.hxx
+++ b/sd/source/ui/inc/SlideTransitionPane.hxx
@@ -21,6 +21,8 @@
#include "SlideSorterViewShell.hxx"
+#include <com/sun/star/ui/LayoutSize.hpp>
+
#include <svtools/valueset.hxx>
#include <sfx2/sidebar/ILayoutableWindow.hxx>
#include <sfx2/sidebar/PanelLayout.hxx>
@@ -51,18 +53,13 @@ class SlideTransitionPane : public PanelLayout
{
public:
explicit SlideTransitionPane(
- Window * pParent,
- ViewShellBase & rBase,
- const css::uno::Reference<css::frame::XFrame>& rxFrame );
+ weld::Widget* pParent,
+ ViewShellBase & rBase);
virtual ~SlideTransitionPane() override;
- virtual void dispose() override;
// ILayoutableWindow
virtual css::ui::LayoutSize GetHeightForWidth (const sal_Int32 nWidth) override;
- // Window
- virtual void DataChanged (const DataChangedEvent& rEvent) override;
-
void onSelectionChanged();
void onChangeCurrentPage();
@@ -84,8 +81,6 @@ private:
::sd::slidesorter::SharedPageSelection getSelectedPages() const;
- void UpdateLook();
-
void Initialize(SdDrawDocument* pDoc);
DECL_LINK( ApplyToAllButtonClicked, weld::Button&, void );
diff --git a/sd/source/ui/inc/TableDesignPane.hxx b/sd/source/ui/inc/TableDesignPane.hxx
index 69a8c6142907..138e470d5089 100644
--- a/sd/source/ui/inc/TableDesignPane.hxx
+++ b/sd/source/ui/inc/TableDesignPane.hxx
@@ -108,23 +108,17 @@ class TableDesignPane : public PanelLayout
private:
std::unique_ptr<TableDesignWidget> m_xImpl;
public:
- TableDesignPane( vcl::Window* pParent, ViewShellBase& rBase )
+ TableDesignPane( weld::Widget* pParent, ViewShellBase& rBase )
: PanelLayout(pParent, "TableDesignPanel",
- "modules/simpress/ui/tabledesignpanel.ui", css::uno::Reference<css::frame::XFrame>())
+ "modules/simpress/ui/tabledesignpanel.ui")
, m_xImpl(new TableDesignWidget(*m_xBuilder, rBase))
{
- m_pInitialFocusWidget = m_xImpl->GetInitialFocusWidget();
}
virtual css::ui::LayoutSize GetHeightForWidth(const sal_Int32 /*nWidth*/) override
{
sal_Int32 nMinimumHeight = get_preferred_size().Height();
return css::ui::LayoutSize(nMinimumHeight, -1, nMinimumHeight);
}
- virtual void dispose() override
- {
- m_xImpl.reset();
- PanelLayout::dispose();
- }
};
}
diff --git a/sd/source/ui/inc/navigatr.hxx b/sd/source/ui/inc/navigatr.hxx
index 1b4560f60c9c..22977fc7936b 100644
--- a/sd/source/ui/inc/navigatr.hxx
+++ b/sd/source/ui/inc/navigatr.hxx
@@ -82,7 +82,7 @@ namespace sd {
class SdNavigatorFloat : public SfxNavigator
{
private:
- VclPtr<SdNavigatorWin> pNavWin;
+ std::unique_ptr<SdNavigatorWin> m_xNavWin;
public:
SdNavigatorFloat(SfxBindings* _pBindings, SfxChildWindow* pMgr, vcl::Window* pParent);
void InitTreeLB(const SdDrawDocument* pDoc);
@@ -105,10 +105,9 @@ public:
update is necessary. When <FALSE/> the navigator will
rely on others to trigger updates.
*/
- SdNavigatorWin(vcl::Window* pParent, SfxBindings* pBindings);
+ SdNavigatorWin(weld::Widget* pParent, SfxBindings* pBindings, SfxNavigator* pNavigatorDlg);
void SetUpdateRequestFunctor(const UpdateRequestFunctor& rUpdateRequest);
virtual ~SdNavigatorWin() override;
- virtual void dispose() override;
void InitTreeLB( const SdDrawDocument* pDoc );
void RefreshDocumentLB( const OUString* pDocName = nullptr );
@@ -129,6 +128,8 @@ private:
std::unique_ptr<weld::Menu> mxDragModeMenu;
std::unique_ptr<weld::Menu> mxShapeMenu;
+ VclPtr<SfxNavigator> mxNavigatorDlg;
+
bool mbDocImported;
OUString maDropFileName;
NavigatorDragType meDragType;
@@ -158,6 +159,8 @@ private:
public:
//when object is marked , fresh the corresponding entry tree .
void FreshTree ( const SdDrawDocument* pDoc );
+
+ virtual weld::Window* GetFrameWeld() const override;
};
/**
@@ -174,7 +177,7 @@ protected:
const SfxPoolItem* pState ) override;
private:
- VclPtr<SdNavigatorWin> pNavigatorWin;
+ SdNavigatorWin* pNavigatorWin;
const SdNavigatorWin::UpdateRequestFunctor maUpdateRequest;
};
@@ -191,7 +194,7 @@ protected:
const SfxPoolItem* pState ) override;
private:
- VclPtr<SdNavigatorWin> pNavigatorWin;
+ SdNavigatorWin* pNavigatorWin;
};
#endif
diff --git a/sd/source/ui/inc/sdtreelb.hxx b/sd/source/ui/inc/sdtreelb.hxx
index 9ecd958241e2..17fed7e80342 100644
--- a/sd/source/ui/inc/sdtreelb.hxx
+++ b/sd/source/ui/inc/sdtreelb.hxx
@@ -72,7 +72,7 @@ private:
std::unique_ptr<weld::TreeIter> m_xScratchIter;
std::unique_ptr<SdPageObjsTLVDropTarget> m_xDropTargetHelper;
std::unique_ptr<::svt::AcceleratorExecute> m_xAccel;
- VclPtr<SdNavigatorWin> m_xNavigator;
+ SdNavigatorWin* m_pNavigator;
const SdDrawDocument* m_pDoc;
SdDrawDocument* m_pBookmarkDoc;
SfxMedium* m_pMedium;
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
index aa8a82167de1..21fbff298633 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.cxx
@@ -74,8 +74,8 @@ public:
SortedMasterPageDescriptorList() {}
};
-VclPtr<vcl::Window> AllMasterPagesSelector::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> AllMasterPagesSelector::Create (
+ weld::Widget* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
{
@@ -85,20 +85,20 @@ VclPtr<vcl::Window> AllMasterPagesSelector::Create (
auto pContainer = std::make_shared<MasterPageContainer>();
- VclPtrInstance<AllMasterPagesSelector> pSelector(
+ auto xSelector(std::make_unique<AllMasterPagesSelector>(
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar);
- pSelector->LateInit();
- pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_ALL);
+ rxSidebar));
+ xSelector->LateInit();
+ xSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_ALL);
- return pSelector;
+ return xSelector;
}
AllMasterPagesSelector::AllMasterPagesSelector (
- vcl::Window* pParent,
+ weld::Widget* pParent,
SdDrawDocument& rDocument,
ViewShellBase& rBase,
const std::shared_ptr<MasterPageContainer>& rpContainer,
diff --git a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
index ff94edddf0b1..9574c9802061 100644
--- a/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/AllMasterPagesSelector.hxx
@@ -34,11 +34,20 @@ class AllMasterPagesSelector
{
friend class VclPtrInstance<AllMasterPagesSelector>;
public:
- static VclPtr<vcl::Window> Create (
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create (
+ weld::Widget* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
+ AllMasterPagesSelector (
+ weld::Widget* pParent,
+ SdDrawDocument& rDocument,
+ ViewShellBase& rBase,
+ const std::shared_ptr<MasterPageContainer>& rpContainer,
+ const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
+ virtual ~AllMasterPagesSelector() override;
+
+
/** Scan the set of templates for the ones whose first master pages are
shown by this control and store them in the MasterPageContainer.
*/
@@ -53,14 +62,6 @@ private:
class SortedMasterPageDescriptorList;
::std::unique_ptr<SortedMasterPageDescriptorList> mpSortedMasterPages;
- AllMasterPagesSelector (
- vcl::Window* pParent,
- SdDrawDocument& rDocument,
- ViewShellBase& rBase,
- const std::shared_ptr<MasterPageContainer>& rpContainer,
- const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
- virtual ~AllMasterPagesSelector() override;
-
void AddItem (MasterPageContainer::Token aToken);
/** Add all items in the internal master page list into the given list.
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
index 93fb071b8080..3a7f691ad804 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.cxx
@@ -37,8 +37,8 @@ using namespace ::com::sun::star;
namespace sd::sidebar {
-VclPtr<vcl::Window> CurrentMasterPagesSelector::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> CurrentMasterPagesSelector::Create (
+ weld::Widget* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
{
@@ -48,20 +48,20 @@ VclPtr<vcl::Window> CurrentMasterPagesSelector::Create (
auto pContainer = std::make_shared<MasterPageContainer>();
- VclPtrInstance<CurrentMasterPagesSelector> pSelector(
+ auto xSelector(std::make_unique<CurrentMasterPagesSelector>(
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar);
- pSelector->LateInit();
- pSelector->SetHelpId( HID_SD_TASK_PANE_PREVIEW_CURRENT );
+ rxSidebar));
+ xSelector->LateInit();
+ xSelector->SetHelpId( HID_SD_TASK_PANE_PREVIEW_CURRENT );
- return pSelector;
+ return xSelector;
}
CurrentMasterPagesSelector::CurrentMasterPagesSelector (
- vcl::Window* pParent,
+ weld::Widget* pParent,
SdDrawDocument& rDocument,
ViewShellBase& rBase,
const std::shared_ptr<MasterPageContainer>& rpContainer,
@@ -74,11 +74,6 @@ CurrentMasterPagesSelector::CurrentMasterPagesSelector (
CurrentMasterPagesSelector::~CurrentMasterPagesSelector()
{
- disposeOnce();
-}
-
-void CurrentMasterPagesSelector::dispose()
-{
if (mrDocument.GetDocSh() != nullptr)
{
EndListening(*mrDocument.GetDocSh());
@@ -90,8 +85,6 @@ void CurrentMasterPagesSelector::dispose()
Link<sd::tools::EventMultiplexerEvent&,void> aLink (LINK(this,CurrentMasterPagesSelector,EventMultiplexerListener));
mrBase.GetEventMultiplexer()->RemoveEventListener(aLink);
-
- MasterPagesSelector::dispose();
}
void CurrentMasterPagesSelector::LateInit()
diff --git a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
index 889996f7160a..a2251b85080c 100644
--- a/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/CurrentMasterPagesSelector.hxx
@@ -36,11 +36,19 @@ class CurrentMasterPagesSelector
{
friend class VclPtrInstance<CurrentMasterPagesSelector>;
public:
- static VclPtr<vcl::Window> Create (
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create (
+ weld::Widget* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
+ CurrentMasterPagesSelector (
+ weld::Widget* pParent,
+ SdDrawDocument& rDocument,
+ ViewShellBase& rBase,
+ const std::shared_ptr<MasterPageContainer>& rpContainer,
+ const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
+ virtual ~CurrentMasterPagesSelector() override;
+
/** Set the selection so that the master page is selected that is
used by the currently selected page of the document in the
center pane.
@@ -60,15 +68,6 @@ protected:
virtual void ExecuteCommand(const OString &rIdent) override;
private:
- CurrentMasterPagesSelector (
- vcl::Window* pParent,
- SdDrawDocument& rDocument,
- ViewShellBase& rBase,
- const std::shared_ptr<MasterPageContainer>& rpContainer,
- const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
- virtual ~CurrentMasterPagesSelector() override;
- virtual void dispose() override;
-
virtual void LateInit() override;
DECL_LINK(EventMultiplexerListener,sd::tools::EventMultiplexerEvent&, void);
diff --git a/sd/source/ui/sidebar/LayoutMenu.cxx b/sd/source/ui/sidebar/LayoutMenu.cxx
index e0e43fcdedb5..2c71b8f921dc 100644
--- a/sd/source/ui/sidebar/LayoutMenu.cxx
+++ b/sd/source/ui/sidebar/LayoutMenu.cxx
@@ -154,10 +154,10 @@ public:
};
LayoutMenu::LayoutMenu (
- vcl::Window* pParent,
+ weld::Widget* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
- : PanelLayout( pParent, "LayoutPanel", "modules/simpress/ui/layoutpanel.ui", nullptr ),
+ : PanelLayout( pParent, "LayoutPanel", "modules/simpress/ui/layoutpanel.ui" ),
mrBase(rViewShellBase),
mxLayoutValueSet(new LayoutValueSet(*this)),
mxLayoutValueSetWin(new weld::CustomWeld(*m_xBuilder, "valueset", *mxLayoutValueSet)),
@@ -171,11 +171,6 @@ LayoutMenu::LayoutMenu (
mxLayoutValueSet->SetStyle(mxLayoutValueSet->GetStyle() | WB_ITEMBORDER | WB_FLATVALUESET | WB_TABSTOP);
mxLayoutValueSet->SetColor(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Color_PanelBackground));
-
-#ifdef DEBUG
- SetText(OUString("sd:LayoutMenu"));
-#endif
- m_pInitialFocusWidget = mxLayoutValueSet->GetDrawingArea();
}
void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell )
@@ -210,16 +205,10 @@ void LayoutMenu::implConstruct( DrawDocShell& rDocumentShell )
LayoutMenu::~LayoutMenu()
{
- disposeOnce();
-}
-
-void LayoutMenu::dispose()
-{
SAL_INFO("sd.ui", "destroying LayoutMenu at " << this);
Dispose();
mxLayoutValueSetWin.reset();
mxLayoutValueSet.reset();
- PanelLayout::dispose();
}
void LayoutMenu::Dispose()
@@ -726,8 +715,9 @@ IMPL_LINK(LayoutMenu, EventMultiplexerListener, ::sd::tools::EventMultiplexerEve
}
}
-void LayoutMenu::DataChanged (const DataChangedEvent& /*rEvent*/)
+void LayoutMenu::DataChanged(const DataChangedEvent& rEvent)
{
+ PanelLayout::DataChanged(rEvent);
Fill();
mxLayoutValueSet->StyleUpdated();
mxLayoutValueSet->SetColor(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Color_PanelBackground));
diff --git a/sd/source/ui/sidebar/LayoutMenu.hxx b/sd/source/ui/sidebar/LayoutMenu.hxx
index 327a4939803c..6931d0a942f6 100644
--- a/sd/source/ui/sidebar/LayoutMenu.hxx
+++ b/sd/source/ui/sidebar/LayoutMenu.hxx
@@ -62,10 +62,9 @@ public:
@param i_rPanelViewShell
the view shell of the task pane.
*/
- LayoutMenu(vcl::Window* pParent, ViewShellBase& rViewShellBase,
+ LayoutMenu(weld::Widget* pParent, ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
virtual ~LayoutMenu() override;
- virtual void dispose() override;
void Dispose();
@@ -92,8 +91,6 @@ public:
*/
virtual void DataChanged(const DataChangedEvent& rEvent) override;
- using Window::GetWindow;
-
private:
ViewShellBase& mrBase;
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.cxx b/sd/source/ui/sidebar/MasterPagesSelector.cxx
index 0ed42c62bc84..bde8ca04d697 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.cxx
@@ -54,12 +54,12 @@ namespace sd::sidebar {
const char gsDefaultClickAction[] = "applyselect";
MasterPagesSelector::MasterPagesSelector (
- vcl::Window* pParent,
+ weld::Widget* pParent,
SdDrawDocument& rDocument,
ViewShellBase& rBase,
const std::shared_ptr<MasterPageContainer>& rpContainer,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
- : PanelLayout( pParent, "MasterPagePanel", "modules/simpress/ui/masterpagepanel.ui", nullptr ),
+ : PanelLayout( pParent, "MasterPagePanel", "modules/simpress/ui/masterpagepanel.ui" ),
maMutex(),
mpContainer(rpContainer),
mxPreviewValueSet(new PreviewValueSet),
@@ -87,17 +87,10 @@ MasterPagesSelector::MasterPagesSelector (
Link<MasterPageContainerChangeEvent&,void> aChangeListener (LINK(this,MasterPagesSelector,ContainerChangeListener));
mpContainer->AddChangeListener(aChangeListener);
-
- m_pInitialFocusWidget = mxPreviewValueSet->GetDrawingArea();
}
MasterPagesSelector::~MasterPagesSelector()
{
- disposeOnce();
-}
-
-void MasterPagesSelector::dispose()
-{
Clear();
UpdateLocks(ItemList());
@@ -106,8 +99,6 @@ void MasterPagesSelector::dispose()
mpContainer.reset();
mxPreviewValueSetWin.reset();
mxPreviewValueSet.reset();
-
- PanelLayout::dispose();
}
void MasterPagesSelector::LateInit()
diff --git a/sd/source/ui/sidebar/MasterPagesSelector.hxx b/sd/source/ui/sidebar/MasterPagesSelector.hxx
index 5d3bc319bda9..0b8a3ebf74eb 100644
--- a/sd/source/ui/sidebar/MasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/MasterPagesSelector.hxx
@@ -49,13 +49,12 @@ class MasterPagesSelector : public PanelLayout
{
public:
MasterPagesSelector (
- vcl::Window* pParent,
+ weld::Widget* pParent,
SdDrawDocument& rDocument,
ViewShellBase& rBase,
const std::shared_ptr<MasterPageContainer>& rpContainer,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
virtual ~MasterPagesSelector() override;
- virtual void dispose() override;
virtual void LateInit();
diff --git a/sd/source/ui/sidebar/NavigatorWrapper.cxx b/sd/source/ui/sidebar/NavigatorWrapper.cxx
index 1414f238f3a4..95d4a66ae14b 100644
--- a/sd/source/ui/sidebar/NavigatorWrapper.cxx
+++ b/sd/source/ui/sidebar/NavigatorWrapper.cxx
@@ -19,24 +19,19 @@
#include "NavigatorWrapper.hxx"
#include <ViewShellBase.hxx>
-
-#include <sfx2/sidebar/Theme.hxx>
#include <navigatr.hxx>
-
namespace sd::sidebar {
NavigatorWrapper::NavigatorWrapper (
- vcl::Window* pParent,
+ weld::Widget* pParent,
sd::ViewShellBase& rViewShellBase,
SfxBindings* pBindings)
- : SdNavigatorWin(pParent, pBindings)
+ : SdNavigatorWin(pParent, pBindings, nullptr)
, mrViewShellBase(rViewShellBase)
{
SetUpdateRequestFunctor(
[this] () { return this->UpdateNavigator(); });
- SetBackground(sfx2::sidebar::Theme::GetColor(sfx2::sidebar::Theme::Color_PanelBackground));
- Show();
}
css::ui::LayoutSize NavigatorWrapper::GetHeightForWidth (const sal_Int32)
diff --git a/sd/source/ui/sidebar/NavigatorWrapper.hxx b/sd/source/ui/sidebar/NavigatorWrapper.hxx
index 7483f4b3ad94..330e423ea3d7 100644
--- a/sd/source/ui/sidebar/NavigatorWrapper.hxx
+++ b/sd/source/ui/sidebar/NavigatorWrapper.hxx
@@ -41,7 +41,7 @@ class NavigatorWrapper
{
public:
NavigatorWrapper (
- vcl::Window* pParent,
+ weld::Widget* pParent,
sd::ViewShellBase& rViewShellBase,
SfxBindings* pBindings);
diff --git a/sd/source/ui/sidebar/PanelFactory.cxx b/sd/source/ui/sidebar/PanelFactory.cxx
index 4fd154ef974f..34e52212cab6 100644
--- a/sd/source/ui/sidebar/PanelFactory.cxx
+++ b/sd/source/ui/sidebar/PanelFactory.cxx
@@ -35,8 +35,7 @@
#include <com/sun/star/uno/XComponentContext.hpp>
#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/servicehelper.hxx>
-#include <vcl/window.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
+#include <vcl/weldutils.hxx>
using namespace css;
using namespace css::uno;
@@ -72,8 +71,11 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
Reference<ui::XSidebar> xSidebar (aArguments.getOrDefault("Sidebar", Reference<ui::XSidebar>()));
// Throw exceptions when the arguments are not as expected.
- VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(xParentWindow);
- if ( ! xParentWindow.is() || !pParentWindow)
+ 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");
if ( ! xFrame.is())
@@ -93,7 +95,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
SfxBindings* pBindings = reinterpret_cast<SfxBindings*>(nBindingsValue);
// Create a framework view.
- VclPtr<vcl::Window> pControl;
+ std::unique_ptr<PanelLayout> xControl;
css::ui::LayoutSize aLayoutSize (-1,-1,-1);
/** Note that these names have to be identical to (the tail of)
@@ -101,25 +103,25 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
for the TaskPanelFactory.
*/
if (rsUIElementResourceURL.endsWith("/CustomAnimations"))
- pControl = VclPtr<CustomAnimationPane>::Create(pParentWindow, *pBase, xFrame);
+ xControl = std::make_unique<CustomAnimationPane>(pParent, *pBase);
else if (rsUIElementResourceURL.endsWith("/Layouts"))
- pControl = VclPtr<LayoutMenu>::Create(pParentWindow, *pBase, xSidebar);
+ xControl = std::make_unique<LayoutMenu>(pParent, *pBase, xSidebar);
else if (rsUIElementResourceURL.endsWith("/AllMasterPages"))
- pControl = AllMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
+ xControl = AllMasterPagesSelector::Create(pParent, *pBase, xSidebar);
else if (rsUIElementResourceURL.endsWith("/RecentMasterPages"))
- pControl = RecentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
+ xControl = RecentMasterPagesSelector::Create(pParent, *pBase, xSidebar);
else if (rsUIElementResourceURL.endsWith("/UsedMasterPages"))
- pControl = CurrentMasterPagesSelector::Create(pParentWindow, *pBase, xSidebar);
+ xControl = CurrentMasterPagesSelector::Create(pParent, *pBase, xSidebar);
else if (rsUIElementResourceURL.endsWith("/SlideTransitions"))
- pControl = VclPtr<SlideTransitionPane>::Create(pParentWindow, *pBase, xFrame);
+ xControl = std::make_unique<SlideTransitionPane>(pParent, *pBase);
else if (rsUIElementResourceURL.endsWith("/TableDesign"))
- pControl = VclPtr<TableDesignPane>::Create(pParentWindow, *pBase);
+ xControl = std::make_unique<TableDesignPane>(pParent, *pBase);
else if (rsUIElementResourceURL.endsWith("/NavigatorPanel"))
- pControl = VclPtr<NavigatorWrapper>::Create(pParentWindow, *pBase, pBindings);
+ xControl = std::make_unique<NavigatorWrapper>(pParent, *pBase, pBindings);
else if (rsUIElementResourceURL.endsWith("/SlideBackgroundPanel"))
- pControl = VclPtr<SlideBackground>::Create(pParentWindow, *pBase, xFrame, pBindings);
+ xControl = std::make_unique<SlideBackground>(pParent, *pBase, xFrame, pBindings);
- if (!pControl)
+ if (!xControl)
throw lang::IllegalArgumentException();
// Create a wrapper around the control that implements the
@@ -127,7 +129,7 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
return sfx2::sidebar::SidebarPanelBase::Create(
rsUIElementResourceURL,
xFrame,
- pControl,
+ std::move(xControl),
aLayoutSize);
}
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
index db5d92d0f6f7..4d6cd31ebe94 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.cxx
@@ -28,8 +28,8 @@
namespace sd::sidebar {
-VclPtr<vcl::Window> RecentMasterPagesSelector::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> RecentMasterPagesSelector::Create (
+ weld::Widget* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
{
@@ -39,20 +39,20 @@ VclPtr<vcl::Window> RecentMasterPagesSelector::Create (
auto pContainer = std::make_shared<MasterPageContainer>();
- VclPtrInstance<RecentMasterPagesSelector> pSelector(
+ auto xSelector(std::make_unique<RecentMasterPagesSelector>(
pParent,
*pDocument,
rViewShellBase,
pContainer,
- rxSidebar);
- pSelector->LateInit();
- pSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_RECENT);
+ rxSidebar));
+ xSelector->LateInit();
+ xSelector->SetHelpId(HID_SD_TASK_PANE_PREVIEW_RECENT);
- return pSelector;
+ return xSelector;
}
RecentMasterPagesSelector::RecentMasterPagesSelector (
- vcl::Window* pParent,
+ weld::Widget* pParent,
SdDrawDocument& rDocument,
ViewShellBase& rBase,
const std::shared_ptr<MasterPageContainer>& rpContainer,
@@ -63,14 +63,8 @@ RecentMasterPagesSelector::RecentMasterPagesSelector (
RecentMasterPagesSelector::~RecentMasterPagesSelector()
{
- disposeOnce();
-}
-
-void RecentMasterPagesSelector::dispose()
-{
RecentlyUsedMasterPages::Instance().RemoveEventListener (
LINK(this,RecentMasterPagesSelector,MasterPageListListener));
- MasterPagesSelector::dispose();
}
void RecentMasterPagesSelector::LateInit()
diff --git a/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx b/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
index 4040d1d13ff8..8576ac8d6153 100644
--- a/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
+++ b/sd/source/ui/sidebar/RecentMasterPagesSelector.hxx
@@ -31,11 +31,19 @@ class RecentMasterPagesSelector final
{
friend class VclPtrInstance<RecentMasterPagesSelector>;
public:
- static VclPtr<vcl::Window> Create (
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create (
+ weld::Widget* pParent,
ViewShellBase& rViewShellBase,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
+ RecentMasterPagesSelector (
+ weld::Widget* pParent,
+ SdDrawDocument& rDocument,
+ ViewShellBase& rBase,
+ const std::shared_ptr<MasterPageContainer>& rpContainer,
+ const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
+ virtual ~RecentMasterPagesSelector() override;
+
private:
DECL_LINK(MasterPageListListener, LinkParamNone*, void);
virtual void Fill (ItemList& rItemList) override;
@@ -56,15 +64,6 @@ private:
SdPage* pMasterPage,
const std::shared_ptr<std::vector<SdPage*> >& rpPageList) override;
- RecentMasterPagesSelector (
- vcl::Window* pParent,
- SdDrawDocument& rDocument,
- ViewShellBase& rBase,
- const std::shared_ptr<MasterPageContainer>& rpContainer,
- const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
- virtual ~RecentMasterPagesSelector() override;
- virtual void dispose() override;
-
virtual void LateInit() override;
};
diff --git a/sd/source/ui/sidebar/SlideBackground.cxx b/sd/source/ui/sidebar/SlideBackground.cxx
index c4a13fff4f13..43c566fb761c 100644
--- a/sd/source/ui/sidebar/SlideBackground.cxx
+++ b/sd/source/ui/sidebar/SlideBackground.cxx
@@ -88,12 +88,11 @@ enum eFillStyle
}
SlideBackground::SlideBackground(
- Window * pParent,
+ weld::Widget* pParent,
ViewShellBase& rBase,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings
- ) :
- PanelLayout( pParent, "SlideBackgroundPanel", "modules/simpress/ui/sidebarslidebackground.ui", rxFrame ),
+ SfxBindings* pBindings) :
+ PanelLayout( pParent, "SlideBackgroundPanel", "modules/simpress/ui/sidebarslidebackground.ui" ),
mrBase( rBase ),
mxPaperSizeBox(new SvxPaperSizeListBox(m_xBuilder->weld_combo_box("paperformat"))),
mxPaperOrientation(m_xBuilder->weld_combo_box("orientation")),
@@ -163,11 +162,6 @@ SlideBackground::SlideBackground(
Initialize();
}
-SlideBackground::~SlideBackground()
-{
- disposeOnce();
-}
-
bool SlideBackground::IsDraw()
{
return ( maContext == maDrawMasterContext ||
@@ -280,7 +274,7 @@ void SlideBackground::DumpAsPropertyTree(::tools::JsonWriter& rJsonWriter)
mpBindings->Update(SID_ATTR_PAGE_SIZE);
}
- Control::DumpAsPropertyTree(rJsonWriter);
+ PanelLayout::DumpAsPropertyTree(rJsonWriter);
}
void SlideBackground::HandleContextChange(
@@ -349,9 +343,9 @@ void SlideBackground::HandleContextChange(
mxInsertImage->hide();
// Need to do a relayouting, otherwise the panel size is not updated after show / hide controls
- sfx2::sidebar::Panel* pPanel = dynamic_cast<sfx2::sidebar::Panel*>(GetParent());
- if(pPanel)
- pPanel->TriggerDeckLayouting();
+ if (m_xPanel)
+ m_xPanel->TriggerDeckLayouting();
+
}
else if ( IsDraw() )
{
@@ -688,7 +682,7 @@ void SlideBackground::updateMasterSlideSelection()
}
}
-void SlideBackground::dispose()
+SlideBackground::~SlideBackground()
{
removeListener();
@@ -732,7 +726,6 @@ void SlideBackground::dispose()
mpBitmapItem.reset();
mpPageLRMarginItem.reset();
mpPageULMarginItem.reset();
- PanelLayout::dispose();
}
void SlideBackground::ExecuteMarginLRChange(const ::tools::Long mnPageLeftMargin, const ::tools::Long mnPageRightMargin)
@@ -818,11 +811,6 @@ OUString const & SlideBackground::GetPatternSetOrDefault()
return mpBitmapItem->GetName();
}
-void SlideBackground::DataChanged (const DataChangedEvent& /*rEvent*/)
-{
-
-}
-
void SlideBackground::NotifyItemUpdate(
const sal_uInt16 nSID,
const SfxItemState eState,
diff --git a/sd/source/ui/sidebar/SlideBackground.hxx b/sd/source/ui/sidebar/SlideBackground.hxx
index 0fbf7718d913..4dd386510a0e 100644
--- a/sd/source/ui/sidebar/SlideBackground.hxx
+++ b/sd/source/ui/sidebar/SlideBackground.hxx
@@ -53,15 +53,13 @@ class SlideBackground :
{
public:
SlideBackground(
- Window * pParent,
+ weld::Widget* pParent,
ViewShellBase& rBase,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings );
virtual ~SlideBackground() override;
- virtual void dispose() override;
SfxBindings* GetBindings() { return mpBindings; }
// Window
- virtual void DataChanged (const DataChangedEvent& rEvent) override;
virtual void NotifyItemUpdate(
const sal_uInt16 nSID,
const SfxItemState eState,
diff --git a/sfx2/UIConfig_sfx.mk b/sfx2/UIConfig_sfx.mk
index 48d5c8fae71a..88127c9f78b1 100644
--- a/sfx2/UIConfig_sfx.mk
+++ b/sfx2/UIConfig_sfx.mk
@@ -47,6 +47,7 @@ $(eval $(call gb_UIConfig_add_uifiles,sfx,\
sfx2/uiconfig/ui/linkeditdialog \
sfx2/uiconfig/ui/loadtemplatedialog \
sfx2/uiconfig/ui/managestylepage \
+ sfx2/uiconfig/ui/navigator \
sfx2/uiconfig/ui/newstyle \
sfx2/uiconfig/ui/notebookbar \
sfx2/uiconfig/ui/optprintpage \
diff --git a/sfx2/inc/sidebar/PanelDescriptor.hxx b/sfx2/inc/sidebar/PanelDescriptor.hxx
index be85911ac36b..1033379f7de3 100644
--- a/sfx2/inc/sidebar/PanelDescriptor.hxx
+++ b/sfx2/inc/sidebar/PanelDescriptor.hxx
@@ -36,6 +36,7 @@ public:
sal_Int32 mnOrderIndex;
bool mbShowForReadOnlyDocuments;
bool mbWantsCanvas;
+ bool mbWantsAWT;
bool mbExperimental;
OUString msNodeName; // some impress panel nodes names are different from their Id
diff --git a/sfx2/source/appl/childwin.cxx b/sfx2/source/appl/childwin.cxx
index 430593a88ab9..a37d5d9bd67b 100644
--- a/sfx2/source/appl/childwin.cxx
+++ b/sfx2/source/appl/childwin.cxx
@@ -531,14 +531,12 @@ SfxChildWindowContext::~SfxChildWindowContext()
bool ParentIsFloatingWindow(vcl::Window *pParent)
{
+ if (!pParent)
+ return false;
if (pParent->GetType() == WindowType::DOCKINGWINDOW || pParent->GetType() == WindowType::TOOLBOX)
- {
return true;
- }
if (pParent->GetType() == WindowType::FLOATINGWINDOW)
- {
return true;
- }
return false;
}
diff --git a/sfx2/source/dialog/navigat.cxx b/sfx2/source/dialog/navigat.cxx
index 1487bcbcc8f3..90116d8a2064 100644
--- a/sfx2/source/dialog/navigat.cxx
+++ b/sfx2/source/dialog/navigat.cxx
@@ -48,19 +48,12 @@ void SfxNavigatorWrapper::Initialize(SfxChildWinInfo* pInfo)
SfxNavigator::SfxNavigator( SfxBindings* pBind ,
SfxChildWindow* pChildWin ,
vcl::Window* pParent )
- : SfxDockingWindow( pBind ,
- pChildWin ,
- pParent ,
- WB_STDDOCKWIN | WB_CLIPCHILDREN | WB_SIZEABLE | WB_3DLOOK )
+ : SfxDockingWindow(pBind ,
+ pChildWin ,
+ pParent ,
+ "Navigator", "sfx/ui/navigator.ui")
{
SetText(SfxResId(STR_SID_NAVIGATOR));
}
-void SfxNavigator::Resize()
-{
- SfxDockingWindow::Resize();
- if (vcl::Window *pChild = GetWindow(GetWindowType::FirstChild))
- VclContainer::setLayoutAllocation(*pChild, Point(0, 0), GetSizePixel());
-}
-
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/dialog/templdlg.cxx b/sfx2/source/dialog/templdlg.cxx
index bf0aa694df15..120b30846ed9 100644
--- a/sfx2/source/dialog/templdlg.cxx
+++ b/sfx2/source/dialog/templdlg.cxx
@@ -369,23 +369,15 @@ IMPL_LINK(SfxCommonTemplateDialog_Impl, PopupTreeMenuHdl, const CommandEvent&, r
return true;
}
-SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, vcl::Window* pParentWindow)
- : PanelLayout(pParentWindow, "TemplatePanel", "sfx/ui/templatepanel.ui", nullptr)
+SfxTemplatePanelControl::SfxTemplatePanelControl(SfxBindings* pBindings, weld::Widget* pParent)
+ : PanelLayout(pParent, "TemplatePanel", "sfx/ui/templatepanel.ui")
, pImpl(new SfxTemplateDialog_Impl(pBindings, this))
{
OSL_ASSERT(pBindings!=nullptr);
- m_pInitialFocusWidget = pImpl->m_xActionTbL.get();
}
SfxTemplatePanelControl::~SfxTemplatePanelControl()
{
- disposeOnce();
-}
-
-void SfxTemplatePanelControl::dispose()
-{
- pImpl.reset();
- PanelLayout::dispose();
}
static void MakeExpanded_Impl(const weld::TreeView& rBox, std::vector<OUString>& rEntries)
diff --git a/sfx2/source/inc/templdgi.hxx b/sfx2/source/inc/templdgi.hxx
index 7f7f3aba1b47..39b9b33eabb9 100644
--- a/sfx2/source/inc/templdgi.hxx
+++ b/sfx2/source/inc/templdgi.hxx
@@ -38,6 +38,8 @@ class SfxTemplateControllerItem;
#include <sfx2/styfitem.hxx>
#include <sfx2/templdlg.hxx>
+#include <vcl/idle.hxx>
+
class SfxStyleFamilyItem;
class SfxTemplateItem;
class SfxBindings;
diff --git a/sfx2/source/sidebar/Panel.cxx b/sfx2/source/sidebar/Panel.cxx
index 490bf2696fbf..3d03beb2e9a0 100644
--- a/sfx2/source/sidebar/Panel.cxx
+++ b/sfx2/source/sidebar/Panel.cxx
@@ -22,8 +22,8 @@
#include <sidebar/PanelDescriptor.hxx>
#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/ResourceManager.hxx>
-
#include <sfx2/sidebar/SidebarController.hxx>
+#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <tools/json_writer.hxx>
@@ -37,6 +37,8 @@
#include <com/sun/star/ui/XSidebarPanel.hpp>
#include <com/sun/star/ui/XUIElement.hpp>
+#include <vcl/weldutils.hxx>
+
using namespace css;
using namespace css::uno;
@@ -51,6 +53,7 @@ Panel::Panel(const PanelDescriptor& rPanelDescriptor,
: InterimItemWindow(pParentWindow, "sfx/ui/panel.ui", "Panel")
, msPanelId(rPanelDescriptor.msId)
, mbIsTitleBarOptional(rPanelDescriptor.mbIsTitleBarOptional)
+ , mbWantsAWT(rPanelDescriptor.mbWantsAWT)
, mxElement()
, mxPanelComponent()
, mbIsExpanded(bIsInitiallyExpanded)
@@ -60,7 +63,6 @@ Panel::Panel(const PanelDescriptor& rPanelDescriptor,
, mxFrame(rxFrame)
, mxTitleBar(new PanelTitleBar(rPanelDescriptor.msTitle, *m_xBuilder, this))
, mxContents(m_xBuilder->weld_container("contents"))
- , mxAwtXWindow(mxContents->CreateChildFrame())
{
SetText(rPanelDescriptor.msTitle);
mxContents->set_visible(mbIsExpanded);
@@ -111,10 +113,10 @@ void Panel::dispose()
mxTitleBar.reset();
- if (mxAwtXWindow)
+ if (mxXWindow)
{
- mxAwtXWindow->dispose();
- mxAwtXWindow.clear();
+ mxXWindow->dispose();
+ mxXWindow.clear();
}
mxContents.reset();
@@ -134,10 +136,14 @@ void Panel::ShowTitlebar(bool bShowTitlebar)
void Panel::SetUIElement (const Reference<ui::XUIElement>& rxElement)
{
mxElement = rxElement;
- if (mxElement.is())
- {
- mxPanelComponent.set(mxElement->getRealInterface(), UNO_QUERY);
- }
+ if (!mxElement.is())
+ return;
+ mxPanelComponent.set(mxElement->getRealInterface(), UNO_QUERY);
+ if (mbWantsAWT)
+ return;
+ sfx2::sidebar::SidebarPanelBase* pPanelBase = dynamic_cast<sfx2::sidebar::SidebarPanelBase*>(mxElement.get());
+ assert(pPanelBase && "internal panels are all expected to inherit from SidebarPanelBase");
+ pPanelBase->SetParentPanel(this);
}
void Panel::SetExpanded (const bool bIsExpanded)
@@ -186,9 +192,14 @@ Reference<awt::XWindow> Panel::GetElementWindow()
Reference<awt::XWindow> Panel::GetElementParentWindow()
{
- if (!mxAwtXWindow)
- mxAwtXWindow = mxContents->CreateChildFrame();
- return mxAwtXWindow;
+ if (!mxXWindow)
+ {
+ if (mbWantsAWT)
+ mxXWindow = mxContents->CreateChildFrame();
+ else
+ mxXWindow = Reference<awt::XWindow>(new weld::TransportAsXWindow(mxContents.get()));
+ }
+ return mxXWindow;
}
} // end of namespace sfx2::sidebar
diff --git a/sfx2/source/sidebar/PanelDescriptor.cxx b/sfx2/source/sidebar/PanelDescriptor.cxx
index bdbec773fcdc..b980d7f1e751 100644
--- a/sfx2/source/sidebar/PanelDescriptor.cxx
+++ b/sfx2/source/sidebar/PanelDescriptor.cxx
@@ -33,6 +33,7 @@ PanelDescriptor::PanelDescriptor()
mnOrderIndex(10000), // Default value as defined in Sidebar.xcs
mbShowForReadOnlyDocuments(false),
mbWantsCanvas(false),
+ mbWantsAWT(true),
mbExperimental(false)
{
}
@@ -49,6 +50,7 @@ PanelDescriptor::PanelDescriptor (const PanelDescriptor& rOther)
mnOrderIndex(rOther.mnOrderIndex),
mbShowForReadOnlyDocuments(rOther.mbShowForReadOnlyDocuments),
mbWantsCanvas(rOther.mbWantsCanvas),
+ mbWantsAWT(rOther.mbWantsAWT),
mbExperimental(rOther.mbExperimental)
{
}
diff --git a/sfx2/source/sidebar/PanelLayout.cxx b/sfx2/source/sidebar/PanelLayout.cxx
index 0e37e2278a73..3a47773175ce 100644
--- a/sfx2/source/sidebar/PanelLayout.cxx
+++ b/sfx2/source/sidebar/PanelLayout.cxx
@@ -7,124 +7,78 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <sal/log.hxx>
#include <sfx2/sidebar/SidebarController.hxx>
-#include <sfx2/sidebar/TabBar.hxx>
#include <sfx2/sidebar/PanelLayout.hxx>
-#include <vcl/layout.hxx>
-#include <vcl/accel.hxx>
+#include <sfx2/sidebar/TabBar.hxx>
+#include <sfx2/sidebar/Theme.hxx>
+#include <vcl/event.hxx>
using namespace sfx2::sidebar;
-PanelLayout::PanelLayout(vcl::Window* pParent, const OString& rID, const OUString& rUIXMLDescription,
- const css::uno::Reference<css::frame::XFrame> &rFrame)
- : Control(pParent)
- , m_pInitialFocusWidget(nullptr)
- , m_bInClose(false)
- , mxFrame(rFrame)
-{
- m_aPanelLayoutIdle.SetPriority(TaskPriority::RESIZE);
- m_aPanelLayoutIdle.SetInvokeHandler( LINK( this, PanelLayout, ImplHandlePanelLayoutTimerHdl ) );
- m_aPanelLayoutIdle.SetDebugName("sfx2::PanelLayout m_aPanelLayoutIdle");
-
- SetStyle(GetStyle() | WB_DIALOGCONTROL);
-
- // Builder will trigger resize and start Idle
- m_xVclContentArea = VclPtr<VclVBox>::Create(this);
- m_xVclContentArea->Show();
- m_xBuilder.reset(Application::CreateInterimBuilder(m_xVclContentArea, rUIXMLDescription, true));
- m_xContainer = m_xBuilder->weld_container(rID);
-}
-
-void PanelLayout::GetFocus()
+PanelLayout::PanelLayout(weld::Widget* pParent, const OString& rID, const OUString& rUIXMLDescription)
+ : m_xBuilder(Application::CreateBuilder(pParent, rUIXMLDescription))
+ , m_xContainer(m_xBuilder->weld_container(rID))
{
- Control::GetFocus();
- if (m_pInitialFocusWidget)
- m_pInitialFocusWidget->grab_focus();
+ m_xContainer->set_background(Theme::GetColor(Theme::Color_PanelBackground));
+ m_xContainer->connect_get_property_tree(LINK(this, PanelLayout, DumpAsPropertyTreeHdl));
+ ::Application::AddEventListener(LINK(this, PanelLayout, DataChangedEventListener));
}
-PanelLayout::~PanelLayout()
+IMPL_LINK(PanelLayout, DumpAsPropertyTreeHdl, tools::JsonWriter&, rJsonWriter, void)
{
- disposeOnce();
+ DumpAsPropertyTree(rJsonWriter);
}
-void PanelLayout::dispose()
+void PanelLayout::DumpAsPropertyTree(tools::JsonWriter&)
{
- m_bInClose = true;
- m_pInitialFocusWidget = nullptr;
- m_aPanelLayoutIdle.Stop();
- m_xContainer.reset();
- m_xBuilder.reset();
- m_xVclContentArea.disposeAndClear();
- Control::dispose();
}
-Size PanelLayout::GetOptimalSize() const
+IMPL_LINK(PanelLayout, DataChangedEventListener, VclSimpleEvent&, rEvent, void)
{
- Size aSize = m_xContainer->get_preferred_size();
-
- if (mxFrame)
- {
- SidebarController* pController
- = SidebarController::GetSidebarControllerForFrame(mxFrame);
- if (pController)
- aSize.setWidth(std::min<tools::Long>(
- aSize.Width(), (pController->getMaximumWidth() - TabBar::GetDefaultWidth())
- * GetDPIScaleFactor()));
- }
+ if (rEvent.GetId() != VclEventId::ApplicationDataChanged)
+ return;
- return aSize;
+ DataChangedEvent* pData = static_cast<DataChangedEvent*>(static_cast<VclWindowEvent&>(rEvent).GetData());
+ DataChanged(*pData);
}
-void PanelLayout::queue_resize(StateChangedType /*eReason*/)
+void PanelLayout::DataChanged(const DataChangedEvent& rEvent)
{
- if (m_bInClose)
- return;
- if (m_aPanelLayoutIdle.IsActive())
+ if (rEvent.GetType() != DataChangedEventType::SETTINGS)
return;
- InvalidateSizeCache();
- m_aPanelLayoutIdle.Start();
+ if (rEvent.GetFlags() & AllSettingsFlags::STYLE)
+ m_xContainer->set_background(Theme::GetColor(Theme::Color_PanelBackground));
}
-IMPL_LINK_NOARG( PanelLayout, ImplHandlePanelLayoutTimerHdl, Timer*, void )
+void PanelLayout::SetPanel(sfx2::sidebar::Panel* pPanel)
{
- vcl::Window *pChild = GetWindow(GetWindowType::FirstChild);
- assert(pChild);
- VclContainer::setLayoutAllocation(*pChild, Point(0, 0), GetSizePixel());
+ m_xPanel = pPanel;
}
-void PanelLayout::setPosSizePixel(tools::Long nX, tools::Long nY, tools::Long nWidth, tools::Long nHeight, PosSizeFlags nFlags)
+weld::Window* PanelLayout::GetFrameWeld() const
{
- bool bCanHandleSmallerWidth = false;
- bool bCanHandleSmallerHeight = false;
-
- vcl::Window *pChild = GetWindow(GetWindowType::FirstChild);
-
- if (pChild->GetType() == WindowType::SCROLLWINDOW)
+ if (!m_xPanel)
{
- WinBits nStyle = pChild->GetStyle();
- if (nStyle & (WB_AUTOHSCROLL | WB_HSCROLL))
- bCanHandleSmallerWidth = true;
- if (nStyle & (WB_AUTOVSCROLL | WB_VSCROLL))
- bCanHandleSmallerHeight = true;
+ SAL_WARN("sfx.sidebar", "Expected a toplevel Panel to exist");
+ return nullptr;
}
+ return m_xPanel->GetFrameWeld();
+}
- Size aSize(GetOptimalSize());
- if (!bCanHandleSmallerWidth)
- nWidth = std::max(nWidth,aSize.Width());
- if (!bCanHandleSmallerHeight)
- nHeight = std::max(nHeight,aSize.Height());
-
- Control::setPosSizePixel(nX, nY, nWidth, nHeight, nFlags);
+PanelLayout::~PanelLayout()
+{
+ ::Application::RemoveEventListener(LINK(this, PanelLayout, DataChangedEventListener));
- if (nFlags & PosSizeFlags::Size)
- VclContainer::setLayoutAllocation(*pChild, Point(0, 0), Size(nWidth, nHeight));
+ m_xContainer.reset();
+ m_xBuilder.reset();
}
-bool PanelLayout::EventNotify(NotifyEvent& rNEvt)
+void PanelLayout::queue_resize()
{
- if (rNEvt.GetType() == MouseNotifyEvent::COMMAND)
- Accelerator::ToggleMnemonicsOnHierarchy(*rNEvt.GetCommandEvent(), this);
- return Control::EventNotify( rNEvt );
+ if (!m_xContainer)
+ return;
+ m_xContainer->queue_resize();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/sidebar/ResourceManager.cxx b/sfx2/source/sidebar/ResourceManager.cxx
index a1ff9752e1e0..52d4c2d3ae0a 100644
--- a/sfx2/source/sidebar/ResourceManager.cxx
+++ b/sfx2/source/sidebar/ResourceManager.cxx
@@ -451,6 +451,7 @@ void ResourceManager::ReadPanelList()
rPanelDescriptor.mnOrderIndex = getInt32(aPanelNode, "OrderIndex");
rPanelDescriptor.mbShowForReadOnlyDocuments = getBool(aPanelNode, "ShowForReadOnlyDocument");
rPanelDescriptor.mbWantsCanvas = getBool(aPanelNode, "WantsCanvas");
+ rPanelDescriptor.mbWantsAWT = getBool(aPanelNode, "WantsAWT");
rPanelDescriptor.mbExperimental = getBool(aPanelNode, "IsExperimental");
const OUString sDefaultMenuCommand(getString(aPanelNode, "DefaultMenuCommand"));
@@ -692,6 +693,8 @@ void ResourceManager::ReadLegacyAddons (const Reference<frame::XController>& rxC
rPanelDescriptor.mnOrderIndex = 100000 + nReadIndex;
rPanelDescriptor.mbShowForReadOnlyDocuments = false;
rPanelDescriptor.mbWantsCanvas = false;
+ rPanelDescriptor.mbWantsAWT = true;
+ fprintf(stderr, "THIS PLACE\n");
rPanelDescriptor.maContextList.AddContextDescription(Context(sModuleName, "any"), true, OUString());
}
}
diff --git a/sfx2/source/sidebar/SidebarPanelBase.cxx b/sfx2/source/sidebar/SidebarPanelBase.cxx
index 9ca1d7ccb431..6d15bf8b284c 100644
--- a/sfx2/source/sidebar/SidebarPanelBase.cxx
+++ b/sfx2/source/sidebar/SidebarPanelBase.cxx
@@ -16,8 +16,8 @@
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#include <sfx2/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/SidebarPanelBase.hxx>
-#include <sfx2/sidebar/Theme.hxx>
#include <sfx2/sidebar/ILayoutableWindow.hxx>
#include <sfx2/sidebar/IContextChangeReceiver.hxx>
#include <sfx2/sidebar/SidebarModelUpdate.hxx>
@@ -35,14 +35,14 @@ namespace sfx2::sidebar {
Reference<ui::XUIElement> SidebarPanelBase::Create (
const OUString& rsResourceURL,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- vcl::Window* pWindow,
+ std::unique_ptr<PanelLayout> xControl,
const css::ui::LayoutSize& rLayoutSize)
{
Reference<ui::XUIElement> xUIElement (
new SidebarPanelBase(
rsResourceURL,
rxFrame,
- pWindow,
+ std::move(xControl),
rLayoutSize));
return xUIElement;
}
@@ -50,11 +50,11 @@ Reference<ui::XUIElement> SidebarPanelBase::Create (
SidebarPanelBase::SidebarPanelBase (
const OUString& rsResourceURL,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- vcl::Window* pWindow,
+ std::unique_ptr<PanelLayout> xControl,
const css::ui::LayoutSize& rLayoutSize)
: SidebarPanelBaseInterfaceBase(m_aMutex),
mxFrame(rxFrame),
- mpControl(pWindow),
+ mxControl(std::move(xControl)),
msResourceURL(rsResourceURL),
maLayoutSize(rLayoutSize)
{
@@ -65,22 +65,24 @@ SidebarPanelBase::SidebarPanelBase (
::comphelper::getProcessComponentContext()));
xMultiplexer->addContextChangeEventListener(this, mxFrame->getController());
}
- if (mpControl != nullptr)
- {
- mpControl->SetBackground(Theme::GetColor(Theme::Color_PanelBackground));
- mpControl->Show();
- }
}
SidebarPanelBase::~SidebarPanelBase()
{
}
+void SidebarPanelBase::SetParentPanel(sfx2::sidebar::Panel* pPanel)
+{
+ if (!mxControl)
+ return;
+ mxControl->SetPanel(pPanel);
+}
+
void SAL_CALL SidebarPanelBase::disposing()
{
SolarMutexGuard aGuard;
- mpControl.disposeAndClear();
+ mxControl.reset();
if (mxFrame.is())
{
@@ -99,7 +101,7 @@ void SAL_CALL SidebarPanelBase::notifyContextChangeEvent (
SolarMutexGuard aGuard;
IContextChangeReceiver* pContextChangeReceiver
- = dynamic_cast<IContextChangeReceiver*>(mpControl.get());
+ = dynamic_cast<IContextChangeReceiver*>(mxControl.get());
if (pContextChangeReceiver != nullptr)
{
const vcl::EnumContext aContext(
@@ -115,7 +117,7 @@ void SAL_CALL SidebarPanelBase::disposing (
SolarMutexGuard aGuard;
mxFrame = nullptr;
- mpControl = nullptr;
+ mxControl.reset();
}
css::uno::Reference<css::frame::XFrame> SAL_CALL SidebarPanelBase::getFrame()
@@ -141,20 +143,14 @@ Reference<XInterface> SAL_CALL SidebarPanelBase::getRealInterface()
Reference<accessibility::XAccessible> SAL_CALL SidebarPanelBase::createAccessible (
const Reference<accessibility::XAccessible>&)
{
- // Not yet implemented.
+ // Not implemented.
return nullptr;
}
Reference<awt::XWindow> SAL_CALL SidebarPanelBase::getWindow()
{
- SolarMutexGuard aGuard;
-
- if (mpControl != nullptr)
- return Reference<awt::XWindow>(
- mpControl->GetComponentInterface(),
- UNO_QUERY);
- else
- return nullptr;
+ // Not implemented
+ return nullptr;
}
ui::LayoutSize SAL_CALL SidebarPanelBase::getHeightForWidth (const sal_Int32 nWidth)
@@ -163,46 +159,33 @@ ui::LayoutSize SAL_CALL SidebarPanelBase::getHeightForWidth (const sal_Int32 nWi
if (maLayoutSize.Minimum >= 0)
return maLayoutSize;
+
+ ILayoutableWindow* pLayoutableWindow = dynamic_cast<ILayoutableWindow*>(mxControl.get());
+ if (pLayoutableWindow)
+ return pLayoutableWindow->GetHeightForWidth(nWidth);
else
{
- ILayoutableWindow* pLayoutableWindow = dynamic_cast<ILayoutableWindow*>(mpControl.get());
- if (pLayoutableWindow)
- return pLayoutableWindow->GetHeightForWidth(nWidth);
- else if (isLayoutEnabled(mpControl))
- {
- // widget layout-based sidebar
- mpControl->queue_resize();
- Size aSize(mpControl->get_preferred_size());
- return ui::LayoutSize(aSize.Height(), aSize.Height(), aSize.Height());
- }
- else if (mpControl != nullptr)
- {
- const sal_Int32 nHeight (mpControl->GetSizePixel().Height());
- return ui::LayoutSize(nHeight,nHeight,nHeight);
- }
+ // widget layout-based sidebar
+ mxControl->queue_resize();
+ Size aSize(mxControl->get_preferred_size());
+ return ui::LayoutSize(aSize.Height(), aSize.Height(), aSize.Height());
}
-
- return ui::LayoutSize(0,0,0);
}
sal_Int32 SAL_CALL SidebarPanelBase::getMinimalWidth ()
{
SolarMutexGuard aGuard;
- if (isLayoutEnabled(mpControl))
- {
- // widget layout-based sidebar
- Size aSize(mpControl->get_preferred_size());
- return aSize.Width();
- }
- return 0;
+ // widget layout-based sidebar
+ Size aSize(mxControl->get_preferred_size());
+ return aSize.Width();
}
void SAL_CALL SidebarPanelBase::updateModel(const css::uno::Reference<css::frame::XModel>& xModel)
{
SolarMutexGuard aGuard;
- SidebarModelUpdate* pModelUpdate = dynamic_cast<SidebarModelUpdate*>(mpControl.get());
+ SidebarModelUpdate* pModelUpdate = dynamic_cast<SidebarModelUpdate*>(mxControl.get());
if (!pModelUpdate)
return;
diff --git a/sfx2/uiconfig/ui/navigator.ui b/sfx2/uiconfig/ui/navigator.ui
new file mode 100644
index 000000000000..e7dd8ca09087
--- /dev/null
+++ b/sfx2/uiconfig/ui/navigator.ui
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Generated with glade 3.38.2 -->
+<interface domain="sfx">
+ <requires lib="gtk+" version="3.20"/>
+ <object class="GtkBox" id="Navigator">
+ <property name="visible">True</property>
+ <property name="can-focus">False</property>
+ <property name="hexpand">True</property>
+ <property name="vexpand">True</property>
+ <child>
+ <placeholder/>
+ </child>
+ </object>
+</interface>
diff --git a/solenv/sanitizers/ui/sfx.suppr b/solenv/sanitizers/ui/sfx.suppr
index 58a6dc14654f..2e36d5228275 100644
--- a/solenv/sanitizers/ui/sfx.suppr
+++ b/solenv/sanitizers/ui/sfx.suppr
@@ -46,8 +46,6 @@ sfx2/uiconfig/ui/templatepanel.ui://GtkToggleToolButton[@id='5'] button-no-label
sfx2/uiconfig/ui/templatepanel.ui://GtkToggleToolButton[@id='6'] button-no-label
sfx2/uiconfig/ui/templatepanel.ui://GtkToggleToolButton[@id='65535'] button-no-label
sfx2/uiconfig/ui/templatedlg.ui://GtkLabel[@id='label1'] orphan-label
-sfx2/uiconfig/ui/paneltitlebar.ui://GtkImage[@id='addonimage'] no-labelled-by
-sfx2/uiconfig/ui/paneltitlebar.ui://GtkToolButton[@id='button'] button-no-label
sfx2/uiconfig/ui/versioncommentdialog.ui://GtkLabel[@id='timestamp'] orphan-label
sfx2/uiconfig/ui/versioncommentdialog.ui://GtkLabel[@id='author'] orphan-label
sfx2/uiconfig/ui/versioncommentdialog.ui://GtkTextView[@id='textview'] no-labelled-by
diff --git a/svx/inc/GalleryControl.hxx b/svx/inc/GalleryControl.hxx
index 8f8e6339df85..d5835fb5759b 100644
--- a/svx/inc/GalleryControl.hxx
+++ b/svx/inc/GalleryControl.hxx
@@ -36,17 +36,13 @@ namespace svx::sidebar
class UNLESS_MERGELIBS(SVXCORE_DLLPUBLIC) GalleryControl final : public PanelLayout
{
public:
- GalleryControl(vcl::Window* pParentWindow);
+ GalleryControl(weld::Widget* pParentWindow);
+ virtual ~GalleryControl() override;
private:
Gallery* mpGallery;
std::unique_ptr<GalleryBrowser1> mxBrowser1;
std::unique_ptr<GalleryBrowser2> mxBrowser2;
-
- virtual void GetFocus() override;
-
- virtual ~GalleryControl() override;
- virtual void dispose() override;
};
} // end of namespace svx::sidebar
diff --git a/svx/inc/galbrws2.hxx b/svx/inc/galbrws2.hxx
index bbf13cff5c3f..bbf3796b4d75 100644
--- a/svx/inc/galbrws2.hxx
+++ b/svx/inc/galbrws2.hxx
@@ -26,6 +26,7 @@
#include <svtools/miscopt.hxx>
#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
diff --git a/svx/source/gallery2/GalleryControl.cxx b/svx/source/gallery2/GalleryControl.cxx
index 7ecbffaa90bf..d7b2a969357f 100644
--- a/svx/source/gallery2/GalleryControl.cxx
+++ b/svx/source/gallery2/GalleryControl.cxx
@@ -25,8 +25,8 @@
namespace svx::sidebar {
-GalleryControl::GalleryControl(vcl::Window* pParent)
- : PanelLayout(pParent, "GalleryPanel", "svx/ui/sidebargallery.ui", nullptr)
+GalleryControl::GalleryControl(weld::Widget* pParent)
+ : PanelLayout(pParent, "GalleryPanel", "svx/ui/sidebargallery.ui")
, mpGallery(Gallery::GetGalleryInstance())
, mxBrowser1(new GalleryBrowser1(
*m_xBuilder,
@@ -36,26 +36,10 @@ GalleryControl::GalleryControl(vcl::Window* pParent)
, mxBrowser2(new GalleryBrowser2(*m_xBuilder, mpGallery))
{
mxBrowser1->SelectTheme(0);
- m_pInitialFocusWidget = mxBrowser1->GetInitialFocusWidget();
}
GalleryControl::~GalleryControl()
{
- disposeOnce();
-}
-
-void GalleryControl::dispose()
-{
- mxBrowser2.reset();
- mxBrowser1.reset();
- PanelLayout::dispose();
-}
-
-void GalleryControl::GetFocus()
-{
- Window::GetFocus();
- if (mxBrowser1)
- mxBrowser1->GrabFocus();
}
} // end of namespace svx::sidebar
diff --git a/svx/source/inc/DefaultShapesPanel.hxx b/svx/source/inc/DefaultShapesPanel.hxx
index 6067c05b5312..6c2781b4ef6d 100644
--- a/svx/source/inc/DefaultShapesPanel.hxx
+++ b/svx/source/inc/DefaultShapesPanel.hxx
@@ -38,13 +38,12 @@ class DefaultShapesPanel
{
public:
DefaultShapesPanel (
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
- static VclPtr<vcl::Window> Create(
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create(
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
virtual ~DefaultShapesPanel() override;
- virtual void dispose() override;
private:
std::unique_ptr<ValueSet> mxLineArrowSet;
diff --git a/svx/source/sidebar/EmptyPanel.cxx b/svx/source/sidebar/EmptyPanel.cxx
index f3640a4e91cc..3bc21636b295 100644
--- a/svx/source/sidebar/EmptyPanel.cxx
+++ b/svx/source/sidebar/EmptyPanel.cxx
@@ -21,19 +21,13 @@
namespace svx::sidebar
{
-EmptyPanel::EmptyPanel(vcl::Window* pParent)
- : PanelLayout(pParent, "EmptyPanel", "svx/ui/sidebarempty.ui", nullptr)
+EmptyPanel::EmptyPanel(weld::Widget* pParent)
+ : PanelLayout(pParent, "EmptyPanel", "svx/ui/sidebarempty.ui")
, mxMessageControl(m_xBuilder->weld_label("message"))
{
}
-EmptyPanel::~EmptyPanel() { disposeOnce(); }
-
-void EmptyPanel::dispose()
-{
- mxMessageControl.reset();
- PanelLayout::dispose();
-}
+EmptyPanel::~EmptyPanel() {}
} // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/EmptyPanel.hxx b/svx/source/sidebar/EmptyPanel.hxx
index 8abd46d509c5..26007a5302cc 100644
--- a/svx/source/sidebar/EmptyPanel.hxx
+++ b/svx/source/sidebar/EmptyPanel.hxx
@@ -29,9 +29,8 @@ namespace svx::sidebar
class EmptyPanel final : public PanelLayout
{
public:
- explicit EmptyPanel(vcl::Window* pParent);
+ explicit EmptyPanel(weld::Widget* pParent);
virtual ~EmptyPanel() override;
- virtual void dispose() override;
private:
std::unique_ptr<weld::Label> mxMessageControl;
diff --git a/svx/source/sidebar/PanelFactory.cxx b/svx/source/sidebar/PanelFactory.cxx
index d6085796f743..1817088fc534 100644
--- a/svx/source/sidebar/PanelFactory.cxx
+++ b/svx/source/sidebar/PanelFactory.cxx
@@ -38,8 +38,7 @@
#include "EmptyPanel.hxx"
#include <sfx2/sidebar/SidebarPanelBase.hxx>
#include <sfx2/templdlg.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
-#include <vcl/window.hxx>
+#include <vcl/weldutils.hxx>
#include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/basemutex.hxx>
#include <cppuhelper/compbase.hxx>
@@ -104,8 +103,11 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::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);
@@ -118,85 +120,85 @@ Reference<ui::XUIElement> SAL_CALL PanelFactory::createUIElement (
"PanelFactory::createUIElement called without SfxBindings",
nullptr);
- VclPtr<vcl::Window> pControl;
+ std::unique_ptr<PanelLayout> xControl;
ui::LayoutSize aLayoutSize (-1,-1,-1);
if (rsResourceURL.endsWith("/TextPropertyPanel"))
{
- pControl = TextPropertyPanel::Create(pParentWindow, xFrame);
+ xControl = TextPropertyPanel::Create(pParent, xFrame);
}
else if (rsResourceURL.endsWith("/StylesPropertyPanel"))
{
- pControl = StylesPropertyPanel::Create(pParentWindow, xFrame);
+ xControl = StylesPropertyPanel::Create(pParent, xFrame);
}
else if (rsResourceURL.endsWith("/ParaPropertyPanel"))
{
- pControl = ParaPropertyPanel::Create(pParentWindow, xFrame, pBindings, xSidebar);
+ xControl = ParaPropertyPanel::Create(pParent, xFrame, pBindings, xSidebar);
}
else if (rsResourceURL.endsWith("/ListsPropertyPanel"))
{
- pControl = ListsPropertyPanel::Create(pParentWindow, xFrame);
+ xControl = ListsPropertyPanel::Create(pParent, xFrame);
}
else if (rsResourceURL.endsWith("/AreaPropertyPanel"))
{
- pControl = AreaPropertyPanel::Create(pParentWindow, xFrame, pBindings);
+ xControl = AreaPropertyPanel::Create(pParent, xFrame, pBindings);
}
else if (rsResourceURL.endsWith("/FontworkPropertyPanel"))
{
- pControl = FontworkPropertyPanel::Create(pParentWindow, xFrame);
+ xControl = FontworkPropertyPanel::Create(pParent, xFrame);
}
else if (rsResourceURL.endsWith("/ShadowPropertyPanel"))
{
- pControl = ShadowPropertyPanel::Create(pParentWindow, xFrame, pBindings);
+ xControl = ShadowPropertyPanel::Create(pParent, pBindings);
}
else if (rsResourceURL.endsWith("/EffectPropertyPanel"))
{
- pControl = EffectPropertyPanel::Create(pParentWindow, xFrame, pBindings);
+ xControl = EffectPropertyPanel::Create(pParent, pBindings);
}
else if (rsResourceURL.endsWith("/GraphicPropertyPanel"))
{
- pControl = GraphicPropertyPanel::Create(pParentWindow, xFrame, pBindings);
+ xControl = GraphicPropertyPanel::Create(pParent, pBindings);
}
else if (rsResourceURL.endsWith("/LinePropertyPanel"))
{
- pControl = LinePropertyPanel::Create(pParentWindow, xFrame, pBindings);
+ xControl = LinePropertyPanel::Create(pParent, xFrame, pBindings);
}
else if (rsResourceURL.endsWith("/PosSizePropertyPanel"))
{
- pControl = PosSizePropertyPanel::Create(pParentWindow, xFrame, pBindings, xSidebar);
+ xControl = PosSizePropertyPanel::Create(pParent, xFrame, pBindings, xSidebar);
}
else if (rsResourceURL.endsWith("/DefaultShapesPanel"))
{
- pControl = DefaultShapesPanel::Create(pParentWindow, xFrame);
+ xControl = DefaultShapesPanel::Create(pParent, xFrame);
}
#if HAVE_FEATURE_AVMEDIA
else if (rsResourceURL.endsWith("/MediaPlaybackPanel"))
{
- pControl = MediaPlaybackPanel::Create(pParentWindow, xFrame, pBindings);
+ xControl = MediaPlaybackPanel::Create(pParent, pBindings);
}
#endif
else if (rsResourceURL.endsWith("/GalleryPanel"))
{
- pControl.reset(VclPtr<GalleryControl>::Create(pParentWindow));
+ xControl = std::make_unique<GalleryControl>(pParent);
aLayoutSize = ui::LayoutSize(300,-1,400);
}
else if (rsResourceURL.endsWith("/StyleListPanel"))
{
- pControl.reset(VclPtr<SfxTemplatePanelControl>::Create(pBindings, pParentWindow));
+ xControl = std::make_unique<SfxTemplatePanelControl>(pBindings, pParent);
aLayoutSize = ui::LayoutSize(0,-1,-1);
}
else if (rsResourceURL.endsWith("/EmptyPanel"))
{
- pControl.reset(VclPtr<EmptyPanel>::Create(pParentWindow));
+ xControl = std::make_unique<EmptyPanel>(pParent);
aLayoutSize = ui::LayoutSize(20,-1, 50);
}
- if (pControl)
+ if (xControl)
{
return sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
- pControl,
+ std::move(xControl),
aLayoutSize);
}
else
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.cxx b/svx/source/sidebar/area/AreaPropertyPanel.cxx
index f71754888d19..b4d22f6823ab 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.cxx
@@ -31,7 +31,7 @@ using namespace css::uno;
namespace svx::sidebar {
AreaPropertyPanel::AreaPropertyPanel(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
: AreaPropertyPanelBase(pParent, rxFrame),
@@ -52,11 +52,6 @@ AreaPropertyPanel::AreaPropertyPanel(
AreaPropertyPanel::~AreaPropertyPanel()
{
- disposeOnce();
-}
-
-void AreaPropertyPanel::dispose()
-{
maStyleControl.dispose();
maColorControl.dispose();
maGradientControl.dispose();
@@ -68,12 +63,10 @@ void AreaPropertyPanel::dispose()
maPatternListControl.dispose();
maFillTransparenceController.dispose();
maFillFloatTransparenceController.dispose();
-
- AreaPropertyPanelBase::dispose();
}
-VclPtr<vcl::Window> AreaPropertyPanel::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> AreaPropertyPanel::Create (
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
{
@@ -84,10 +77,7 @@ VclPtr<vcl::Window> AreaPropertyPanel::Create (
if (pBindings == nullptr)
throw lang::IllegalArgumentException("no SfxBindings given to AreaPropertyPanel::Create", nullptr, 2);
- return VclPtr<AreaPropertyPanel>::Create(
- pParent,
- rxFrame,
- pBindings);
+ return std::make_unique<AreaPropertyPanel>(pParent, rxFrame, pBindings);
}
void AreaPropertyPanel::setFillTransparence(const XFillTransparenceItem& rItem)
diff --git a/svx/source/sidebar/area/AreaPropertyPanel.hxx b/svx/source/sidebar/area/AreaPropertyPanel.hxx
index fb97c00b3691..ec7c1223d108 100644
--- a/svx/source/sidebar/area/AreaPropertyPanel.hxx
+++ b/svx/source/sidebar/area/AreaPropertyPanel.hxx
@@ -43,10 +43,8 @@ class AreaTransparencyGradientControl;
class AreaPropertyPanel : public AreaPropertyPanelBase
{
public:
- virtual void dispose() override;
-
- static VclPtr<vcl::Window> Create(
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create(
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
@@ -54,7 +52,7 @@ public:
// constructor/destructor
AreaPropertyPanel(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
diff --git a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
index 0cd20b236cc7..6ba32783b426 100644
--- a/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
+++ b/svx/source/sidebar/area/AreaPropertyPanelBase.cxx
@@ -61,9 +61,9 @@ const sal_Int32 AreaPropertyPanelBase::DEFAULT_ENDVALUE = 16777215;
const sal_Int32 AreaPropertyPanelBase::DEFAULT_BORDER = 0;
AreaPropertyPanelBase::AreaPropertyPanelBase(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame)
- : PanelLayout(pParent, "AreaPropertyPanel", "svx/ui/sidebararea.ui", rxFrame),
+ : PanelLayout(pParent, "AreaPropertyPanel", "svx/ui/sidebararea.ui"),
meLastXFS(static_cast<sal_uInt16>(-1)),
mnLastPosHatch(0),
mnLastPosBitmap(0),
@@ -104,20 +104,11 @@ AreaPropertyPanelBase::AreaPropertyPanelBase(
mpFloatTransparenceItem(),
mpTransparanceItem()
{
- mpPanel = dynamic_cast<sfx2::sidebar::Panel*>(pParent);
-
Initialize();
-
- m_pInitialFocusWidget = mxLbFillType.get();
}
AreaPropertyPanelBase::~AreaPropertyPanelBase()
{
- disposeOnce();
-}
-
-void AreaPropertyPanelBase::dispose()
-{
mxTrGrPopup.reset();
mxColorTextFT.reset();
mxLbFillType.reset();
@@ -134,9 +125,6 @@ void AreaPropertyPanelBase::dispose()
mxLbFillGradTo.reset();
mxGradientStyle.reset();
mxBmpImport.reset();
- mpPanel.clear();
-
- PanelLayout::dispose();
}
void AreaPropertyPanelBase::Initialize()
@@ -449,8 +437,8 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillTypeHdl, weld::ComboBox&, void)
meLastXFS = static_cast<sal_uInt16>(nPos);
- if(mpPanel)
- mpPanel->TriggerDeckLayouting();
+ if (m_xPanel)
+ m_xPanel->TriggerDeckLayouting();
}
IMPL_LINK_NOARG(AreaPropertyPanelBase, SelectFillColorHdl, ColorListBox&, void)
@@ -468,11 +456,6 @@ IMPL_LINK_NOARG(AreaPropertyPanelBase, ChangeGradientAngle, weld::MetricSpinButt
SelectFillAttrHdl_Impl();
}
-void AreaPropertyPanelBase::DataChanged(
- const DataChangedEvent& /*rEvent*/)
-{
-}
-
void AreaPropertyPanelBase::SelectFillAttrHdl_Impl()
{
sal_Int32 nPosFillStyle = static_cast<eFillStyle>(mxLbFillType->get_active());
@@ -613,8 +596,8 @@ void AreaPropertyPanelBase::SelectFillAttrHdl_Impl()
break;
}
}
- if(mpPanel)
- mpPanel->TriggerDeckLayouting();
+ if (m_xPanel)
+ m_xPanel->TriggerDeckLayouting();
}
void AreaPropertyPanelBase::ImpUpdateTransparencies()
@@ -869,8 +852,8 @@ void AreaPropertyPanelBase::updateFillStyle(bool bDisabled, bool bDefaultOrSet,
mxToolBoxColor->hide();
meLastXFS = static_cast<sal_uInt16>(-1);
mpStyleItem.reset();
- if(mpPanel)
- mpPanel->TriggerDeckLayouting();
+ if (m_xPanel)
+ m_xPanel->TriggerDeckLayouting();
}
void AreaPropertyPanelBase::updateFillGradient(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
@@ -910,8 +893,8 @@ void AreaPropertyPanelBase::updateFillGradient(bool bDisabled, bool bDefaultOrSe
mxLbFillGradTo->SetNoSelection();
}
}
- if(mpPanel)
- mpPanel->TriggerDeckLayouting();
+ if (m_xPanel)
+ m_xPanel->TriggerDeckLayouting();
}
void AreaPropertyPanelBase::updateFillHatch(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
@@ -943,8 +926,8 @@ void AreaPropertyPanelBase::updateFillHatch(bool bDisabled, bool bDefaultOrSet,
mxLbFillAttr->set_active(-1);
}
}
- if(mpPanel)
- mpPanel->TriggerDeckLayouting();
+ if (m_xPanel)
+ m_xPanel->TriggerDeckLayouting();
}
void AreaPropertyPanelBase::updateFillColor(bool bDefaultOrSet, const SfxPoolItem* pState)
@@ -962,8 +945,8 @@ void AreaPropertyPanelBase::updateFillColor(bool bDefaultOrSet, const SfxPoolIte
mxLbFillType->set_active(SOLID);
Update();
}
- if(mpPanel)
- mpPanel->TriggerDeckLayouting();
+ if (m_xPanel)
+ m_xPanel->TriggerDeckLayouting();
}
void AreaPropertyPanelBase::updateFillBitmap(bool bDisabled, bool bDefaultOrSet, const SfxPoolItem* pState)
@@ -997,8 +980,8 @@ void AreaPropertyPanelBase::updateFillBitmap(bool bDisabled, bool bDefaultOrSet,
mxLbFillAttr->set_active(-1);
}
}
- if(mpPanel)
- mpPanel->TriggerDeckLayouting();
+ if (m_xPanel)
+ m_xPanel->TriggerDeckLayouting();
}
void AreaPropertyPanelBase::NotifyItemUpdate(
@@ -1265,8 +1248,8 @@ void AreaPropertyPanelBase::Update()
OSL_ENSURE(false, "Non supported FillType (!)");
break;
}
- if(mpPanel)
- mpPanel->TriggerDeckLayouting();
+ if (m_xPanel)
+ m_xPanel->TriggerDeckLayouting();
}
IMPL_LINK_NOARG(AreaPropertyPanelBase, ModifyTransSliderHdl, weld::Scale&, void)
diff --git a/svx/source/sidebar/effect/EffectPropertyPanel.cxx b/svx/source/sidebar/effect/EffectPropertyPanel.cxx
index 6b43c0d52cce..44b825aa77f4 100644
--- a/svx/source/sidebar/effect/EffectPropertyPanel.cxx
+++ b/svx/source/sidebar/effect/EffectPropertyPanel.cxx
@@ -23,10 +23,8 @@
namespace svx::sidebar
{
-EffectPropertyPanel::EffectPropertyPanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
- : PanelLayout(pParent, "EffectPropertyPanel", "svx/ui/sidebareffect.ui", rxFrame)
+EffectPropertyPanel::EffectPropertyPanel(weld::Widget* pParent, SfxBindings* pBindings)
+ : PanelLayout(pParent, "EffectPropertyPanel", "svx/ui/sidebareffect.ui")
, maGlowColorController(SID_ATTR_GLOW_COLOR, *pBindings, *this)
, maGlowRadiusController(SID_ATTR_GLOW_RADIUS, *pBindings, *this)
, maGlowTransparencyController(SID_ATTR_GLOW_TRANSPARENCY, *pBindings, *this)
@@ -43,13 +41,9 @@ EffectPropertyPanel::EffectPropertyPanel(vcl::Window* pParent,
, mxSoftEdgeRadius(m_xBuilder->weld_metric_spin_button("SB_SOFTEDGE_RADIUS", FieldUnit::POINT))
{
Initialize();
-
- m_pInitialFocusWidget = &mxGlowRadius->get_widget();
}
-EffectPropertyPanel::~EffectPropertyPanel() { disposeOnce(); }
-
-void EffectPropertyPanel::dispose()
+EffectPropertyPanel::~EffectPropertyPanel()
{
mxGlowRadius.reset();
mxLBGlowColor.reset();
@@ -60,7 +54,6 @@ void EffectPropertyPanel::dispose()
mxSoftEdgeRadius.reset();
mxFTRadiusGlow.reset();
- PanelLayout::dispose();
maGlowColorController.dispose();
maGlowRadiusController.dispose();
maGlowTransparencyController.dispose();
@@ -169,22 +162,17 @@ void EffectPropertyPanel::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState eState,
UpdateControls();
}
-VclPtr<vcl::Window>
-EffectPropertyPanel::Create(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
+std::unique_ptr<PanelLayout> EffectPropertyPanel::Create(weld::Widget* pParent,
+ SfxBindings* pBindings)
{
if (pParent == nullptr)
throw css::lang::IllegalArgumentException(
"no parent Window given to EffectPropertyPanel::Create", nullptr, 0);
- if (!rxFrame.is())
- throw css::lang::IllegalArgumentException("no XFrame given to EffectPropertyPanel::Create",
- nullptr, 1);
if (pBindings == nullptr)
throw css::lang::IllegalArgumentException(
"no SfxBindings given to EffectPropertyPanel::Create", nullptr, 2);
- return VclPtr<EffectPropertyPanel>::Create(pParent, rxFrame, pBindings);
+ return std::make_unique<EffectPropertyPanel>(pParent, pBindings);
}
}
diff --git a/svx/source/sidebar/effect/EffectPropertyPanel.hxx b/svx/source/sidebar/effect/EffectPropertyPanel.hxx
index 771c642f99a2..d657d83e61ca 100644
--- a/svx/source/sidebar/effect/EffectPropertyPanel.hxx
+++ b/svx/source/sidebar/effect/EffectPropertyPanel.hxx
@@ -9,7 +9,6 @@
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_EFFECT_EFFECTPROPERTYPANEL_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_EFFECT_EFFECTPROPERTYPANEL_HXX
-#include <vcl/vclptr.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/PanelLayout.hxx>
@@ -21,15 +20,10 @@ class EffectPropertyPanel : public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- EffectPropertyPanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
+ EffectPropertyPanel(weld::Widget* pParent, SfxBindings* pBindings);
virtual ~EffectPropertyPanel() override;
- virtual void dispose() override;
- static VclPtr<vcl::Window> Create(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
+ static std::unique_ptr<PanelLayout> Create(weld::Widget* pParent, SfxBindings* pBindings);
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState,
const SfxPoolItem* pState) override;
diff --git a/svx/source/sidebar/fontwork/FontworkPropertyPanel.cxx b/svx/source/sidebar/fontwork/FontworkPropertyPanel.cxx
index 286f65109698..c8aaf0606dc1 100644
--- a/svx/source/sidebar/fontwork/FontworkPropertyPanel.cxx
+++ b/svx/source/sidebar/fontwork/FontworkPropertyPanel.cxx
@@ -39,9 +39,9 @@ namespace svx
{
namespace sidebar
{
-FontworkPropertyPanel::FontworkPropertyPanel(vcl::Window* pParent,
+FontworkPropertyPanel::FontworkPropertyPanel(weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame)
- : PanelLayout(pParent, "FontworkPropertyPanel", "svx/ui/sidebarfontwork.ui", rxFrame)
+ : PanelLayout(pParent, "FontworkPropertyPanel", "svx/ui/sidebarfontwork.ui")
, m_pToolbar(m_xBuilder->weld_toolbar("fontwork-toolbox"))
, m_xToolbar(new ToolbarUnoDispatcher(*m_pToolbar, *m_xBuilder, rxFrame))
{
@@ -49,18 +49,14 @@ FontworkPropertyPanel::FontworkPropertyPanel(vcl::Window* pParent,
m_pToolbar->set_item_visible(".uno:ExtrusionToggle", false);
}
-FontworkPropertyPanel::~FontworkPropertyPanel() { disposeOnce(); }
-
-void FontworkPropertyPanel::dispose()
+FontworkPropertyPanel::~FontworkPropertyPanel()
{
m_xToolbar.reset(nullptr);
m_pToolbar.reset(nullptr);
-
- PanelLayout::dispose();
}
-VclPtr<vcl::Window>
-FontworkPropertyPanel::Create(vcl::Window* pParent,
+std::unique_ptr<FontworkPropertyPanel>
+FontworkPropertyPanel::Create(weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame)
{
if (pParent == nullptr)
@@ -70,7 +66,7 @@ FontworkPropertyPanel::Create(vcl::Window* pParent,
throw lang::IllegalArgumentException("no XFrame given to FontworkPropertyPanel::Create",
nullptr, 1);
- return VclPtr<FontworkPropertyPanel>::Create(pParent, rxFrame);
+ return std::make_unique<FontworkPropertyPanel>(pParent, rxFrame);
}
}
} // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/fontwork/FontworkPropertyPanel.hxx b/svx/source/sidebar/fontwork/FontworkPropertyPanel.hxx
index 7c8c3a2a84bb..a433907dcdc6 100644
--- a/svx/source/sidebar/fontwork/FontworkPropertyPanel.hxx
+++ b/svx/source/sidebar/fontwork/FontworkPropertyPanel.hxx
@@ -30,14 +30,13 @@ namespace sidebar
class FontworkPropertyPanel : public PanelLayout
{
public:
- static VclPtr<vcl::Window> Create(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame);
+ static std::unique_ptr<FontworkPropertyPanel>
+ Create(weld::Widget* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame);
// constructor/destructor
- FontworkPropertyPanel(vcl::Window* pParent,
+ FontworkPropertyPanel(weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
~FontworkPropertyPanel();
- void dispose() override;
private:
std::unique_ptr<weld::Toolbar> m_pToolbar;
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
index b42509639ffd..5fb1e4448c71 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.cxx
@@ -36,10 +36,9 @@ namespace svx::sidebar {
GraphicPropertyPanel::GraphicPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings)
-: PanelLayout(pParent, "GraphicPropertyPanel", "svx/ui/sidebargraphic.ui", rxFrame),
+: PanelLayout(pParent, "GraphicPropertyPanel", "svx/ui/sidebargraphic.ui"),
maBrightControl(SID_ATTR_GRAF_LUMINANCE, *pBindings, *this),
maContrastControl(SID_ATTR_GRAF_CONTRAST, *pBindings, *this),
maTransparenceControl(SID_ATTR_GRAF_TRANSPARENCE, *pBindings, *this),
@@ -60,11 +59,6 @@ GraphicPropertyPanel::GraphicPropertyPanel(
GraphicPropertyPanel::~GraphicPropertyPanel()
{
- disposeOnce();
-}
-
-void GraphicPropertyPanel::dispose()
-{
mxMtrBrightness.reset();
mxMtrContrast.reset();
mxLBColorMode.reset();
@@ -78,8 +72,6 @@ void GraphicPropertyPanel::dispose()
maBlueControl.dispose();
maGammaControl.dispose();
maModeControl.dispose();
-
- PanelLayout::dispose();
}
void GraphicPropertyPanel::Initialize()
@@ -130,32 +122,18 @@ IMPL_LINK_NOARG( GraphicPropertyPanel, ClickColorModeHdl, weld::ComboBox&, void
SfxCallMode::RECORD, { &aTransItem });
}
-
-VclPtr<vcl::Window> GraphicPropertyPanel::Create (
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
+std::unique_ptr<PanelLayout> GraphicPropertyPanel::Create (
+ weld::Widget* pParent,
SfxBindings* pBindings)
{
if (pParent == nullptr)
throw lang::IllegalArgumentException("no parent Window given to GraphicPropertyPanel::Create", nullptr, 0);
- if ( ! rxFrame.is())
- throw lang::IllegalArgumentException("no XFrame given to GraphicPropertyPanel::Create", nullptr, 1);
if (pBindings == nullptr)
throw lang::IllegalArgumentException("no SfxBindings given to GraphicPropertyPanel::Create", nullptr, 2);
- return VclPtr<GraphicPropertyPanel>::Create(
- pParent,
- rxFrame,
- pBindings);
+ return std::make_unique<GraphicPropertyPanel>(pParent, pBindings);
}
-
-void GraphicPropertyPanel::DataChanged(
- const DataChangedEvent& /*rEvent*/)
-{
-}
-
-
void GraphicPropertyPanel::NotifyItemUpdate(
sal_uInt16 nSID,
SfxItemState eState,
@@ -262,7 +240,6 @@ void GraphicPropertyPanel::NotifyItemUpdate(
}
}
-
// namespace close
} // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
index d62f000ec34f..e7fd4914b3b1 100644
--- a/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
+++ b/svx/source/sidebar/graphic/GraphicPropertyPanel.hxx
@@ -31,16 +31,11 @@ class GraphicPropertyPanel
{
public:
virtual ~GraphicPropertyPanel() 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,
SfxBindings* pBindings);
- virtual void DataChanged(
- const DataChangedEvent& rEvent) override;
-
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
@@ -54,8 +49,7 @@ public:
// constructor/destructor
GraphicPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings);
private:
diff --git a/svx/source/sidebar/inspector/InspectorTextPanel.cxx b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
index 9b13a90dec87..d5ad3adedea6 100644
--- a/svx/source/sidebar/inspector/InspectorTextPanel.cxx
+++ b/svx/source/sidebar/inspector/InspectorTextPanel.cxx
@@ -32,23 +32,16 @@ using namespace css;
namespace svx::sidebar
{
-VclPtr<vcl::Window>
-InspectorTextPanel::Create(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame)
+std::unique_ptr<PanelLayout> InspectorTextPanel::Create(weld::Widget* pParent)
{
if (pParent == nullptr)
throw lang::IllegalArgumentException("no parent Window given to InspectorTextPanel::Create",
nullptr, 0);
- if (!rxFrame.is())
- throw lang::IllegalArgumentException("no XFrame given to InspectorTextPanel::Create",
- nullptr, 1);
-
- return VclPtr<InspectorTextPanel>::Create(pParent, rxFrame);
+ return std::make_unique<InspectorTextPanel>(pParent);
}
-InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame)
- : PanelLayout(pParent, "InspectorTextPanel", "svx/ui/inspectortextpanel.ui", rxFrame)
+InspectorTextPanel::InspectorTextPanel(weld::Widget* pParent)
+ : PanelLayout(pParent, "InspectorTextPanel", "svx/ui/inspectortextpanel.ui")
, mpListBoxStyles(m_xBuilder->weld_tree_view("listbox_fonts"))
{
mpListBoxStyles->set_size_request(-1, -1);
@@ -57,7 +50,6 @@ InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent,
aWidths.push_back(fWidth * 34);
aWidths.push_back(fWidth * 34);
mpListBoxStyles->set_column_fixed_widths(aWidths);
- m_pInitialFocusWidget = mpListBoxStyles.get();
}
static bool GetPropertyValues(const OUString& rPropName, const uno::Any& rAny, OUString& rString)
@@ -157,14 +149,7 @@ void InspectorTextPanel::updateEntries(const std::vector<TreeNode>& rStore)
mpListBoxStyles->collapse_row(*pEntry); // Collapse "Default Paragraph Style"
}
-InspectorTextPanel::~InspectorTextPanel() { disposeOnce(); }
-
-void InspectorTextPanel::dispose()
-{
- mpListBoxStyles.reset();
-
- PanelLayout::dispose();
-}
+InspectorTextPanel::~InspectorTextPanel() {}
} // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/line/LinePropertyPanel.cxx b/svx/source/sidebar/line/LinePropertyPanel.cxx
index 2e5f0eed9070..acd75820f58d 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.cxx
@@ -33,7 +33,7 @@ using namespace css::uno;
namespace svx::sidebar {
LinePropertyPanel::LinePropertyPanel(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
: LinePropertyPanelBase(pParent, rxFrame),
@@ -51,23 +51,16 @@ LinePropertyPanel::LinePropertyPanel(
LinePropertyPanel::~LinePropertyPanel()
{
- disposeOnce();
-}
-
-void LinePropertyPanel::dispose()
-{
maStyleControl.dispose();
maDashControl.dispose();
maWidthControl.dispose();
maTransControl.dispose();
maEdgeStyle.dispose();
maCapStyle.dispose();
-
- LinePropertyPanelBase::dispose();
}
-VclPtr<vcl::Window> LinePropertyPanel::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> LinePropertyPanel::Create (
+ weld::Widget* pParent,
const uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
{
@@ -78,7 +71,7 @@ VclPtr<vcl::Window> LinePropertyPanel::Create (
if (pBindings == nullptr)
throw lang::IllegalArgumentException("no SfxBindings given to LinePropertyPanel::Create", nullptr, 2);
- return VclPtr<LinePropertyPanel>::Create(pParent, rxFrame, pBindings);
+ return std::make_unique<LinePropertyPanel>(pParent, rxFrame, pBindings);
}
void LinePropertyPanel::NotifyItemUpdate(
diff --git a/svx/source/sidebar/line/LinePropertyPanel.hxx b/svx/source/sidebar/line/LinePropertyPanel.hxx
index 0402918b82bc..2bfb34b0d593 100644
--- a/svx/source/sidebar/line/LinePropertyPanel.hxx
+++ b/svx/source/sidebar/line/LinePropertyPanel.hxx
@@ -43,10 +43,9 @@ class LinePropertyPanel : public LinePropertyPanelBase,
{
public:
virtual ~LinePropertyPanel() override;
- virtual void dispose() override;
- static VclPtr<vcl::Window> Create(
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create(
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
@@ -66,7 +65,7 @@ public:
// constructor/destructor
LinePropertyPanel(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings);
diff --git a/svx/source/sidebar/line/LinePropertyPanelBase.cxx b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
index 8d26da31ffa4..de49e322a2a8 100644
--- a/svx/source/sidebar/line/LinePropertyPanelBase.cxx
+++ b/svx/source/sidebar/line/LinePropertyPanelBase.cxx
@@ -65,9 +65,9 @@ namespace
LinePropertyPanelBase::LinePropertyPanelBase(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const uno::Reference<css::frame::XFrame>& rxFrame)
-: PanelLayout(pParent, "LinePropertyPanel", "svx/ui/sidebarline.ui", rxFrame),
+: PanelLayout(pParent, "LinePropertyPanel", "svx/ui/sidebarline.ui"),
mxTBColor(m_xBuilder->weld_toolbar("color")),
mxColorDispatch(new ToolbarUnoDispatcher(*mxTBColor, *m_xBuilder, rxFrame)),
mxLineStyleTB(m_xBuilder->weld_toolbar("linestyle")),
@@ -97,11 +97,6 @@ LinePropertyPanelBase::LinePropertyPanelBase(
LinePropertyPanelBase::~LinePropertyPanelBase()
{
- disposeOnce();
-}
-
-void LinePropertyPanelBase::dispose()
-{
mxLineWidthPopup.reset();
mxFTWidth.reset();
mxTBWidth.reset();
@@ -117,8 +112,6 @@ void LinePropertyPanelBase::dispose()
mxLBCapStyle.reset();
mxGridLineProps.reset();
mxBoxArrowProps.reset();
-
- PanelLayout::dispose();
}
void LinePropertyPanelBase::Initialize()
@@ -417,7 +410,7 @@ void LinePropertyPanelBase::SetWidthIcon()
return;
}
- tools::Long nVal = LogicToLogic(mnWidthCoreValue * 10, meMapUnit, MapUnit::MapPoint);
+ tools::Long nVal = OutputDevice::LogicToLogic(mnWidthCoreValue * 10, meMapUnit, MapUnit::MapPoint);
if(nVal <= 6)
mxTBWidth->set_item_icon_name(SELECTWIDTH, maIMGWidthIcon[0]);
diff --git a/svx/source/sidebar/lists/ListsPropertyPanel.cxx b/svx/source/sidebar/lists/ListsPropertyPanel.cxx
index a28cbf777a09..58badf67964d 100644
--- a/svx/source/sidebar/lists/ListsPropertyPanel.cxx
+++ b/svx/source/sidebar/lists/ListsPropertyPanel.cxx
@@ -24,8 +24,8 @@ using namespace css::uno;
namespace svx::sidebar
{
-VclPtr<vcl::Window>
-ListsPropertyPanel::Create(vcl::Window* pParent,
+std::unique_ptr<PanelLayout>
+ListsPropertyPanel::Create(weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame)
{
if (pParent == nullptr)
@@ -35,31 +35,27 @@ ListsPropertyPanel::Create(vcl::Window* pParent,
throw lang::IllegalArgumentException("no XFrame given to ListsPropertyPanel::Create",
nullptr, 1);
- return VclPtr<ListsPropertyPanel>::Create(pParent, rxFrame);
+ return std::make_unique<ListsPropertyPanel>(pParent, rxFrame);
}
-ListsPropertyPanel::ListsPropertyPanel(vcl::Window* pParent,
+ListsPropertyPanel::ListsPropertyPanel(weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame)
- : PanelLayout(pParent, "ListsPropertyPanel", "svx/ui/sidebarlists.ui", rxFrame)
+ : PanelLayout(pParent, "ListsPropertyPanel", "svx/ui/sidebarlists.ui")
, mxTBxNumBullet(m_xBuilder->weld_toolbar("numberbullet"))
, mxNumBulletDispatcher(new ToolbarUnoDispatcher(*mxTBxNumBullet, *m_xBuilder, rxFrame))
, mxTBxOutline(m_xBuilder->weld_toolbar("outline"))
, mxOutlineDispatcher(new ToolbarUnoDispatcher(*mxTBxOutline, *m_xBuilder, rxFrame))
{
- m_pInitialFocusWidget = mxTBxNumBullet.get();
}
-ListsPropertyPanel::~ListsPropertyPanel() { disposeOnce(); }
-
-void ListsPropertyPanel::dispose()
+ListsPropertyPanel::~ListsPropertyPanel()
{
mxOutlineDispatcher.reset();
mxTBxOutline.reset();
mxNumBulletDispatcher.reset();
mxTBxNumBullet.reset();
-
- PanelLayout::dispose();
}
+
} // end of namespace svx::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svx/source/sidebar/lists/ListsPropertyPanel.hxx b/svx/source/sidebar/lists/ListsPropertyPanel.hxx
index 2a1c3dd9b4ef..ec20bb4308dd 100644
--- a/svx/source/sidebar/lists/ListsPropertyPanel.hxx
+++ b/svx/source/sidebar/lists/ListsPropertyPanel.hxx
@@ -29,12 +29,11 @@ class ListsPropertyPanel : public PanelLayout
{
public:
virtual ~ListsPropertyPanel() 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, const css::uno::Reference<css::frame::XFrame>& rxFrame);
- ListsPropertyPanel(vcl::Window* pParent,
+ ListsPropertyPanel(weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
private:
diff --git a/svx/source/sidebar/media/MediaPlaybackPanel.cxx b/svx/source/sidebar/media/MediaPlaybackPanel.cxx
index 78a56e4405e5..8909ead9669a 100644
--- a/svx/source/sidebar/media/MediaPlaybackPanel.cxx
+++ b/svx/source/sidebar/media/MediaPlaybackPanel.cxx
@@ -29,10 +29,9 @@ using namespace avmedia;
namespace svx::sidebar {
MediaPlaybackPanel::MediaPlaybackPanel (
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings)
- : PanelLayout(pParent, "MediaPlaybackPanel", "svx/ui/mediaplayback.ui", rxFrame),
+ : PanelLayout(pParent, "MediaPlaybackPanel", "svx/ui/mediaplayback.ui"),
MediaControlBase(),
maMediaController(SID_AVMEDIA_TOOLBOX, *pBindings, *this),
maIdle("MediaPlaybackPanel"),
@@ -46,31 +45,18 @@ MediaPlaybackPanel::MediaPlaybackPanel (
mxZoomListBox = m_xBuilder->weld_combo_box("zoombox");
Initialize();
-
- m_pInitialFocusWidget = mxTimeEdit.get();
}
-VclPtr< vcl::Window > MediaPlaybackPanel::Create(
- vcl::Window* pParent,
- const Reference< XFrame >& rxFrame,
+std::unique_ptr<PanelLayout> MediaPlaybackPanel::Create(
+ weld::Widget* pParent,
SfxBindings* pBindings)
{
if (pParent == nullptr)
throw lang::IllegalArgumentException("no parent Window given to MediaPlaybackPanel::Create", nullptr, 0);
- if ( ! rxFrame.is())
- throw lang::IllegalArgumentException("no XFrame given to MediaPlaybackPanel::Create", nullptr, 1);
if (pBindings == nullptr)
throw lang::IllegalArgumentException("no SfxBindings given to MediaPlaybackPanel::Create", nullptr, 2);
- return VclPtr<MediaPlaybackPanel>::Create(
- pParent,
- rxFrame,
- pBindings);
-}
-
-MediaPlaybackPanel::~MediaPlaybackPanel()
-{
- disposeOnce();
+ return std::make_unique<MediaPlaybackPanel>(pParent, pBindings);
}
void MediaPlaybackPanel::Initialize()
@@ -87,10 +73,9 @@ void MediaPlaybackPanel::Initialize()
mpBindings->Invalidate(SID_AVMEDIA_TOOLBOX);
}
-void MediaPlaybackPanel::dispose()
+MediaPlaybackPanel::~MediaPlaybackPanel()
{
disposeWidgets();
- PanelLayout::dispose();
}
void MediaPlaybackPanel::NotifyItemUpdate(
diff --git a/svx/source/sidebar/media/MediaPlaybackPanel.hxx b/svx/source/sidebar/media/MediaPlaybackPanel.hxx
index a71a18a5e38e..95f3d6eaa6d4 100644
--- a/svx/source/sidebar/media/MediaPlaybackPanel.hxx
+++ b/svx/source/sidebar/media/MediaPlaybackPanel.hxx
@@ -19,13 +19,13 @@
#pragma once
#include <memory>
-#include <com/sun/star/frame/XFrame.hpp>
#include <sfx2/sidebar/PanelLayout.hxx>
#include <avmedia/mediaitem.hxx>
#include <sfx2/bindings.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <avmedia/MediaControlBase.hxx>
+#include <vcl/idle.hxx>
using namespace css;
using namespace ::com::sun::star::uno;
@@ -42,15 +42,12 @@ class MediaPlaybackPanel
{
public:
MediaPlaybackPanel (
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings);
- 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,
SfxBindings* pBindings);
virtual ~MediaPlaybackPanel() override;
- virtual void dispose() override;
protected:
virtual void UpdateToolBoxes(const avmedia::MediaItem& rMediaItem) override;
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
index ab97dc60c8c0..2e54af0a8485 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx
@@ -44,8 +44,8 @@ namespace svx::sidebar {
#define MAX_SC_SD 116220200
#define NEGA_MAXVALUE -10000000
-VclPtr<vcl::Window> ParaPropertyPanel::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> ParaPropertyPanel::Create (
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
@@ -57,11 +57,7 @@ VclPtr<vcl::Window> ParaPropertyPanel::Create (
if (pBindings == nullptr)
throw lang::IllegalArgumentException("no SfxBindings given to ParaPropertyPanel::Create", nullptr, 2);
- return VclPtr<ParaPropertyPanel>::Create(
- pParent,
- rxFrame,
- pBindings,
- rxSidebar);
+ return std::make_unique<ParaPropertyPanel>(pParent, rxFrame, pBindings, rxSidebar);
}
void ParaPropertyPanel::HandleContextChange (
@@ -129,8 +125,6 @@ void ParaPropertyPanel::HandleContextChange (
}
}
-void ParaPropertyPanel::DataChanged (const DataChangedEvent&) {}
-
void ParaPropertyPanel::ReSize()
{
if (mxSidebar.is())
@@ -397,11 +391,11 @@ FieldUnit ParaPropertyPanel::GetCurrentUnit( SfxItemState eState, const SfxPoolI
return eUnit;
}
-ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
+ParaPropertyPanel::ParaPropertyPanel(weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
- : PanelLayout(pParent, "ParaPropertyPanel", "svx/ui/sidebarparagraph.ui", rxFrame),
+ : PanelLayout(pParent, "ParaPropertyPanel", "svx/ui/sidebarparagraph.ui"),
//Alignment
mxTBxHorzAlign(m_xBuilder->weld_toolbar("horizontalalignment")),
mxHorzAlignDispatch(new ToolbarUnoDispatcher(*mxTBxHorzAlign, *m_xBuilder, rxFrame)),
@@ -449,7 +443,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent,
initial();
m_aMetricCtl.RequestUpdate();
- m_pInitialFocusWidget = mxTBxHorzAlign.get();
}
void ParaPropertyPanel::limitMetricWidths()
@@ -463,11 +456,6 @@ void ParaPropertyPanel::limitMetricWidths()
ParaPropertyPanel::~ParaPropertyPanel()
{
- disposeOnce();
-}
-
-void ParaPropertyPanel::dispose()
-{
mxHorzAlignDispatch.reset();
mxTBxHorzAlign.reset();
@@ -501,8 +489,6 @@ void ParaPropertyPanel::dispose()
maLRSpaceControl.dispose();
maULSpaceControl.dispose();
m_aMetricCtl.dispose();
-
- PanelLayout::dispose();
}
} // end of namespace svx::sidebar
diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
index da5e1a8f5a6c..bd252eb1af8a 100644
--- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
+++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx
@@ -41,15 +41,13 @@ class ParaPropertyPanel
{
public:
virtual ~ParaPropertyPanel() override;
- virtual void dispose() override;
- static VclPtr<vcl::Window> Create (
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create (
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
- virtual void DataChanged (const DataChangedEvent& rEvent) override;
SfxBindings* GetBindings() { return mpBindings;}
virtual void HandleContextChange (
@@ -67,7 +65,7 @@ public:
static FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
ParaPropertyPanel (
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
index aac8619a448e..50915798a068 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
@@ -53,11 +53,11 @@ const char USERITEM_NAME[] = "FitItem";
namespace svx::sidebar {
PosSizePropertyPanel::PosSizePropertyPanel(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
-: PanelLayout(pParent, "PosSizePropertyPanel", "svx/ui/sidebarpossize.ui", rxFrame),
+: PanelLayout(pParent, "PosSizePropertyPanel", "svx/ui/sidebarpossize.ui"),
mxFtPosX(m_xBuilder->weld_label("horizontallabel")),
mxMtrPosX(m_xBuilder->weld_metric_spin_button("horizontalpos", FieldUnit::CM)),
mxFtPosY(m_xBuilder->weld_label("verticallabel")),
@@ -123,11 +123,6 @@ PosSizePropertyPanel::PosSizePropertyPanel(
PosSizePropertyPanel::~PosSizePropertyPanel()
{
- disposeOnce();
-}
-
-void PosSizePropertyPanel::dispose()
-{
mxFtPosX.reset();
mxMtrPosX.reset();
mxFtPosY.reset();
@@ -167,11 +162,8 @@ void PosSizePropertyPanel::dispose()
maAutoWidthControl.dispose();
maAutoHeightControl.dispose();
m_aMetricCtl.dispose();
-
- PanelLayout::dispose();
}
-
namespace
{
bool hasText(const SdrView& rSdrView)
@@ -241,8 +233,8 @@ void PosSizePropertyPanel::Initialize()
mePoolUnit = maTransfWidthControl.GetCoreMetric();
}
-VclPtr<vcl::Window> PosSizePropertyPanel::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> PosSizePropertyPanel::Create (
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar)
@@ -254,17 +246,7 @@ VclPtr<vcl::Window> PosSizePropertyPanel::Create (
if (pBindings == nullptr)
throw lang::IllegalArgumentException("no SfxBindings given to PosSizePropertyPanel::Create", nullptr, 2);
- return VclPtr<PosSizePropertyPanel>::Create(
- pParent,
- rxFrame,
- pBindings,
- rxSidebar);
-}
-
-
-void PosSizePropertyPanel::DataChanged(
- const DataChangedEvent& /*rEvent*/)
-{
+ return std::make_unique<PosSizePropertyPanel>(pParent, rxFrame, pBindings, rxSidebar);
}
void PosSizePropertyPanel::HandleContextChange(
diff --git a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
index 79f40f02f99c..0bac867d7c55 100644
--- a/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
+++ b/svx/source/sidebar/possize/PosSizePropertyPanel.hxx
@@ -47,17 +47,13 @@ class PosSizePropertyPanel
{
public:
virtual ~PosSizePropertyPanel() override;
- virtual void dispose() override;
- static VclPtr<vcl::Window> Create(
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create(
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
- virtual void DataChanged(
- const DataChangedEvent& rEvent) override;
-
virtual void HandleContextChange(
const vcl::EnumContext& rContext) override;
@@ -72,7 +68,7 @@ public:
// constructor/destructor
PosSizePropertyPanel(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings,
const css::uno::Reference<css::ui::XSidebar>& rxSidebar);
diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
index 0f4446633d3b..70646d28d1d7 100644
--- a/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.cxx
@@ -29,10 +29,9 @@ using namespace css::uno;
namespace svx::sidebar {
ShadowPropertyPanel::ShadowPropertyPanel(
- vcl::Window* pParent,
- const uno::Reference<css::frame::XFrame>& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings)
-: PanelLayout(pParent, "ShadowPropertyPanel", "svx/ui/sidebarshadow.ui", rxFrame),
+: PanelLayout(pParent, "ShadowPropertyPanel", "svx/ui/sidebarshadow.ui"),
maShadowController(SID_ATTR_FILL_SHADOW, *pBindings, *this),
maShadowTransController(SID_ATTR_SHADOW_TRANSPARENCE, *pBindings, *this),
maShadowBlurController(SID_ATTR_SHADOW_BLUR, *pBindings, *this),
@@ -61,11 +60,6 @@ ShadowPropertyPanel::ShadowPropertyPanel(
ShadowPropertyPanel::~ShadowPropertyPanel()
{
- disposeOnce();
-}
-
-void ShadowPropertyPanel::dispose()
-{
mxShowShadow.reset();
mxFTAngle.reset();
mxShadowAngle.reset();
@@ -85,7 +79,6 @@ void ShadowPropertyPanel::dispose()
maShadowColorController.dispose();
maShadowXDistanceController.dispose();
maShadowYDistanceController.dispose();
- PanelLayout::dispose();
}
void ShadowPropertyPanel::Initialize()
@@ -250,10 +243,6 @@ void ShadowPropertyPanel::SetTransparencyValue(tools::Long nVal)
mxShadowTransMetric->set_value(nVal, FieldUnit::PERCENT);
}
-void ShadowPropertyPanel::DataChanged(const DataChangedEvent& /*rEvent*/)
-{
-}
-
void ShadowPropertyPanel::InsertAngleValues()
{
OUString sSuffix = weld::MetricSpinButton::MetricToString(FieldUnit::DEGREE);
@@ -362,19 +351,16 @@ void ShadowPropertyPanel::NotifyItemUpdate(
UpdateControls();
}
-VclPtr<vcl::Window> ShadowPropertyPanel::Create (
- vcl::Window* pParent,
- const uno::Reference<css::frame::XFrame>& rxFrame,
+std::unique_ptr<PanelLayout> ShadowPropertyPanel::Create (
+ weld::Widget* pParent,
SfxBindings* pBindings)
{
if(pParent == nullptr)
throw lang::IllegalArgumentException("no parent Window given to ShadowPropertyPanel::Create", nullptr, 0);
- if( !rxFrame.is() )
- throw lang::IllegalArgumentException("no XFrame given to ShadowPropertyPanel::Create", nullptr, 1);
if(pBindings == nullptr)
throw lang::IllegalArgumentException("no SfxBindings given to ShadowPropertyPanel::Create", nullptr, 2);
- return VclPtr<ShadowPropertyPanel>::Create(pParent, rxFrame, pBindings);
+ return std::make_unique<ShadowPropertyPanel>(pParent, pBindings);
}
}
diff --git a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
index f7ee8bb4188e..ef4438cd5cdb 100644
--- a/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
+++ b/svx/source/sidebar/shadow/ShadowPropertyPanel.hxx
@@ -9,7 +9,6 @@
#ifndef INCLUDED_SVX_SOURCE_SIDEBAR_AREA_SHADOWPROPERTYPANEL_HXX
#define INCLUDED_SVX_SOURCE_SIDEBAR_AREA_SHADOWPROPERTYPANEL_HXX
-#include <vcl/vclptr.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <sfx2/sidebar/PanelLayout.hxx>
@@ -23,16 +22,11 @@ class ShadowPropertyPanel
{
public:
virtual ~ShadowPropertyPanel() 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,
SfxBindings* pBindings);
- virtual void DataChanged(
- const DataChangedEvent& rEvent) override;
-
virtual void NotifyItemUpdate(
const sal_uInt16 nSId,
const SfxItemState eState,
@@ -47,8 +41,7 @@ public:
void Initialize();
ShadowPropertyPanel(
- vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings);
private:
diff --git a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
index 3d52ae23fb0d..8b97bb5ee4d1 100644
--- a/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
+++ b/svx/source/sidebar/shapes/DefaultShapesPanel.cxx
@@ -22,13 +22,14 @@
#include <comphelper/dispatchcommand.hxx>
#include <vcl/commandinfoprovider.hxx>
#include <vcl/settings.hxx>
+#include <vcl/svapp.hxx>
namespace svx::sidebar {
DefaultShapesPanel::DefaultShapesPanel (
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame)
- : PanelLayout(pParent, "DefaultShapesPanel", "svx/ui/defaultshapespanel.ui", rxFrame)
+ : PanelLayout(pParent, "DefaultShapesPanel", "svx/ui/defaultshapespanel.ui")
, SvxShapeCommandsMap()
, mxLineArrowSet(new ValueSet(nullptr))
, mxLineArrowSetWin(new weld::CustomWeld(*m_xBuilder, "LinesArrows", *mxLineArrowSet))
@@ -53,12 +54,10 @@ DefaultShapesPanel::DefaultShapesPanel (
, mxFrame(rxFrame)
{
Initialize();
-
- m_pInitialFocusWidget = mxLineArrowSet->GetDrawingArea();
}
-VclPtr< vcl::Window > DefaultShapesPanel::Create(
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> DefaultShapesPanel::Create(
+ weld::Widget* pParent,
const Reference< XFrame >& rxFrame)
{
if (pParent == nullptr)
@@ -66,14 +65,7 @@ VclPtr< vcl::Window > DefaultShapesPanel::Create(
if ( ! rxFrame.is())
throw lang::IllegalArgumentException("no XFrame given to DefaultShapesPanel::Create", nullptr, 1);
- return VclPtr<DefaultShapesPanel>::Create(
- pParent,
- rxFrame);
-}
-
-DefaultShapesPanel::~DefaultShapesPanel()
-{
- disposeOnce();
+ return std::make_unique<DefaultShapesPanel>(pParent, rxFrame);
}
void DefaultShapesPanel::Initialize()
@@ -93,12 +85,12 @@ void DefaultShapesPanel::Initialize()
populateShapes();
for(auto& aSetMap: mpShapesSetMap)
{
- aSetMap.first->SetColor(GetSettings().GetStyleSettings().GetDialogColor());
+ aSetMap.first->SetColor(Application::GetSettings().GetStyleSettings().GetDialogColor());
aSetMap.first->SetSelectHdl(LINK(this, DefaultShapesPanel, ShapeSelectHdl));
}
}
-void DefaultShapesPanel::dispose()
+DefaultShapesPanel::~DefaultShapesPanel()
{
mpShapesSetMap.clear();
mxLineArrowSetWin.reset();
@@ -121,7 +113,6 @@ void DefaultShapesPanel::dispose()
mxStarSet.reset();
mx3DObjectSetWin.reset();
mx3DObjectSet.reset();
- PanelLayout::dispose();
}
IMPL_LINK(DefaultShapesPanel, ShapeSelectHdl, ValueSet*, rValueSet, void)
diff --git a/svx/source/sidebar/styles/StylesPropertyPanel.cxx b/svx/source/sidebar/styles/StylesPropertyPanel.cxx
index 4957d965c416..da6b53ba66d5 100644
--- a/svx/source/sidebar/styles/StylesPropertyPanel.cxx
+++ b/svx/source/sidebar/styles/StylesPropertyPanel.cxx
@@ -9,8 +9,8 @@ using namespace css::uno;
namespace svx::sidebar {
-VclPtr<vcl::Window> StylesPropertyPanel::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> StylesPropertyPanel::Create (
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame)
{
if (pParent == nullptr)
@@ -18,37 +18,24 @@ VclPtr<vcl::Window> StylesPropertyPanel::Create (
if ( ! rxFrame.is())
throw lang::IllegalArgumentException("no XFrame given to StylesPropertyPanel::Create", nullptr, 1);
- return VclPtr<StylesPropertyPanel>::Create(pParent,rxFrame);
+ return std::make_unique<StylesPropertyPanel>(pParent, rxFrame);
}
-StylesPropertyPanel::StylesPropertyPanel ( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame )
- : PanelLayout(pParent, "SidebarStylesPanel", "svx/ui/sidebarstylespanel.ui", rxFrame)
+StylesPropertyPanel::StylesPropertyPanel(weld::Widget* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame)
+ : PanelLayout(pParent, "SidebarStylesPanel", "svx/ui/sidebarstylespanel.ui")
, m_xFontStyle(m_xBuilder->weld_toolbar("fontstyletoolbox"))
, m_xFontStyleDispatch(new ToolbarUnoDispatcher(*m_xFontStyle, *m_xBuilder, rxFrame))
, m_xStyle(m_xBuilder->weld_toolbar("style"))
, m_xStyleDispatch(new ToolbarUnoDispatcher(*m_xStyle, *m_xBuilder, rxFrame))
{
- m_pInitialFocusWidget = m_xFontStyle.get();
}
StylesPropertyPanel::~StylesPropertyPanel()
{
- disposeOnce();
-}
-
-void StylesPropertyPanel::dispose()
-{
m_xStyleDispatch.reset();
m_xStyle.reset();
m_xFontStyleDispatch.reset();
m_xFontStyle.reset();
-
- PanelLayout::dispose();
-}
-
-void StylesPropertyPanel::DataChanged( const DataChangedEvent& /*rEvent*/)
-{
-
}
}
diff --git a/svx/source/sidebar/styles/StylesPropertyPanel.hxx b/svx/source/sidebar/styles/StylesPropertyPanel.hxx
index f9dd6b1747e9..38c5f9bf773e 100644
--- a/svx/source/sidebar/styles/StylesPropertyPanel.hxx
+++ b/svx/source/sidebar/styles/StylesPropertyPanel.hxx
@@ -18,16 +18,12 @@ private:
public:
virtual ~StylesPropertyPanel() override;
- static VclPtr<vcl::Window> Create (
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create (
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
- virtual void DataChanged( const DataChangedEvent& rEvent ) override;
-
- virtual void dispose() override;
-
StylesPropertyPanel(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
};
diff --git a/svx/source/sidebar/text/TextPropertyPanel.cxx b/svx/source/sidebar/text/TextPropertyPanel.cxx
index a637e1c3fe8c..e4315d31b606 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.cxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.cxx
@@ -27,8 +27,8 @@ using namespace css;
namespace svx::sidebar {
-VclPtr<vcl::Window> TextPropertyPanel::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> TextPropertyPanel::Create (
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame)
{
if (pParent == nullptr)
@@ -36,11 +36,11 @@ VclPtr<vcl::Window> TextPropertyPanel::Create (
if ( ! rxFrame.is())
throw lang::IllegalArgumentException("no XFrame given to TextPropertyPanel::Create", nullptr, 1);
- return VclPtr<TextPropertyPanel>::Create(pParent, rxFrame);
+ return std::make_unique<TextPropertyPanel>(pParent, rxFrame);
}
-TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame )
- : PanelLayout(pParent, "SidebarTextPanel", "svx/ui/sidebartextpanel.ui", rxFrame)
+TextPropertyPanel::TextPropertyPanel(weld::Widget* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame)
+ : PanelLayout(pParent, "SidebarTextPanel", "svx/ui/sidebartextpanel.ui")
, mxFont(m_xBuilder->weld_toolbar("font"))
, mxFontDispatch(new ToolbarUnoDispatcher(*mxFont, *m_xBuilder, rxFrame))
, mxFontHeight(m_xBuilder->weld_toolbar("fontheight"))
@@ -70,17 +70,10 @@ TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Ref
pViewShell && pViewShell->isLOKMobilePhone())
isMobilePhone = true;
mxSpacingBar->set_visible(!isMobilePhone);
-
- m_pInitialFocusWidget = mxFont.get();
}
TextPropertyPanel::~TextPropertyPanel()
{
- disposeOnce();
-}
-
-void TextPropertyPanel::dispose()
-{
mxResetBarDispatch.reset();
mxDefaultBarDispatch.reset();
mxPositionBarDispatch.reset();
@@ -104,8 +97,6 @@ void TextPropertyPanel::dispose()
mxFontEffects.reset();
mxFontHeight.reset();
mxFont.reset();
-
- PanelLayout::dispose();
}
void TextPropertyPanel::HandleContextChange (
diff --git a/svx/source/sidebar/text/TextPropertyPanel.hxx b/svx/source/sidebar/text/TextPropertyPanel.hxx
index 437596145584..3ad44bde78ac 100644
--- a/svx/source/sidebar/text/TextPropertyPanel.hxx
+++ b/svx/source/sidebar/text/TextPropertyPanel.hxx
@@ -32,17 +32,16 @@ class TextPropertyPanel
{
public:
virtual ~TextPropertyPanel() override;
- virtual void dispose() override;
- static VclPtr<vcl::Window> Create (
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create (
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
virtual void HandleContextChange (
const vcl::EnumContext& rContext) override;
TextPropertyPanel (
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame);
private:
diff --git a/sw/qa/uitest/navigator/tdf114724.py b/sw/qa/uitest/navigator/tdf114724.py
index cf3b8482a5ca..a4db93242afd 100644
--- a/sw/qa/uitest/navigator/tdf114724.py
+++ b/sw/qa/uitest/navigator/tdf114724.py
@@ -22,7 +22,7 @@ class tdf114724(UITestCase):
self.xUITest.executeCommand(".uno:Sidebar")
xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
- xNavigatorPanel = xWriterEdit.getChild("NavigatorPanelParent")
+ xNavigatorPanel = xWriterEdit.getChild("NavigatorPanel")
xToolBar = xNavigatorPanel.getChild("content5")
xToolBar.executeAction("CLICK", mkPropertyValues({"POS": "0"})) # 'root' button
diff --git a/sw/qa/uitest/navigator/tdf137274.py b/sw/qa/uitest/navigator/tdf137274.py
index f1e153992e2d..f11c43d9b3d0 100644
--- a/sw/qa/uitest/navigator/tdf137274.py
+++ b/sw/qa/uitest/navigator/tdf137274.py
@@ -31,9 +31,7 @@ class tdf137274(UITestCase):
xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
# wait until the navigator panel is available
- self.ui_test.wait_until_child_is_available(xMainWindow, 'NavigatorPanelParent')
-
- xNavigatorPanel = xWriterEdit.getChild("NavigatorPanelParent")
+ xNavigatorPanel = xWriterEdit.getChild("NavigatorPanel")
xContentTree = xNavigatorPanel.getChild("contenttree")
xComments = xContentTree.getChild('10')
diff --git a/sw/qa/uitest/navigator/tdf140257.py b/sw/qa/uitest/navigator/tdf140257.py
new file mode 100644
index 000000000000..5427626008d8
--- /dev/null
+++ b/sw/qa/uitest/navigator/tdf140257.py
@@ -0,0 +1,116 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+#
+from uitest.framework import UITestCase
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import get_state_as_dict, type_text
+from uitest.uihelper.common import select_pos
+
+class Tdf140257(UITestCase):
+
+ def change_outline_level(self, sText):
+
+ self.ui_test.execute_dialog_through_command(".uno:ParagraphDialog")
+ xDialog = self.xUITest.getTopFocusWindow()
+ xTabs = xDialog.getChild("tabcontrol")
+ select_pos(xTabs, "4")
+
+ xOutline = xDialog.getChild("comboLB_OUTLINE_LEVEL")
+
+ props = {"TEXT": sText}
+ actionProps = mkPropertyValues(props)
+ xOutline.executeAction("SELECT", actionProps)
+
+ xOKBtn = xDialog.getChild("ok")
+ self.ui_test.close_dialog_through_button(xOKBtn)
+
+ def test_tdf140257(self):
+ self.ui_test.create_doc_in_start_center("writer")
+ xMainWindow = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xMainWindow.getChild("writer_edit")
+
+ self.change_outline_level("Level 1")
+
+ for i in range(4):
+ type_text(xWriterEdit, 'P' + str(i + 1))
+ xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
+
+ type_text(xWriterEdit, 'P5')
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
+
+ # wait until the navigator panel is available
+ xNavigatorPanel = xWriterEdit.getChild("NavigatorPanel")
+
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+ xHeadings = xContentTree.getChild('0')
+ self.assertEqual('Headings', get_state_as_dict(xHeadings)['Text'])
+
+ xHeadings.executeAction("EXPAND", tuple())
+
+ self.assertEqual(5, len(xHeadings.getChildren()))
+
+ for i in range(5):
+ self.assertEqual('P' + str(i + 1), get_state_as_dict(xHeadings.getChild(str(i)))['Text'])
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ document = self.ui_test.get_component()
+ cursor = document.getCurrentController().getViewCursor()
+
+ # Use Adding Selection
+ selectionProperty = mkPropertyValues({"SelectionMode": 2})
+ self.xUITest.executeCommandWithParameters(".uno:SelectionMode", selectionProperty)
+
+ # Go to P2 and select it
+ cursor.goUp(3, False)
+ cursor.gotoStartOfLine(False)
+ cursor.gotoEndOfLine(True)
+
+ # Go to P4 and select it
+ cursor.goDown(2, False)
+ cursor.gotoStartOfLine(False)
+ cursor.gotoEndOfLine(True)
+
+ self.change_outline_level("Level 2")
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
+
+ # wait until the navigator panel is available
+ xNavigatorPanel = xWriterEdit.getChild("NavigatorPanel")
+
+ xContentTree = xNavigatorPanel.getChild("contenttree")
+ xHeadings = xContentTree.getChild('0')
+ self.assertEqual('Headings', get_state_as_dict(xHeadings)['Text'])
+
+ xHeadings.executeAction("EXPAND", tuple())
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 3 != 4
+ self.assertEqual(3, len(xHeadings.getChildren()))
+ xChild1 = xHeadings.getChild('0')
+ self.assertEqual('P1', get_state_as_dict(xChild1)['Text'])
+ xChild1.executeAction("EXPAND", tuple())
+ self.assertEqual(1, len(xChild1.getChildren()))
+ self.assertEqual('P2', get_state_as_dict(xChild1.getChild('0'))['Text'])
+
+ xChild2 = xHeadings.getChild('1')
+ self.assertEqual('P3', get_state_as_dict(xChild2)['Text'])
+ xChild2.executeAction("EXPAND", tuple())
+ self.assertEqual(1, len(xChild2.getChildren()))
+ self.assertEqual('P4', get_state_as_dict(xChild2.getChild('0'))['Text'])
+
+ self.assertEqual('P5', get_state_as_dict(xHeadings.getChild('2'))['Text'])
+
+ self.xUITest.executeCommand(".uno:Sidebar")
+
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sw/source/uibase/inc/conttree.hxx b/sw/source/uibase/inc/conttree.hxx
index bf07a8de5232..741478f02d74 100644
--- a/sw/source/uibase/inc/conttree.hxx
+++ b/sw/source/uibase/inc/conttree.hxx
@@ -86,7 +86,7 @@ class SwContentTree final : public SfxListener
std::unique_ptr<weld::TreeView> m_xTreeView;
std::unique_ptr<weld::TreeIter> m_xScratchIter;
SwContentTreeDropTarget m_aDropTargetHelper;
- VclPtr<SwNavigationPI> m_xDialog;
+ SwNavigationPI* m_pDialog;
OUString m_sSpace;
AutoTimer m_aUpdTimer;
@@ -295,7 +295,7 @@ class SwGlobalTree final
private:
std::unique_ptr<weld::TreeView> m_xTreeView;
SwGlobalTreeDropTarget m_aDropTargetHelper;
- VclPtr<SwNavigationPI> m_xDialog;
+ SwNavigationPI* m_pDialog;
AutoTimer m_aUpdateTimer;
OUString m_aContextStrings[GLOBAL_CONTEXT_COUNT];
diff --git a/sw/source/uibase/inc/navipi.hxx b/sw/source/uibase/inc/navipi.hxx
index f0b36d44f0c8..88d166ecacba 100644
--- a/sw/source/uibase/inc/navipi.hxx
+++ b/sw/source/uibase/inc/navipi.hxx
@@ -76,6 +76,8 @@ class SwNavigationPI : public PanelLayout
OUString m_sContentFileName;
OUString m_aStatusArr[4];
+ VclPtr<SfxNavigator> m_xNavigatorDlg;
+
std::unique_ptr<SfxObjectShellLock> m_pxObjectShell;
SwView *m_pContentView;
SwWrtShell *m_pContentWrtShell;
@@ -114,6 +116,8 @@ class SwNavigationPI : public PanelLayout
bool EditAction();
void UsePage();
+ void UpdateInitShow();
+
protected:
// release ObjectShellLock early enough for app end
@@ -124,14 +128,13 @@ protected:
public:
- static VclPtr<vcl::Window> Create(vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create(weld::Widget* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
SfxBindings* pBindings);
- SwNavigationPI(vcl::Window* pParent,
+ SwNavigationPI(weld::Widget* pParent,
const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
- SfxBindings* _pBindings);
+ SfxBindings* _pBindings, SfxNavigator* pNavigatorDlg);
virtual ~SwNavigationPI() override;
- virtual void dispose() override;
void UpdateListBox();
void MoveOutline(SwOutlineNodes::size_type nSource, SwOutlineNodes::size_type nTarget);
@@ -143,8 +146,6 @@ public:
virtual void GetControlState(const sal_uInt16 /*nSId*/,
boost::property_tree::ptree& /*rState*/) override {};
- virtual void StateChanged(StateChangedType nStateChange) override;
-
static OUString CreateDropFileName( TransferableDataHelper& rData );
static OUString CleanEntry(const OUString& rEntry);
@@ -158,6 +159,8 @@ public:
bool IsGlobalMode() const {return m_bGlobalMode;}
SwView* GetCreateView() const;
+
+ virtual weld::Window* GetFrameWeld() const override;
};
class SwNavigatorWrapper final : public SfxNavigatorWrapper
diff --git a/sw/source/uibase/inc/redlndlg.hxx b/sw/source/uibase/inc/redlndlg.hxx
index d35ce818709f..61bea73dd92c 100644
--- a/sw/source/uibase/inc/redlndlg.hxx
+++ b/sw/source/uibase/inc/redlndlg.hxx
@@ -152,9 +152,8 @@ class SwRedlineAcceptPanel : public PanelLayout, public SfxListener
std::unique_ptr<SwRedlineAcceptDlg> mpImplDlg;
std::unique_ptr<weld::Container> mxContentArea;
public:
- SwRedlineAcceptPanel(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rFrame);
+ SwRedlineAcceptPanel(weld::Widget* pParent);
virtual ~SwRedlineAcceptPanel() override;
- virtual void dispose() override;
/// We need to be a SfxListener to be able to update the list of changes when we get SfxHintId::DocChanged.
virtual void Notify(SfxBroadcaster& rBC, const SfxHint& rHint) override;
diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx
index cb7990fcd1fc..ebbb7f0c2a00 100644
--- a/sw/source/uibase/misc/redlndlg.cxx
+++ b/sw/source/uibase/misc/redlndlg.cxx
@@ -1246,8 +1246,8 @@ void SwRedlineAcceptDlg::FillInfo(OUString &rExtraData) const
rExtraData += ")";
}
-SwRedlineAcceptPanel::SwRedlineAcceptPanel(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rFrame)
- : PanelLayout(pParent, "ManageChangesPanel", "modules/swriter/ui/managechangessidebar.ui", rFrame)
+SwRedlineAcceptPanel::SwRedlineAcceptPanel(weld::Widget* pParent)
+ : PanelLayout(pParent, "ManageChangesPanel", "modules/swriter/ui/managechangessidebar.ui")
, mxContentArea(m_xBuilder->weld_container("content_area"))
{
mpImplDlg.reset(new SwRedlineAcceptDlg(nullptr, m_xBuilder.get(), mxContentArea.get()));
@@ -1260,14 +1260,6 @@ SwRedlineAcceptPanel::SwRedlineAcceptPanel(vcl::Window* pParent, const css::uno:
SwRedlineAcceptPanel::~SwRedlineAcceptPanel()
{
- disposeOnce();
-}
-
-void SwRedlineAcceptPanel::dispose()
-{
- mpImplDlg.reset();
- mxContentArea.reset();
- PanelLayout::dispose();
}
void SwRedlineAcceptPanel::Notify(SfxBroadcaster& /*rBC*/, const SfxHint& rHint)
diff --git a/sw/source/uibase/sidebar/PageFooterPanel.cxx b/sw/source/uibase/sidebar/PageFooterPanel.cxx
index a3af0082fb74..46066d0a1ee7 100644
--- a/sw/source/uibase/sidebar/PageFooterPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFooterPanel.cxx
@@ -31,17 +31,13 @@
namespace sw::sidebar{
-VclPtr<vcl::Window> PageFooterPanel::Create(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+std::unique_ptr<PanelLayout> PageFooterPanel::Create(
+ weld::Widget* pParent,
SfxBindings* pBindings)
{
if( pParent == nullptr )
throw ::com::sun::star::lang::IllegalArgumentException("no parent window given to PageFooterPanel::Create", nullptr, 0);
- if( !rxFrame.is() )
- throw ::com::sun::star::lang::IllegalArgumentException("no XFrame given to PageFooterPanel::Create", nullptr, 0);
-
- return VclPtr<PageFooterPanel>::Create(pParent, rxFrame, pBindings);
+ return std::make_unique<PageFooterPanel>(pParent, pBindings);
}
void PageFooterPanel::SetMarginsAndSpacingFieldUnit()
@@ -51,10 +47,9 @@ void PageFooterPanel::SetMarginsAndSpacingFieldUnit()
}
PageFooterPanel::PageFooterPanel(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings) :
- PanelLayout(pParent, "PageFooterPanel", "modules/swriter/ui/pagefooterpanel.ui", rxFrame),
+ PanelLayout(pParent, "PageFooterPanel", "modules/swriter/ui/pagefooterpanel.ui"),
mpBindings( pBindings ),
maHFToggleController(SID_ATTR_PAGE_FOOTER, *pBindings, *this),
maMetricController(SID_ATTR_METRIC, *pBindings,*this),
@@ -78,19 +73,12 @@ PageFooterPanel::PageFooterPanel(
PageFooterPanel::~PageFooterPanel()
{
- disposeOnce();
-}
-
-void PageFooterPanel::dispose()
-{
mxFooterToggle.reset();
maMetricController.dispose();
mxFooterSpacingLB.reset();
mxFooterLayoutLB.reset();
mxFooterMarginPresetLB.reset();
mxCustomEntry.reset();
-
- PanelLayout::dispose();
}
FieldUnit PageFooterPanel::GetCurrentUnit(SfxItemState eState, const SfxPoolItem* pState)
diff --git a/sw/source/uibase/sidebar/PageFooterPanel.hxx b/sw/source/uibase/sidebar/PageFooterPanel.hxx
index 849a3165d474..3cb3af4dd28a 100644
--- a/sw/source/uibase/sidebar/PageFooterPanel.hxx
+++ b/sw/source/uibase/sidebar/PageFooterPanel.hxx
@@ -20,30 +20,25 @@
#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEFOOTERPANEL_HXX
#include <memory>
-#include <com/sun/star/frame/XFrame.hpp>
#include <sfx2/sidebar/PanelLayout.hxx>
-
#include <sfx2/sidebar/ControllerItem.hxx>
-
-#include <svx/rulritem.hxx>
-
#include <svl/intitem.hxx>
#include <svl/poolitem.hxx>
#include <svl/eitem.hxx>
#include <svx/spacinglistbox.hxx>
#include <svx/samecontentlistbox.hxx>
+#include <svx/rulritem.hxx>
namespace sw::sidebar {
-class PageFooterPanel:
+class PageFooterPanel :
public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static VclPtr<vcl::Window> Create(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ static std::unique_ptr<PanelLayout> Create(
+ weld::Widget* pParent,
SfxBindings* pBindings);
virtual void NotifyItemUpdate(
@@ -57,11 +52,9 @@ public:
SfxBindings* GetBindings() const { return mpBindings; }
PageFooterPanel(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings);
virtual ~PageFooterPanel() override;
- virtual void dispose() override;
private:
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.cxx b/sw/source/uibase/sidebar/PageFormatPanel.cxx
index 31d556ca15ee..61cded7dc56f 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.cxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.cxx
@@ -43,17 +43,14 @@
namespace sw::sidebar{
-VclPtr<vcl::Window> PageFormatPanel::Create(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+std::unique_ptr<PanelLayout> PageFormatPanel::Create(
+ weld::Widget* pParent,
SfxBindings* pBindings)
{
if( pParent == nullptr )
throw ::com::sun::star::lang::IllegalArgumentException("no parent window given to PageFormatPanel::Create", nullptr, 0);
- if( !rxFrame.is() )
- throw ::com::sun::star::lang::IllegalArgumentException("no XFrame given to PageFormatPanel::Create", nullptr, 0);
- return VclPtr<PageFormatPanel>::Create(pParent, rxFrame, pBindings);
+ return std::make_unique<PageFormatPanel>(pParent, pBindings);
}
void PageFormatPanel::SetMarginFieldUnit()
@@ -83,11 +80,8 @@ void PageFormatPanel::SetMarginFieldUnit()
mxMarginSelectBox->set_active(nSelected);
}
-PageFormatPanel::PageFormatPanel(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
- SfxBindings* pBindings) :
- PanelLayout(pParent, "PageFormatPanel", "modules/swriter/ui/pageformatpanel.ui", rxFrame),
+PageFormatPanel::PageFormatPanel(weld::Widget* pParent, SfxBindings* pBindings) :
+ PanelLayout(pParent, "PageFormatPanel", "modules/swriter/ui/pageformatpanel.ui"),
mpBindings( pBindings ),
mxPaperSizeBox(new SvxPaperSizeListBox(m_xBuilder->weld_combo_box("papersize"))),
mxPaperWidth(new SvxRelativeField(m_xBuilder->weld_metric_spin_button("paperwidth", FieldUnit::CM))),
@@ -112,11 +106,6 @@ PageFormatPanel::PageFormatPanel(
PageFormatPanel::~PageFormatPanel()
{
- disposeOnce();
-}
-
-void PageFormatPanel::dispose()
-{
mxPaperSizeBox.reset();
mxPaperWidth.reset();
mxPaperHeight.reset();
@@ -132,8 +121,6 @@ void PageFormatPanel::dispose()
mpPageULMarginItem.reset();
mpPageLRMarginItem.reset();
mpPageItem.reset();
-
- PanelLayout::dispose();
}
void PageFormatPanel::Initialize()
diff --git a/sw/source/uibase/sidebar/PageFormatPanel.hxx b/sw/source/uibase/sidebar/PageFormatPanel.hxx
index 7c2a505618c8..eb3b400a3136 100644
--- a/sw/source/uibase/sidebar/PageFormatPanel.hxx
+++ b/sw/source/uibase/sidebar/PageFormatPanel.hxx
@@ -19,10 +19,7 @@
#ifndef INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEFORMATPANEL_HXX
#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGEFORMATPANEL_HXX
-#include <com/sun/star/frame/XFrame.hpp>
-
#include <sfx2/sidebar/PanelLayout.hxx>
-
#include <sfx2/sidebar/ControllerItem.hxx>
#include <svx/pageitem.hxx>
@@ -37,14 +34,13 @@
namespace sw::sidebar {
-class PageFormatPanel:
+class PageFormatPanel :
public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static VclPtr<vcl::Window> Create(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ static std::unique_ptr<PanelLayout> Create(
+ weld::Widget* pParent,
SfxBindings* pBindings);
virtual void NotifyItemUpdate(
@@ -57,11 +53,9 @@ public:
boost::property_tree::ptree& /*rState*/) override {};
PageFormatPanel(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings);
virtual ~PageFormatPanel() override;
- virtual void dispose() override;
static FieldUnit GetCurrentUnit( SfxItemState eState, const SfxPoolItem* pState );
diff --git a/sw/source/uibase/sidebar/PageHeaderPanel.cxx b/sw/source/uibase/sidebar/PageHeaderPanel.cxx
index a59a6f8ce2ff..094c646de0a9 100644
--- a/sw/source/uibase/sidebar/PageHeaderPanel.cxx
+++ b/sw/source/uibase/sidebar/PageHeaderPanel.cxx
@@ -31,19 +31,16 @@
namespace sw::sidebar{
-VclPtr<vcl::Window> PageHeaderPanel::Create(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+std::unique_ptr<PanelLayout> PageHeaderPanel::Create(
+ weld::Widget* pParent,
SfxBindings* pBindings)
{
if( pParent == nullptr )
throw ::com::sun::star::lang::IllegalArgumentException("no parent window given to PageHeaderPanel::Create", nullptr, 0);
- if( !rxFrame.is() )
- throw ::com::sun::star::lang::IllegalArgumentException("no XFrame given to PageHeaderPanel::Create", nullptr, 0);
if( pBindings == nullptr )
throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to PageHeaderPanel::Create", nullptr, 0);
- return VclPtr<PageHeaderPanel>::Create(pParent, rxFrame, pBindings);
+ return std::make_unique<PageHeaderPanel>(pParent, pBindings);
}
void PageHeaderPanel::SetMarginsAndSpacingFieldUnit()
@@ -53,11 +50,10 @@ void PageHeaderPanel::SetMarginsAndSpacingFieldUnit()
}
PageHeaderPanel::PageHeaderPanel(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings
) :
- PanelLayout(pParent, "PageHeaderPanel", "modules/swriter/ui/pageheaderpanel.ui", rxFrame),
+ PanelLayout(pParent, "PageHeaderPanel", "modules/swriter/ui/pageheaderpanel.ui"),
mpBindings( pBindings ),
maHFToggleController(SID_ATTR_PAGE_HEADER, *pBindings, *this),
maMetricController(SID_ATTR_METRIC, *pBindings,*this),
@@ -81,18 +77,11 @@ PageHeaderPanel::PageHeaderPanel(
PageHeaderPanel::~PageHeaderPanel()
{
- disposeOnce();
-}
-
-void PageHeaderPanel::dispose()
-{
mxHeaderToggle.reset();
mxHeaderSpacingLB.reset();
mxHeaderLayoutLB.reset();
mxHeaderMarginPresetLB.reset();
mxCustomEntry.reset();
-
- PanelLayout::dispose();
}
FieldUnit PageHeaderPanel::GetCurrentUnit(SfxItemState eState, const SfxPoolItem* pState)
diff --git a/sw/source/uibase/sidebar/PageHeaderPanel.hxx b/sw/source/uibase/sidebar/PageHeaderPanel.hxx
index 251ff3a474dc..90286b5d1437 100644
--- a/sw/source/uibase/sidebar/PageHeaderPanel.hxx
+++ b/sw/source/uibase/sidebar/PageHeaderPanel.hxx
@@ -20,30 +20,24 @@
#pragma once
#include <memory>
-#include <com/sun/star/frame/XFrame.hpp>
-
#include <sfx2/sidebar/PanelLayout.hxx>
-
#include <sfx2/sidebar/ControllerItem.hxx>
-
-#include <svx/rulritem.hxx>
-
#include <svl/intitem.hxx>
#include <svl/poolitem.hxx>
#include <svl/eitem.hxx>
#include <svx/spacinglistbox.hxx>
#include <svx/samecontentlistbox.hxx>
+#include <svx/rulritem.hxx>
namespace sw::sidebar {
-class PageHeaderPanel:
+class PageHeaderPanel :
public PanelLayout,
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static VclPtr<vcl::Window> Create(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ static std::unique_ptr<PanelLayout> Create(
+ weld::Widget* pParent,
SfxBindings* pBindings);
virtual void NotifyItemUpdate(
@@ -57,11 +51,9 @@ public:
SfxBindings* GetBindings() const { return mpBindings; }
PageHeaderPanel(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings);
virtual ~PageHeaderPanel() override;
- virtual void dispose() override;
private:
diff --git a/sw/source/uibase/sidebar/PageStylesPanel.cxx b/sw/source/uibase/sidebar/PageStylesPanel.cxx
index f2ebd9dd03cc..2659fc39dda1 100644
--- a/sw/source/uibase/sidebar/PageStylesPanel.cxx
+++ b/sw/source/uibase/sidebar/PageStylesPanel.cxx
@@ -20,6 +20,7 @@
#include <svl/intitem.hxx>
#include <svx/colorbox.hxx>
#include <svx/drawitem.hxx>
+#include <svx/itemwin.hxx>
#include <svx/xfillit0.hxx>
#include <svx/xflclit.hxx>
#include <svx/xflgrit.hxx>
@@ -67,7 +68,6 @@ static sal_uInt16 PageUsageToPos_Impl( SvxPageUsage nUsage )
return 3;
}
-
static SvxPageUsage PosToPageUsage_Impl( sal_uInt16 nPos )
{
if ( nPos >= SAL_N_ELEMENTS(aArr) )
@@ -75,27 +75,21 @@ static SvxPageUsage PosToPageUsage_Impl( sal_uInt16 nPos )
return aArr[nPos];
}
-VclPtr<vcl::Window> PageStylesPanel::Create(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
- SfxBindings* pBindings)
+std::unique_ptr<PanelLayout> PageStylesPanel::Create(weld::Widget* pParent, SfxBindings* pBindings)
{
if( pParent == nullptr )
throw ::com::sun::star::lang::IllegalArgumentException("no parent window given to PageStylesPanel::Create", nullptr, 0);
- if( !rxFrame.is() )
- throw ::com::sun::star::lang::IllegalArgumentException("no XFrame given to PageStylesPanel::Create", nullptr, 0);
if( pBindings == nullptr )
throw ::com::sun::star::lang::IllegalArgumentException("no SfxBindings given to PageStylesPanel::Create", nullptr, 0);
- return VclPtr<PageStylesPanel>::Create(pParent, rxFrame, pBindings);
+ return std::make_unique<PageStylesPanel>(pParent, pBindings);
}
PageStylesPanel::PageStylesPanel(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings
) :
- PanelLayout(pParent, "PageStylesPanel", "modules/swriter/ui/pagestylespanel.ui", rxFrame),
+ PanelLayout(pParent, "PageStylesPanel", "modules/swriter/ui/pagestylespanel.ui"),
mpBindings( pBindings ),
mpPageColumnItem( new SfxInt16Item(SID_ATTR_PAGE_COLUMN) ),
mpPageItem( new SvxPageItem(SID_ATTR_PAGE) ),
@@ -122,11 +116,6 @@ PageStylesPanel::PageStylesPanel(
PageStylesPanel::~PageStylesPanel()
{
- disposeOnce();
-}
-
-void PageStylesPanel::dispose()
-{
mxColumnCount.reset();
mxNumberSelectLB.reset();
mxBgFillType.reset();
@@ -144,7 +133,6 @@ void PageStylesPanel::dispose()
maBgHatchingControl.dispose();
maPageColumnControl.dispose();
maPageNumFormatControl.dispose();
- PanelLayout::dispose();
}
void PageStylesPanel::Initialize()
diff --git a/sw/source/uibase/sidebar/PageStylesPanel.hxx b/sw/source/uibase/sidebar/PageStylesPanel.hxx
index 7e3c09d2eebb..6047d2535666 100644
--- a/sw/source/uibase/sidebar/PageStylesPanel.hxx
+++ b/sw/source/uibase/sidebar/PageStylesPanel.hxx
@@ -20,21 +20,16 @@
#define INCLUDED_SW_SOURCE_UIBASE_SIDEBAR_PAGESTYLESPANEL_HXX
#include <memory>
-#include <com/sun/star/frame/XFrame.hpp>
#include <sfx2/sidebar/PanelLayout.hxx>
-
#include <sfx2/sidebar/ControllerItem.hxx>
-
-#include <svx/pageitem.hxx>
-
#include <svl/intitem.hxx>
#include <svl/poolitem.hxx>
#include <svx/xbtmpit.hxx>
#include <svx/xflclit.hxx>
#include <svx/xflgrit.hxx>
#include <svx/xflhtit.hxx>
-#include <svx/itemwin.hxx>
+#include <svx/pageitem.hxx>
#include <svx/pagenumberlistbox.hxx>
class List;
@@ -46,9 +41,8 @@ class PageStylesPanel:
public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static VclPtr<vcl::Window> Create(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ static std::unique_ptr<PanelLayout> Create(
+ weld::Widget* pParent,
SfxBindings* pBindings);
virtual void NotifyItemUpdate(
@@ -62,11 +56,9 @@ public:
SfxBindings* GetBindings() const { return mpBindings; }
PageStylesPanel(
- vcl::Window* pParent,
- const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame >& rxFrame,
+ weld::Widget* pParent,
SfxBindings* pBindings);
virtual ~PageStylesPanel() override;
- virtual void dispose() override;
private:
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.cxx b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
index 12e400b939b9..4d3095e0072e 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.cxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.cxx
@@ -130,20 +130,16 @@ BitmapEx CreatePreview(OUString const & aUrl, OUString const & aName)
}
-VclPtr<vcl::Window> StylePresetsPanel::Create (vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame)
+std::unique_ptr<PanelLayout> StylePresetsPanel::Create(weld::Widget* pParent)
{
if (pParent == nullptr)
throw css::lang::IllegalArgumentException("no parent Window given to StylePresetsPanel::Create", nullptr, 0);
- if (!rxFrame.is())
- throw css::lang::IllegalArgumentException("no XFrame given to StylePresetsPanel::Create", nullptr, 1);
- return VclPtr<StylePresetsPanel>::Create(pParent, rxFrame);
+ return std::make_unique<StylePresetsPanel>(pParent);
}
-StylePresetsPanel::StylePresetsPanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame)
- : PanelLayout(pParent, "StylePresetsPanel", "modules/swriter/ui/sidebarstylepresets.ui", rxFrame)
+StylePresetsPanel::StylePresetsPanel(weld::Widget* pParent)
+ : PanelLayout(pParent, "StylePresetsPanel", "modules/swriter/ui/sidebarstylepresets.ui")
, mxValueSet(new ValueSet(nullptr))
, mxValueSetWin(new weld::CustomWeld(*m_xBuilder, "valueset", *mxValueSet))
{
@@ -152,8 +148,6 @@ StylePresetsPanel::StylePresetsPanel(vcl::Window* pParent,
mxValueSet->SetDoubleClickHdl(LINK(this, StylePresetsPanel, DoubleClickHdl));
RefreshList();
-
- m_pInitialFocusWidget = mxValueSet->GetDrawingArea();
}
void StylePresetsPanel::RefreshList()
@@ -182,15 +176,6 @@ void StylePresetsPanel::RefreshList()
StylePresetsPanel::~StylePresetsPanel()
{
- disposeOnce();
-}
-
-void StylePresetsPanel::dispose()
-{
- mxValueSetWin.reset();
- mxValueSet.reset();
-
- PanelLayout::dispose();
}
IMPL_LINK_NOARG(StylePresetsPanel, DoubleClickHdl, ValueSet*, void)
diff --git a/sw/source/uibase/sidebar/StylePresetsPanel.hxx b/sw/source/uibase/sidebar/StylePresetsPanel.hxx
index 36b272a08754..75a6cb3c4e0e 100644
--- a/sw/source/uibase/sidebar/StylePresetsPanel.hxx
+++ b/sw/source/uibase/sidebar/StylePresetsPanel.hxx
@@ -11,12 +11,9 @@
#pragma once
#include <memory>
-#include <com/sun/star/frame/XFrame.hpp>
#include <sfx2/sidebar/PanelLayout.hxx>
-
#include <sfx2/sidebar/ControllerItem.hxx>
-
#include <svtools/valueset.hxx>
namespace sw::sidebar {
@@ -24,10 +21,12 @@ namespace sw::sidebar {
class StylePresetsPanel : public PanelLayout,
public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
- friend class VclPtr<StylePresetsPanel>;
public:
- 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);
+
+ StylePresetsPanel(weld::Widget* pParent);
+
+ virtual ~StylePresetsPanel() override;
virtual void NotifyItemUpdate(const sal_uInt16 nSId,
const SfxItemState eState,
@@ -49,12 +48,6 @@ private:
void RefreshList();
- StylePresetsPanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame);
-
- virtual ~StylePresetsPanel() override;
- virtual void dispose() override;
-
std::unique_ptr<ValueSet> mxValueSet;
std::unique_ptr<weld::CustomWeld> mxValueSetWin;
diff --git a/sw/source/uibase/sidebar/SwPanelFactory.cxx b/sw/source/uibase/sidebar/SwPanelFactory.cxx
index 68e5c0684d6a..27261caf04a9 100644
--- a/sw/source/uibase/sidebar/SwPanelFactory.cxx
+++ b/sw/source/uibase/sidebar/SwPanelFactory.cxx
@@ -32,8 +32,7 @@
#include <redlndlg.hxx>
#include <sfx2/sidebar/SidebarPanelBase.hxx>
-#include <toolkit/helper/vclunohelper.hxx>
-#include <vcl/window.hxx>
+#include <vcl/weldutils.hxx>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <comphelper/namedvaluecollection.hxx>
#include <cppuhelper/compbase.hxx>
@@ -93,8 +92,11 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::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);
@@ -109,93 +111,93 @@ Reference<ui::XUIElement> SAL_CALL SwPanelFactory::createUIElement (
if(rsResourceURL.endsWith("/PageStylesPanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::PageStylesPanel::Create( pParentWindow, xFrame, pBindings );
+ std::unique_ptr<PanelLayout> xPanel = sw::sidebar::PageStylesPanel::Create( pParent, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
- pPanel,
+ std::move(xPanel),
ui::LayoutSize(-1,-1,-1));
}
else if(rsResourceURL.endsWith("/PageFormatPanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::PageFormatPanel::Create( pParentWindow, xFrame, pBindings );
+ std::unique_ptr<PanelLayout> xPanel = sw::sidebar::PageFormatPanel::Create( pParent, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
- pPanel,
+ std::move(xPanel),
ui::LayoutSize(-1,-1,-1));
}
else if(rsResourceURL.endsWith("/PageHeaderPanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::PageHeaderPanel::Create( pParentWindow, xFrame, pBindings );
+ std::unique_ptr<PanelLayout> xPanel = sw::sidebar::PageHeaderPanel::Create( pParent, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
- pPanel,
+ std::move(xPanel),
ui::LayoutSize(-1,-1,-1));
}
else if(rsResourceURL.endsWith("/PageFooterPanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::PageFooterPanel::Create( pParentWindow, xFrame, pBindings );
+ std::unique_ptr<PanelLayout> xPanel = sw::sidebar::PageFooterPanel::Create( pParent, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
- pPanel,
+ std::move(xPanel),
ui::LayoutSize(-1,-1,-1));
}
else if (rsResourceURL.endsWith("/WrapPropertyPanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::WrapPropertyPanel::Create( pParentWindow, xFrame, pBindings );
+ std::unique_ptr<PanelLayout> xPanel = sw::sidebar::WrapPropertyPanel::Create( pParent, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
- pPanel,
+ std::move(xPanel),
ui::LayoutSize(-1,-1,-1));
}
else if (rsResourceURL.endsWith("/NavigatorPanel"))
{
- VclPtr<vcl::Window> pPanel = SwNavigationPI::Create( pParentWindow, xFrame, pBindings );
+ std::unique_ptr<PanelLayout> xPanel = SwNavigationPI::Create( pParent, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
- pPanel,
+ std::move(xPanel),
ui::LayoutSize(0,-1,-1));
}
else if (rsResourceURL.endsWith("/ManageChangesPanel"))
{
- VclPtrInstance<SwRedlineAcceptPanel> pPanel(pParentWindow, xFrame);
+ auto xPanel = std::make_unique<SwRedlineAcceptPanel>(pParent);
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
- pPanel,
+ std::move(xPanel),
ui::LayoutSize(-1,-1,-1));
}
else if (rsResourceURL.endsWith("/WriterInspectorTextPanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::WriterInspectorTextPanel::Create( pParentWindow, xFrame);
+ std::unique_ptr<PanelLayout> xPanel = sw::sidebar::WriterInspectorTextPanel::Create(pParent);
xElement = sfx2::sidebar::SidebarPanelBase::Create(
rsResourceURL,
xFrame,
- pPanel,
+ std::move(xPanel),
ui::LayoutSize(0,-1,-1));
}
else if (rsResourceURL.endsWith("/StylePresetsPanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::StylePresetsPanel::Create(pParentWindow, xFrame);
+ std::unique_ptr<PanelLayout> xPanel = sw::sidebar::StylePresetsPanel::Create(pParent);
xElement = sfx2::sidebar::SidebarPanelBase::Create(
- rsResourceURL, xFrame, pPanel, ui::LayoutSize(-1,-1,-1));
+ rsResourceURL, xFrame, std::move(xPanel), ui::LayoutSize(-1,-1,-1));
}
else if (rsResourceURL.endsWith("/ThemePanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::ThemePanel::Create(pParentWindow, xFrame);
+ std::unique_ptr<PanelLayout> xPanel = sw::sidebar::ThemePanel::Create(pParent);
xElement = sfx2::sidebar::SidebarPanelBase::Create(
- rsResourceURL, xFrame, pPanel, ui::LayoutSize(-1,-1,-1));
+ rsResourceURL, xFrame, std::move(xPanel), ui::LayoutSize(-1,-1,-1));
}
else if (rsResourceURL.endsWith("/TableEditPanel"))
{
- VclPtr<vcl::Window> pPanel = sw::sidebar::TableEditPanel::Create(pParentWindow, xFrame, pBindings );
+ std::unique_ptr<PanelLayout> xPanel = sw::sidebar::TableEditPanel::Create(pParent, xFrame, pBindings );
xElement = sfx2::sidebar::SidebarPanelBase::Create(
- rsResourceURL, xFrame, pPanel, ui::LayoutSize(-1,-1,-1));
+ rsResourceURL, xFrame, std::move(xPanel), ui::LayoutSize(-1,-1,-1));
}
return xElement;
diff --git a/sw/source/uibase/sidebar/TableEditPanel.cxx b/sw/source/uibase/sidebar/TableEditPanel.cxx
index de91b0e37737..ea8c441888ed 100644
--- a/sw/source/uibase/sidebar/TableEditPanel.cxx
+++ b/sw/source/uibase/sidebar/TableEditPanel.cxx
@@ -25,9 +25,10 @@
namespace sw::sidebar
{
-VclPtr<vcl::Window> TableEditPanel::Create(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings)
+std::unique_ptr<PanelLayout>
+TableEditPanel::Create(weld::Widget* pParent,
+ const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings)
{
if (pParent == nullptr)
throw css::lang::IllegalArgumentException(
@@ -36,7 +37,7 @@ VclPtr<vcl::Window> TableEditPanel::Create(vcl::Window* pParent,
throw css::lang::IllegalArgumentException("no XFrame given to TableEditPanel::Create",
nullptr, 1);
- return VclPtr<TableEditPanel>::Create(pParent, rxFrame, pBindings);
+ return std::make_unique<TableEditPanel>(pParent, rxFrame, pBindings);
}
void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState eState,
@@ -87,10 +88,10 @@ void TableEditPanel::NotifyItemUpdate(const sal_uInt16 nSID, const SfxItemState
}
}
-TableEditPanel::TableEditPanel(vcl::Window* pParent,
+TableEditPanel::TableEditPanel(weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
- : PanelLayout(pParent, "TableEditPanel", "modules/swriter/ui/sidebartableedit.ui", rxFrame)
+ : PanelLayout(pParent, "TableEditPanel", "modules/swriter/ui/sidebartableedit.ui")
, m_pBindings(pBindings)
, m_xRowHeightEdit(
new SvxRelativeField(m_xBuilder->weld_metric_spin_button("rowheight", FieldUnit::CM)))
@@ -138,12 +139,8 @@ TableEditPanel::TableEditPanel(vcl::Window* pParent,
if (comphelper::LibreOfficeKit::isActive())
m_xMisc->set_item_visible(".uno:InsertFormula", false);
-
- m_pInitialFocusWidget = &m_xRowHeightEdit->get_widget();
}
-TableEditPanel::~TableEditPanel() { disposeOnce(); }
-
void TableEditPanel::InitRowHeightToolitem()
{
Link<weld::MetricSpinButton&, void> aLink = LINK(this, TableEditPanel, RowHeightMofiyHdl);
@@ -172,7 +169,7 @@ void TableEditPanel::InitColumnWidthToolitem()
limitWidthForSidebar(*m_xColumnWidthEdit);
}
-void TableEditPanel::dispose()
+TableEditPanel::~TableEditPanel()
{
m_xRowHeightEdit.reset();
m_xColumnWidthEdit.reset();
@@ -214,8 +211,6 @@ void TableEditPanel::dispose()
m_aSetOptimalColumnWidthController.dispose();
m_aDistributeColumnsController.dispose();
m_aMergeCellsController.dispose();
-
- PanelLayout::dispose();
}
IMPL_LINK_NOARG(TableEditPanel, RowHeightMofiyHdl, weld::MetricSpinButton&, void)
diff --git a/sw/source/uibase/sidebar/TableEditPanel.hxx b/sw/source/uibase/sidebar/TableEditPanel.hxx
index 113455060484..01098df5e60f 100644
--- a/sw/source/uibase/sidebar/TableEditPanel.hxx
+++ b/sw/source/uibase/sidebar/TableEditPanel.hxx
@@ -21,12 +21,14 @@ namespace sw::sidebar
class TableEditPanel : public PanelLayout,
public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
- friend class VclPtr<TableEditPanel>;
-
public:
- static VclPtr<vcl::Window> Create(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
+ static std::unique_ptr<PanelLayout>
+ Create(weld::Widget* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+
+ TableEditPanel(weld::Widget* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame,
+ SfxBindings* pBindings);
+ virtual ~TableEditPanel() override;
virtual void NotifyItemUpdate(const sal_uInt16 nSId, const SfxItemState eState,
const SfxPoolItem* pState) override;
@@ -35,11 +37,6 @@ public:
boost::property_tree::ptree& /*rState*/) override{};
private:
- TableEditPanel(vcl::Window* pParent, const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* pBindings);
- virtual ~TableEditPanel() override;
- virtual void dispose() override;
-
void InitRowHeightToolitem();
void InitColumnWidthToolitem();
diff --git a/sw/source/uibase/sidebar/ThemePanel.cxx b/sw/source/uibase/sidebar/ThemePanel.cxx
index a25b08806d91..15aed1b14594 100644
--- a/sw/source/uibase/sidebar/ThemePanel.cxx
+++ b/sw/source/uibase/sidebar/ThemePanel.cxx
@@ -397,20 +397,16 @@ BitmapEx GenerateColorPreview(const svx::ColorSet& rColorSet)
namespace sw::sidebar {
-VclPtr<vcl::Window> ThemePanel::Create (vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame)
+std::unique_ptr<PanelLayout> ThemePanel::Create(weld::Widget* pParent)
{
if (pParent == nullptr)
throw css::lang::IllegalArgumentException("no parent Window given to PagePropertyPanel::Create", nullptr, 0);
- if (!rxFrame.is())
- throw css::lang::IllegalArgumentException("no XFrame given to PagePropertyPanel::Create", nullptr, 1);
- return VclPtr<ThemePanel>::Create(pParent, rxFrame);
+ return std::make_unique<ThemePanel>(pParent);
}
-ThemePanel::ThemePanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame)
- : PanelLayout(pParent, "ThemePanel", "modules/swriter/ui/sidebartheme.ui", rxFrame)
+ThemePanel::ThemePanel(weld::Widget* pParent)
+ : PanelLayout(pParent, "ThemePanel", "modules/swriter/ui/sidebartheme.ui")
, mxListBoxFonts(m_xBuilder->weld_tree_view("listbox_fonts"))
, mxValueSetColors(new ValueSet(nullptr))
, mxValueSetColorsWin(new weld::CustomWeld(*m_xBuilder, "valueset_colors", *mxValueSetColors))
@@ -447,23 +443,14 @@ ThemePanel::ThemePanel(vcl::Window* pParent,
if (!aColorSets.empty())
mxValueSetColors->SelectItem(1); // ItemId 1, position 0
-
- m_pInitialFocusWidget = mxListBoxFonts.get();
}
ThemePanel::~ThemePanel()
{
- disposeOnce();
-}
-
-void ThemePanel::dispose()
-{
mxListBoxFonts.reset();
mxValueSetColorsWin.reset();
mxValueSetColors.reset();
mxApplyButton.reset();
-
- PanelLayout::dispose();
}
IMPL_LINK_NOARG(ThemePanel, ClickHdl, weld::Button&, void)
diff --git a/sw/source/uibase/sidebar/ThemePanel.hxx b/sw/source/uibase/sidebar/ThemePanel.hxx
index b2b1c503790f..14af479e664a 100644
--- a/sw/source/uibase/sidebar/ThemePanel.hxx
+++ b/sw/source/uibase/sidebar/ThemePanel.hxx
@@ -10,7 +10,6 @@
#pragma once
-#include <com/sun/star/frame/XFrame.hpp>
#include <sfx2/sidebar/PanelLayout.hxx>
#include <sfx2/sidebar/ControllerItem.hxx>
#include <svtools/valueset.hxx>
@@ -21,10 +20,11 @@ namespace sw::sidebar {
class ThemePanel : public PanelLayout,
public sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
- friend class VclPtr<ThemePanel>;
public:
- 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);
+
+ ThemePanel(weld::Widget* pParent);
+ virtual ~ThemePanel() override;
virtual void NotifyItemUpdate(const sal_uInt16 nSId,
const SfxItemState eState,
@@ -35,12 +35,6 @@ public:
boost::property_tree::ptree& /*rState*/) override {};
private:
- ThemePanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame);
- virtual ~ThemePanel() override;
-
- virtual void dispose() override;
-
std::unique_ptr<weld::TreeView> mxListBoxFonts;
std::unique_ptr<ValueSet> mxValueSetColors;
std::unique_ptr<weld::CustomWeld> mxValueSetColorsWin;
diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
index 08c6405f7a31..352abffee68b 100644
--- a/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
+++ b/sw/source/uibase/sidebar/WrapPropertyPanel.cxx
@@ -37,8 +37,8 @@
namespace sw::sidebar {
-VclPtr<vcl::Window> WrapPropertyPanel::Create (
- vcl::Window* pParent,
+std::unique_ptr<PanelLayout> WrapPropertyPanel::Create (
+ weld::Widget* pParent,
const css::uno::Reference< css::frame::XFrame >& rxFrame,
SfxBindings* pBindings)
{
@@ -49,17 +49,14 @@ VclPtr<vcl::Window> WrapPropertyPanel::Create (
if (pBindings == nullptr)
throw css::lang::IllegalArgumentException("no SfxBindings given to WrapPropertyPanel::Create", nullptr, 2);
- return VclPtr<WrapPropertyPanel>::Create(
- pParent,
- rxFrame,
- pBindings);
+ return std::make_unique<WrapPropertyPanel>(pParent, rxFrame, pBindings);
}
WrapPropertyPanel::WrapPropertyPanel(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference< css::frame::XFrame >& rxFrame,
SfxBindings* pBindings )
- : PanelLayout(pParent, "WrapPropertyPanel", "modules/swriter/ui/sidebarwrap.ui", rxFrame)
+ : PanelLayout(pParent, "WrapPropertyPanel", "modules/swriter/ui/sidebarwrap.ui")
, mpBindings(pBindings)
// spacing
, nTop(0)
@@ -79,26 +76,16 @@ WrapPropertyPanel::WrapPropertyPanel(
SpacingListBox::Fill(IsInch(eMetric) ? SpacingType::SPACING_INCH : SpacingType::SPACING_CM, *mxSpacingLB);
Initialize();
-
- m_pInitialFocusWidget = mxWrapOptions.get();
}
WrapPropertyPanel::~WrapPropertyPanel()
{
- disposeOnce();
-}
-
-void WrapPropertyPanel::dispose()
-{
- mxSpacingLB.reset();
mxWrapOptionsDispatch.reset();
mxWrapOptions.reset();
maSwLRSpacingControl.dispose();
maSwULSpacingControl.dispose();
-
- PanelLayout::dispose();
}
void WrapPropertyPanel::Initialize()
diff --git a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx
index 1f4d16d80595..319085513e1b 100644
--- a/sw/source/uibase/sidebar/WrapPropertyPanel.hxx
+++ b/sw/source/uibase/sidebar/WrapPropertyPanel.hxx
@@ -32,8 +32,8 @@ namespace sw::sidebar {
, public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface
{
public:
- static VclPtr<vcl::Window> Create(
- vcl::Window* pParent,
+ static std::unique_ptr<PanelLayout> Create(
+ weld::Widget* pParent,
const css::uno::Reference< css::frame::XFrame>& rxFrame,
SfxBindings* pBindings );
@@ -48,10 +48,9 @@ namespace sw::sidebar {
boost::property_tree::ptree& /*rState*/) override {};
virtual ~WrapPropertyPanel() override;
- virtual void dispose() override;
WrapPropertyPanel(
- vcl::Window* pParent,
+ weld::Widget* pParent,
const css::uno::Reference< css::frame::XFrame >& rxFrame,
SfxBindings* pBindings );
private:
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
index e2c3c15d0e24..ffebff28eb02 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.cxx
@@ -28,6 +28,7 @@
#include <com/sun/star/text/XTextRange.hpp>
#include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/beans/XPropertyState.hpp>
+#include <com/sun/star/frame/XFrame.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/table/BorderLine2.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
@@ -44,22 +45,16 @@ namespace sw::sidebar
{
static void UpdateTree(SwDocShell* pDocSh, std::vector<svx::sidebar::TreeNode>& aStore);
-VclPtr<vcl::Window> WriterInspectorTextPanel::Create(vcl::Window* pParent,
- const uno::Reference<frame::XFrame>& rxFrame)
+std::unique_ptr<PanelLayout> WriterInspectorTextPanel::Create(weld::Widget* pParent)
{
if (pParent == nullptr)
throw lang::IllegalArgumentException(
"no parent Window given to WriterInspectorTextPanel::Create", nullptr, 0);
- if (!rxFrame.is())
- throw lang::IllegalArgumentException("no XFrame given to WriterInspectorTextPanel::Create",
- nullptr, 1);
-
- return VclPtr<WriterInspectorTextPanel>::Create(pParent, rxFrame);
+ return std::make_unique<WriterInspectorTextPanel>(pParent);
}
-WriterInspectorTextPanel::WriterInspectorTextPanel(vcl::Window* pParent,
- const uno::Reference<frame::XFrame>& rxFrame)
- : InspectorTextPanel(pParent, rxFrame)
+WriterInspectorTextPanel::WriterInspectorTextPanel(weld::Widget* pParent)
+ : InspectorTextPanel(pParent)
{
SwDocShell* pDocSh = static_cast<SwDocShell*>(SfxObjectShell::Current());
m_pShell = pDocSh->GetWrtShell();
@@ -76,14 +71,7 @@ WriterInspectorTextPanel::WriterInspectorTextPanel(vcl::Window* pParent,
updateEntries(aStore);
}
-WriterInspectorTextPanel::~WriterInspectorTextPanel() { disposeOnce(); }
-
-void WriterInspectorTextPanel::dispose()
-{
- m_pShell->SetChgLnk(m_oldLink);
-
- InspectorTextPanel::dispose();
-}
+WriterInspectorTextPanel::~WriterInspectorTextPanel() { m_pShell->SetChgLnk(m_oldLink); }
static OUString PropertyNametoRID(const OUString& rName)
{
diff --git a/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx b/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx
index 5fd3402af222..c3459c8d3b7a 100644
--- a/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx
+++ b/sw/source/uibase/sidebar/WriterInspectorTextPanel.hxx
@@ -28,14 +28,11 @@ namespace sw::sidebar
class WriterInspectorTextPanel final : public svx::sidebar::InspectorTextPanel
{
public:
- 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);
- WriterInspectorTextPanel(vcl::Window* pParent,
- const css::uno::Reference<css::frame::XFrame>& rxFrame);
+ WriterInspectorTextPanel(weld::Widget* pParent);
virtual ~WriterInspectorTextPanel() override;
- virtual void dispose() override;
private:
SwWrtShell* m_pShell;
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index ebaa3857b2f5..9d59cf92152a 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -914,7 +914,7 @@ SwContentTree::SwContentTree(std::unique_ptr<weld::TreeView> xTreeView, SwNaviga
: m_xTreeView(std::move(xTreeView))
, m_xScratchIter(m_xTreeView->make_iterator())
, m_aDropTargetHelper(*this)
- , m_xDialog(pDialog)
+ , m_pDialog(pDialog)
, m_sSpace(OUString(" "))
, m_sInvisible(SwResId(STR_INVISIBLE))
, m_pHiddenShell(nullptr)
@@ -967,7 +967,6 @@ SwContentTree::~SwContentTree()
clear(); // If applicable erase content types previously.
m_aUpdTimer.Stop();
SetActiveShell(nullptr);
- m_xDialog.clear();
}
// Drag&Drop methods
@@ -4488,7 +4487,7 @@ bool NaviContentBookmark::Paste( TransferableDataHelper& rData )
SwNavigationPI* SwContentTree::GetParentWindow()
{
- return m_xDialog;
+ return m_pDialog;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx
index 7cf78d2f5b78..de0bd8b74344 100644
--- a/sw/source/uibase/utlui/glbltree.cxx
+++ b/sw/source/uibase/utlui/glbltree.cxx
@@ -127,7 +127,7 @@ static const char* GLOBAL_CONTEXT_ARY[] =
SwGlobalTree::SwGlobalTree(std::unique_ptr<weld::TreeView> xTreeView, SwNavigationPI* pDialog)
: m_xTreeView(std::move(xTreeView))
, m_aDropTargetHelper(*this)
- , m_xDialog(pDialog)
+ , m_pDialog(pDialog)
, m_pActiveShell(nullptr)
{
m_xTreeView->set_size_request(m_xTreeView->get_approximate_digit_width() * 30,
@@ -155,7 +155,6 @@ SwGlobalTree::~SwGlobalTree()
m_pSwGlblDocContents.reset();
m_pDocInserter.reset();
m_aUpdateTimer.Stop();
- m_xDialog.clear();
}
SwGlobalTreeDropTarget::SwGlobalTreeDropTarget(SwGlobalTree& rTreeView)
@@ -515,7 +514,8 @@ void SwGlobalTree::InsertRegion( const SwGlblDocContent* pCont, const OUString*
Sequence< OUString > aFileNames;
if ( !pFileName )
{
- m_pDocInserter.reset(new ::sfx2::DocumentInserter(GetParentWindow()->GetFrameWeld(), "swriter", sfx2::DocumentInserter::Mode::InsertMulti));
+ SwNavigationPI* pNavi = GetParentWindow();
+ m_pDocInserter.reset(new ::sfx2::DocumentInserter(pNavi->GetFrameWeld(), "swriter", sfx2::DocumentInserter::Mode::InsertMulti));
m_pDocInserter->StartExecuteModal( LINK( this, SwGlobalTree, DialogClosedHdl ) );
}
else if ( !pFileName->isEmpty() )
@@ -667,7 +667,7 @@ void SwGlobalTree::ExecuteContextMenuAction(const OString& rSelectedPopupEntry)
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
ScopedVclPtr<AbstractMultiTOXTabDialog> pDlg(pFact->CreateMultiTOXTabDialog(
- m_xDialog->GetFrameWeld(), aSet,
+ m_pDialog->GetFrameWeld(), aSet,
*m_pActiveShell,
nullptr,
true));
@@ -965,7 +965,7 @@ IMPL_LINK_NOARG( SwGlobalTree, DoubleClickHdl, weld::TreeView&, bool)
SwNavigationPI* SwGlobalTree::GetParentWindow()
{
- return m_xDialog;
+ return m_pDialog;
}
IMPL_STATIC_LINK_NOARG(SwGlobalTree, ShowFrameHdl, void*, void)
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 21f3a252e642..0b5e8d7b202e 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -197,7 +197,7 @@ IMPL_LINK(SwNavigationPI, ToolBoxSelectHdl, const OString&, rCommand, void)
}
else if (rCommand == "listbox")
{
- if (ParentIsFloatingWindow(GetParent()))
+ if (ParentIsFloatingWindow(m_xNavigatorDlg))
{
if (IsZoomedIn())
{
@@ -398,7 +398,7 @@ void SwNavigationPI::ZoomOut()
{
if (!IsZoomedIn())
return;
- SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent());
+ SfxNavigator* pNav = m_xNavigatorDlg.get();
if (!pNav)
return;
m_bIsZoomedIn = false;
@@ -415,7 +415,8 @@ void SwNavigationPI::ZoomOut()
m_xDocListBox->show();
}
- Size aOptimalSize(GetOptimalSize());
+ pNav->InvalidateChildSizeCache();
+ Size aOptimalSize(pNav->GetOptimalSize());
Size aNewSize(pNav->GetOutputSizePixel());
aNewSize.setHeight( m_aExpandedSize.Height() );
pNav->SetMinOutputSizePixel(aOptimalSize);
@@ -430,11 +431,11 @@ void SwNavigationPI::ZoomIn()
{
if (IsZoomedIn())
return;
- SfxNavigator* pNav = dynamic_cast<SfxNavigator*>(GetParent());
+ SfxNavigator* pNav = m_xNavigatorDlg.get();
if (!pNav)
return;
- m_aExpandedSize = GetSizePixel();
+ m_aExpandedSize = m_xNavigatorDlg->GetSizePixel();
m_xContentBox->hide();
m_xContentTree->HideTree();
@@ -443,7 +444,8 @@ void SwNavigationPI::ZoomIn()
m_xDocListBox->hide();
m_bIsZoomedIn = true;
- Size aOptimalSize(GetOptimalSize());
+ pNav->InvalidateChildSizeCache();
+ Size aOptimalSize(pNav->GetOptimalSize());
Size aNewSize(pNav->GetOutputSizePixel());
aNewSize.setHeight( aOptimalSize.Height() );
pNav->SetMinOutputSizePixel(aOptimalSize);
@@ -466,7 +468,7 @@ enum StatusIndex
}
-VclPtr<vcl::Window> SwNavigationPI::Create(vcl::Window* pParent,
+std::unique_ptr<PanelLayout> SwNavigationPI::Create(weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
SfxBindings* pBindings)
{
@@ -476,13 +478,13 @@ VclPtr<vcl::Window> SwNavigationPI::Create(vcl::Window* pParent,
throw css::lang::IllegalArgumentException("no XFrame given to SwNavigationPI::Create", nullptr, 0);
if( pBindings == nullptr )
throw css::lang::IllegalArgumentException("no SfxBindings given to SwNavigationPI::Create", nullptr, 0);
- return VclPtr<SwNavigationPI>::Create(pParent, rxFrame, pBindings);
+ return std::make_unique<SwNavigationPI>(pParent, rxFrame, pBindings, nullptr);
}
-SwNavigationPI::SwNavigationPI(vcl::Window* pParent,
+SwNavigationPI::SwNavigationPI(weld::Widget* pParent,
const css::uno::Reference<css::frame::XFrame>& rxFrame,
- SfxBindings* _pBindings)
- : PanelLayout(pParent, "NavigatorPanel", "modules/swriter/ui/navigatorpanel.ui", rxFrame)
+ SfxBindings* _pBindings, SfxNavigator* pNavigatorDlg)
+ : PanelLayout(pParent, "NavigatorPanel", "modules/swriter/ui/navigatorpanel.ui")
, m_aDocFullName(SID_DOCFULLNAME, *_pBindings, *this)
, m_aPageStats(FN_STAT_PAGE, *_pBindings, *this)
, m_xContent1ToolBox(m_xBuilder->weld_toolbar("content1"))
@@ -504,6 +506,7 @@ SwNavigationPI::SwNavigationPI(vcl::Window* pParent,
, m_xGlobalBox(m_xBuilder->weld_widget("globalbox"))
, m_xGlobalTree(new SwGlobalTree(m_xBuilder->weld_tree_view("globaltree"), this))
, m_xDocListBox(m_xBuilder->weld_combo_box("documents"))
+ , m_xNavigatorDlg(pNavigatorDlg)
, m_pContentView(nullptr)
, m_pContentWrtShell(nullptr)
, m_pActContView(nullptr)
@@ -516,7 +519,7 @@ SwNavigationPI::SwNavigationPI(vcl::Window* pParent,
{
m_xContainer->connect_container_focus_changed(LINK(this, SwNavigationPI, SetFocusChildHdl));
- set_id("NavigatorPanelParent"); // for uitest/writer_tests5/tdf114724.py
+ UpdateInitShow();
GetCreateView();
@@ -566,7 +569,7 @@ SwNavigationPI::SwNavigationPI(vcl::Window* pParent,
m_aStatusArr[3] = SwResId(STR_ACTIVE_VIEW);
- bool bFloatingNavigator = ParentIsFloatingWindow(GetParent());
+ bool bFloatingNavigator = ParentIsFloatingWindow(m_xNavigatorDlg);
m_xContentTree->set_selection_mode(SelectionMode::Single);
m_xContentTree->ShowTree();
@@ -625,17 +628,17 @@ SwNavigationPI::SwNavigationPI(vcl::Window* pParent,
m_xGlobalTree->set_accessible_name(SwResId(STR_ACCESS_TL_GLOBAL));
m_xDocListBox->set_accessible_name(m_aStatusArr[3]);
- m_aExpandedSize = GetOptimalSize();
-
- m_pInitialFocusWidget = m_xContent1ToolBox.get();
+ m_aExpandedSize = m_xContainer->get_preferred_size();
}
-SwNavigationPI::~SwNavigationPI()
+weld::Window* SwNavigationPI::GetFrameWeld() const
{
- disposeOnce();
+ if (m_xNavigatorDlg)
+ return m_xNavigatorDlg->GetFrameWeld();
+ return PanelLayout::GetFrameWeld();
}
-void SwNavigationPI::dispose()
+SwNavigationPI::~SwNavigationPI()
{
if (IsGlobalDoc() && !IsGlobalMode())
{
@@ -678,8 +681,6 @@ void SwNavigationPI::dispose()
m_aDocFullName.dispose();
m_aPageStats.dispose();
-
- PanelLayout::dispose();
}
void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/,
@@ -721,24 +722,21 @@ void SwNavigationPI::NotifyItemUpdate(sal_uInt16 nSID, SfxItemState /*eState*/,
}
}
-void SwNavigationPI::StateChanged(StateChangedType nStateChange)
+void SwNavigationPI::UpdateInitShow()
{
- PanelLayout::StateChanged(nStateChange);
- if (nStateChange == StateChangedType::InitShow)
+ // if the parent isn't a float, then the navigator is displayed in
+ // the sidebar or is otherwise docked. While the navigator could change
+ // its size, the sidebar can not, and the navigator would just waste
+ // space. Therefore disable this button.
+ bool bParentIsFloatingWindow(ParentIsFloatingWindow(m_xNavigatorDlg));
+ m_xContent6ToolBox->set_item_sensitive("listbox", bParentIsFloatingWindow);
+ // show content if docked
+ if (!bParentIsFloatingWindow && IsZoomedIn())
+ ZoomOut();
+ if (m_xContentTree)
{
- // if the parent isn't a float, then the navigator is displayed in
- // the sidebar or is otherwise docked. While the navigator could change
- // its size, the sidebar can not, and the navigator would just waste
- // space. Therefore disable this button.
- m_xContent6ToolBox->set_item_sensitive("listbox", ParentIsFloatingWindow(GetParent()));
- // show content if docked
- if (!ParentIsFloatingWindow(GetParent()) && IsZoomedIn())
- ZoomOut();
- if (m_xContentTree)
- {
- m_xContentTree->SetActiveShell(GetActiveWrtShell());
- m_xContentTree->UpdateTracking();
- }
+ m_xContentTree->SetActiveShell(GetActiveWrtShell());
+ m_xContentTree->UpdateTracking();
}
}
@@ -1096,12 +1094,13 @@ SwView* SwNavigationPI::GetCreateView() const
class SwNavigatorWin : public SfxNavigator
{
private:
- VclPtr<SwNavigationPI> pNavi;
+ std::unique_ptr<SwNavigationPI> m_xNavi;
public:
SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Window* pParent);
+ virtual void StateChanged(StateChangedType nStateChange) override;
virtual void dispose() override
{
- pNavi.disposeAndClear();
+ m_xNavi.reset();
SfxNavigator::dispose();
}
virtual ~SwNavigatorWin() override
@@ -1112,9 +1111,8 @@ public:
SwNavigatorWin::SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, vcl::Window* pParent)
: SfxNavigator(_pBindings, _pMgr, pParent)
+ , m_xNavi(std::make_unique<SwNavigationPI>(m_xContainer.get(), _pBindings->GetActiveFrame(), _pBindings, this))
{
- Reference< XFrame > xFrame = _pBindings->GetActiveFrame();
- pNavi = VclPtr< SwNavigationPI >::Create( this, xFrame, _pBindings );
_pBindings->Invalidate(SID_NAVIGATOR);
SwNavigationConfig* pNaviConfig = SW_MOD()->GetNavigationConfig();
@@ -1122,20 +1120,26 @@ SwNavigatorWin::SwNavigatorWin(SfxBindings* _pBindings, SfxChildWindow* _pMgr, v
const ContentTypeId nRootType = pNaviConfig->GetRootType();
if( nRootType != ContentTypeId::UNKNOWN )
{
- pNavi->m_xContentTree->SetRootType(nRootType);
- pNavi->m_xContent5ToolBox->set_item_active("root", true);
+ m_xNavi->m_xContentTree->SetRootType(nRootType);
+ m_xNavi->m_xContent5ToolBox->set_item_active("root", true);
if (nRootType == ContentTypeId::OUTLINE)
{
- pNavi->m_xContentTree->set_selection_mode(SelectionMode::Multiple);
+ m_xNavi->m_xContentTree->set_selection_mode(SelectionMode::Multiple);
}
}
- pNavi->m_xContentTree->SetOutlineLevel( static_cast< sal_uInt8 >( pNaviConfig->GetOutlineLevel() ) );
- pNavi->SetRegionDropMode( pNaviConfig->GetRegionMode() );
- pNavi->Show();
+ m_xNavi->m_xContentTree->SetOutlineLevel( static_cast< sal_uInt8 >( pNaviConfig->GetOutlineLevel() ) );
+ m_xNavi->SetRegionDropMode( pNaviConfig->GetRegionMode() );
- SetMinOutputSizePixel(pNavi->GetOptimalSize());
+ SetMinOutputSizePixel(GetOptimalSize());
if (pNaviConfig->IsSmall())
- pNavi->ZoomIn();
+ m_xNavi->ZoomIn();
+}
+
+void SwNavigatorWin::StateChanged(StateChangedType nStateChange)
+{
+ SfxNavigator::StateChanged(nStateChange);
+ if (nStateChange == StateChangedType::InitShow)
+ m_xNavi->UpdateInitShow();
}
SFX_IMPL_DOCKINGWINDOW(SwNavigatorWrapper, SID_NAVIGATOR);