From 9573883d846d1a4653acdcb6eb45e0b0d1849629 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Thu, 4 Mar 2021 17:22:14 +0000 Subject: remove intermediate containers in sidebars MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit tested extension sidebars of: a) Wollmux extension sidebars b) Analog Clock Extension demo https://wiki.openoffice.org/wiki/Sidebar_for_Developers#Example:_Analog_Clock_Extension Change-Id: If9729e20526681928137989f01a8ae733a9b0cb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112035 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- svx/inc/GalleryControl.hxx | 8 +--- svx/inc/galbrws2.hxx | 1 + svx/source/gallery2/GalleryControl.cxx | 20 +------- svx/source/inc/DefaultShapesPanel.hxx | 7 ++- svx/source/sidebar/EmptyPanel.cxx | 12 ++--- svx/source/sidebar/EmptyPanel.hxx | 3 +- svx/source/sidebar/PanelFactory.cxx | 48 ++++++++++---------- svx/source/sidebar/area/AreaPropertyPanel.cxx | 18 ++------ svx/source/sidebar/area/AreaPropertyPanel.hxx | 8 ++-- svx/source/sidebar/area/AreaPropertyPanelBase.cxx | 53 ++++++++-------------- svx/source/sidebar/effect/EffectPropertyPanel.cxx | 24 +++------- svx/source/sidebar/effect/EffectPropertyPanel.hxx | 10 +--- .../sidebar/fontwork/FontworkPropertyPanel.cxx | 16 +++---- .../sidebar/fontwork/FontworkPropertyPanel.hxx | 7 ++- .../sidebar/graphic/GraphicPropertyPanel.cxx | 33 ++------------ .../sidebar/graphic/GraphicPropertyPanel.hxx | 12 ++--- .../sidebar/inspector/InspectorTextPanel.cxx | 25 ++-------- svx/source/sidebar/line/LinePropertyPanel.cxx | 15 ++---- svx/source/sidebar/line/LinePropertyPanel.hxx | 7 ++- svx/source/sidebar/line/LinePropertyPanelBase.cxx | 13 ++---- svx/source/sidebar/lists/ListsPropertyPanel.cxx | 18 +++----- svx/source/sidebar/lists/ListsPropertyPanel.hxx | 7 ++- svx/source/sidebar/media/MediaPlaybackPanel.cxx | 27 +++-------- svx/source/sidebar/media/MediaPlaybackPanel.hxx | 11 ++--- svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 24 ++-------- svx/source/sidebar/paragraph/ParaPropertyPanel.hxx | 8 ++-- .../sidebar/possize/PosSizePropertyPanel.cxx | 28 ++---------- .../sidebar/possize/PosSizePropertyPanel.hxx | 10 ++-- svx/source/sidebar/shadow/ShadowPropertyPanel.cxx | 24 ++-------- svx/source/sidebar/shadow/ShadowPropertyPanel.hxx | 13 ++---- svx/source/sidebar/shapes/DefaultShapesPanel.cxx | 25 ++++------ svx/source/sidebar/styles/StylesPropertyPanel.cxx | 23 ++-------- svx/source/sidebar/styles/StylesPropertyPanel.hxx | 10 ++-- svx/source/sidebar/text/TextPropertyPanel.cxx | 19 ++------ svx/source/sidebar/text/TextPropertyPanel.hxx | 7 ++- 35 files changed, 170 insertions(+), 424 deletions(-) (limited to 'svx') 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 mxBrowser1; std::unique_ptr 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 90d7c4a562cf..0f4d75248835 100644 --- a/svx/inc/galbrws2.hxx +++ b/svx/inc/galbrws2.hxx @@ -26,6 +26,7 @@ #include #include +#include #include #include 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& rxFrame); - static VclPtr Create( - vcl::Window* pParent, + static std::unique_ptr Create( + weld::Widget* pParent, const css::uno::Reference& rxFrame); virtual ~DefaultShapesPanel() override; - virtual void dispose() override; private: std::unique_ptr 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 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 #include -#include -#include +#include #include #include #include @@ -104,8 +103,11 @@ Reference SAL_CALL PanelFactory::createUIElement ( const sal_uInt64 nBindingsValue (aArguments.getOrDefault("SfxBindings", sal_uInt64(0))); SfxBindings* pBindings = reinterpret_cast(nBindingsValue); - VclPtr pParentWindow = VCLUnoHelper::GetWindow(xParentWindow); - if ( ! xParentWindow.is() || pParentWindow==nullptr) + weld::Widget* pParent(nullptr); + if (weld::TransportAsXWindow* pTunnel = dynamic_cast(xParentWindow.get())) + pParent = pTunnel->getWidget(); + + if (!pParent) throw RuntimeException( "PanelFactory::createUIElement called without ParentWindow", nullptr); @@ -118,85 +120,85 @@ Reference SAL_CALL PanelFactory::createUIElement ( "PanelFactory::createUIElement called without SfxBindings", nullptr); - VclPtr pControl; + std::unique_ptr 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::Create(pParentWindow)); + xControl = std::make_unique(pParent); aLayoutSize = ui::LayoutSize(300,-1,400); } else if (rsResourceURL.endsWith("/StyleListPanel")) { - pControl.reset(VclPtr::Create(pBindings, pParentWindow)); + xControl = std::make_unique(pBindings, pParent); aLayoutSize = ui::LayoutSize(0,-1,-1); } else if (rsResourceURL.endsWith("/EmptyPanel")) { - pControl.reset(VclPtr::Create(pParentWindow)); + xControl = std::make_unique(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& rxFrame, SfxBindings* pBindings) : AreaPropertyPanelBase(pParent, rxFrame), @@ -51,11 +51,6 @@ AreaPropertyPanel::AreaPropertyPanel( } AreaPropertyPanel::~AreaPropertyPanel() -{ - disposeOnce(); -} - -void AreaPropertyPanel::dispose() { maStyleControl.dispose(); maColorControl.dispose(); @@ -68,12 +63,10 @@ void AreaPropertyPanel::dispose() maPatternListControl.dispose(); maFillTransparenceController.dispose(); maFillFloatTransparenceController.dispose(); - - AreaPropertyPanelBase::dispose(); } -VclPtr AreaPropertyPanel::Create ( - vcl::Window* pParent, +std::unique_ptr AreaPropertyPanel::Create ( + weld::Widget* pParent, const css::uno::Reference& rxFrame, SfxBindings* pBindings) { @@ -84,10 +77,7 @@ VclPtr AreaPropertyPanel::Create ( if (pBindings == nullptr) throw lang::IllegalArgumentException("no SfxBindings given to AreaPropertyPanel::Create", nullptr, 2); - return VclPtr::Create( - pParent, - rxFrame, - pBindings); + return std::make_unique(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 Create( - vcl::Window* pParent, + static std::unique_ptr Create( + weld::Widget* pParent, const css::uno::Reference& rxFrame, SfxBindings* pBindings); @@ -54,7 +52,7 @@ public: // constructor/destructor AreaPropertyPanel( - vcl::Window* pParent, + weld::Widget* pParent, const css::uno::Reference& 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& rxFrame) - : PanelLayout(pParent, "AreaPropertyPanel", "svx/ui/sidebararea.ui", rxFrame), + : PanelLayout(pParent, "AreaPropertyPanel", "svx/ui/sidebararea.ui"), meLastXFS(static_cast(-1)), mnLastPosHatch(0), mnLastPosBitmap(0), @@ -104,19 +104,10 @@ AreaPropertyPanelBase::AreaPropertyPanelBase( mpFloatTransparenceItem(), mpTransparanceItem() { - mpPanel = dynamic_cast(pParent); - Initialize(); - - m_pInitialFocusWidget = mxLbFillType.get(); } AreaPropertyPanelBase::~AreaPropertyPanelBase() -{ - disposeOnce(); -} - -void AreaPropertyPanelBase::dispose() { mxTrGrPopup.reset(); mxColorTextFT.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(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(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(-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& 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 -EffectPropertyPanel::Create(vcl::Window* pParent, - const css::uno::Reference& rxFrame, - SfxBindings* pBindings) +std::unique_ptr 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::Create(pParent, rxFrame, pBindings); + return std::make_unique(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 #include #include @@ -21,15 +20,10 @@ class EffectPropertyPanel : public PanelLayout, public ::sfx2::sidebar::ControllerItem::ItemUpdateReceiverInterface { public: - EffectPropertyPanel(vcl::Window* pParent, - const css::uno::Reference& rxFrame, - SfxBindings* pBindings); + EffectPropertyPanel(weld::Widget* pParent, SfxBindings* pBindings); virtual ~EffectPropertyPanel() override; - virtual void dispose() override; - static VclPtr Create(vcl::Window* pParent, - const css::uno::Reference& rxFrame, - SfxBindings* pBindings); + static std::unique_ptr 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& 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 -FontworkPropertyPanel::Create(vcl::Window* pParent, +std::unique_ptr +FontworkPropertyPanel::Create(weld::Widget* pParent, const css::uno::Reference& 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::Create(pParent, rxFrame); + return std::make_unique(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 Create(vcl::Window* pParent, - const css::uno::Reference& rxFrame); + static std::unique_ptr + Create(weld::Widget* pParent, const css::uno::Reference& rxFrame); // constructor/destructor - FontworkPropertyPanel(vcl::Window* pParent, + FontworkPropertyPanel(weld::Widget* pParent, const css::uno::Reference& rxFrame); ~FontworkPropertyPanel(); - void dispose() override; private: std::unique_ptr 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& 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), @@ -59,11 +58,6 @@ GraphicPropertyPanel::GraphicPropertyPanel( } GraphicPropertyPanel::~GraphicPropertyPanel() -{ - disposeOnce(); -} - -void GraphicPropertyPanel::dispose() { mxMtrBrightness.reset(); mxMtrContrast.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 GraphicPropertyPanel::Create ( - vcl::Window* pParent, - const css::uno::Reference& rxFrame, +std::unique_ptr 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::Create( - pParent, - rxFrame, - pBindings); + return std::make_unique(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 Create( - vcl::Window* pParent, - const css::uno::Reference& rxFrame, + static std::unique_ptr 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& 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 -InspectorTextPanel::Create(vcl::Window* pParent, - const css::uno::Reference& rxFrame) +std::unique_ptr 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::Create(pParent, rxFrame); + return std::make_unique(pParent); } -InspectorTextPanel::InspectorTextPanel(vcl::Window* pParent, - const css::uno::Reference& 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& 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& rxFrame, SfxBindings* pBindings) : LinePropertyPanelBase(pParent, rxFrame), @@ -50,11 +50,6 @@ LinePropertyPanel::LinePropertyPanel( } LinePropertyPanel::~LinePropertyPanel() -{ - disposeOnce(); -} - -void LinePropertyPanel::dispose() { maStyleControl.dispose(); maDashControl.dispose(); @@ -62,12 +57,10 @@ void LinePropertyPanel::dispose() maTransControl.dispose(); maEdgeStyle.dispose(); maCapStyle.dispose(); - - LinePropertyPanelBase::dispose(); } -VclPtr LinePropertyPanel::Create ( - vcl::Window* pParent, +std::unique_ptr LinePropertyPanel::Create ( + weld::Widget* pParent, const uno::Reference& rxFrame, SfxBindings* pBindings) { @@ -78,7 +71,7 @@ VclPtr LinePropertyPanel::Create ( if (pBindings == nullptr) throw lang::IllegalArgumentException("no SfxBindings given to LinePropertyPanel::Create", nullptr, 2); - return VclPtr::Create(pParent, rxFrame, pBindings); + return std::make_unique(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 Create( - vcl::Window* pParent, + static std::unique_ptr Create( + weld::Widget* pParent, const css::uno::Reference& rxFrame, SfxBindings* pBindings); @@ -66,7 +65,7 @@ public: // constructor/destructor LinePropertyPanel( - vcl::Window* pParent, + weld::Widget* pParent, const css::uno::Reference& 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& 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")), @@ -96,11 +96,6 @@ LinePropertyPanelBase::LinePropertyPanelBase( } LinePropertyPanelBase::~LinePropertyPanelBase() -{ - disposeOnce(); -} - -void LinePropertyPanelBase::dispose() { mxLineWidthPopup.reset(); mxFTWidth.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 -ListsPropertyPanel::Create(vcl::Window* pParent, +std::unique_ptr +ListsPropertyPanel::Create(weld::Widget* pParent, const css::uno::Reference& 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::Create(pParent, rxFrame); + return std::make_unique(pParent, rxFrame); } -ListsPropertyPanel::ListsPropertyPanel(vcl::Window* pParent, +ListsPropertyPanel::ListsPropertyPanel(weld::Widget* pParent, const css::uno::Reference& 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 Create(vcl::Window* pParent, - const css::uno::Reference& rxFrame); + static std::unique_ptr + Create(weld::Widget* pParent, const css::uno::Reference& rxFrame); - ListsPropertyPanel(vcl::Window* pParent, + ListsPropertyPanel(weld::Widget* pParent, const css::uno::Reference& 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& 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 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::Create( - pParent, - rxFrame, - pBindings); -} - -MediaPlaybackPanel::~MediaPlaybackPanel() -{ - disposeOnce(); + return std::make_unique(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 -#include #include #include #include #include #include +#include using namespace css; using namespace ::com::sun::star::uno; @@ -42,15 +42,12 @@ class MediaPlaybackPanel { public: MediaPlaybackPanel ( - vcl::Window* pParent, - const css::uno::Reference& rxFrame, + weld::Widget* pParent, SfxBindings* pBindings); - static VclPtr Create( - vcl::Window* pParent, - const css::uno::Reference& rxFrame, + static std::unique_ptr 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 ParaPropertyPanel::Create ( - vcl::Window* pParent, +std::unique_ptr ParaPropertyPanel::Create ( + weld::Widget* pParent, const css::uno::Reference& rxFrame, SfxBindings* pBindings, const css::uno::Reference& rxSidebar) @@ -57,11 +57,7 @@ VclPtr ParaPropertyPanel::Create ( if (pBindings == nullptr) throw lang::IllegalArgumentException("no SfxBindings given to ParaPropertyPanel::Create", nullptr, 2); - return VclPtr::Create( - pParent, - rxFrame, - pBindings, - rxSidebar); + return std::make_unique(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& rxFrame, SfxBindings* pBindings, const css::uno::Reference& 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() @@ -462,11 +455,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 Create ( - vcl::Window* pParent, + static std::unique_ptr Create ( + weld::Widget* pParent, const css::uno::Reference& rxFrame, SfxBindings* pBindings, const css::uno::Reference& 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& rxFrame, SfxBindings* pBindings, const css::uno::Reference& 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& rxFrame, SfxBindings* pBindings, const css::uno::Reference& 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")), @@ -122,11 +122,6 @@ PosSizePropertyPanel::PosSizePropertyPanel( } PosSizePropertyPanel::~PosSizePropertyPanel() -{ - disposeOnce(); -} - -void PosSizePropertyPanel::dispose() { mxFtPosX.reset(); mxMtrPosX.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 PosSizePropertyPanel::Create ( - vcl::Window* pParent, +std::unique_ptr PosSizePropertyPanel::Create ( + weld::Widget* pParent, const css::uno::Reference& rxFrame, SfxBindings* pBindings, const css::uno::Reference& rxSidebar) @@ -254,17 +246,7 @@ VclPtr PosSizePropertyPanel::Create ( if (pBindings == nullptr) throw lang::IllegalArgumentException("no SfxBindings given to PosSizePropertyPanel::Create", nullptr, 2); - return VclPtr::Create( - pParent, - rxFrame, - pBindings, - rxSidebar); -} - - -void PosSizePropertyPanel::DataChanged( - const DataChangedEvent& /*rEvent*/) -{ + return std::make_unique(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 Create( - vcl::Window* pParent, + static std::unique_ptr Create( + weld::Widget* pParent, const css::uno::Reference& rxFrame, SfxBindings* pBindings, const css::uno::Reference& 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& rxFrame, SfxBindings* pBindings, const css::uno::Reference& 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& 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), @@ -60,11 +59,6 @@ ShadowPropertyPanel::ShadowPropertyPanel( } ShadowPropertyPanel::~ShadowPropertyPanel() -{ - disposeOnce(); -} - -void ShadowPropertyPanel::dispose() { mxShowShadow.reset(); mxFTAngle.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 ShadowPropertyPanel::Create ( - vcl::Window* pParent, - const uno::Reference& rxFrame, +std::unique_ptr 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::Create(pParent, rxFrame, pBindings); + return std::make_unique(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 #include #include @@ -23,16 +22,11 @@ class ShadowPropertyPanel { public: virtual ~ShadowPropertyPanel() override; - virtual void dispose() override; - static VclPtr Create( - vcl::Window* pParent, - const css::uno::Reference& rxFrame, + static std::unique_ptr 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& 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 #include #include +#include namespace svx::sidebar { DefaultShapesPanel::DefaultShapesPanel ( - vcl::Window* pParent, + weld::Widget* pParent, const css::uno::Reference& 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 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::Create( - pParent, - rxFrame); -} - -DefaultShapesPanel::~DefaultShapesPanel() -{ - disposeOnce(); + return std::make_unique(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 StylesPropertyPanel::Create ( - vcl::Window* pParent, +std::unique_ptr StylesPropertyPanel::Create ( + weld::Widget* pParent, const css::uno::Reference& rxFrame) { if (pParent == nullptr) @@ -18,37 +18,24 @@ VclPtr StylesPropertyPanel::Create ( if ( ! rxFrame.is()) throw lang::IllegalArgumentException("no XFrame given to StylesPropertyPanel::Create", nullptr, 1); - return VclPtr::Create(pParent,rxFrame); + return std::make_unique(pParent, rxFrame); } -StylesPropertyPanel::StylesPropertyPanel ( vcl::Window* pParent, const css::uno::Reference& rxFrame ) - : PanelLayout(pParent, "SidebarStylesPanel", "svx/ui/sidebarstylespanel.ui", rxFrame) +StylesPropertyPanel::StylesPropertyPanel(weld::Widget* pParent, const css::uno::Reference& 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 Create ( - vcl::Window* pParent, + static std::unique_ptr Create ( + weld::Widget* pParent, const css::uno::Reference& rxFrame); - virtual void DataChanged( const DataChangedEvent& rEvent ) override; - - virtual void dispose() override; - StylesPropertyPanel( - vcl::Window* pParent, + weld::Widget* pParent, const css::uno::Reference& 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 TextPropertyPanel::Create ( - vcl::Window* pParent, +std::unique_ptr TextPropertyPanel::Create ( + weld::Widget* pParent, const css::uno::Reference& rxFrame) { if (pParent == nullptr) @@ -36,11 +36,11 @@ VclPtr TextPropertyPanel::Create ( if ( ! rxFrame.is()) throw lang::IllegalArgumentException("no XFrame given to TextPropertyPanel::Create", nullptr, 1); - return VclPtr::Create(pParent, rxFrame); + return std::make_unique(pParent, rxFrame); } -TextPropertyPanel::TextPropertyPanel ( vcl::Window* pParent, const css::uno::Reference& rxFrame ) - : PanelLayout(pParent, "SidebarTextPanel", "svx/ui/sidebartextpanel.ui", rxFrame) +TextPropertyPanel::TextPropertyPanel(weld::Widget* pParent, const css::uno::Reference& 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,16 +70,9 @@ 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(); @@ -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 Create ( - vcl::Window* pParent, + static std::unique_ptr Create ( + weld::Widget* pParent, const css::uno::Reference& rxFrame); virtual void HandleContextChange ( const vcl::EnumContext& rContext) override; TextPropertyPanel ( - vcl::Window* pParent, + weld::Widget* pParent, const css::uno::Reference& rxFrame); private: -- cgit v1.2.3