desktop/source/deployment/gui/dp_gui_dialog2.cxx | 11 ++----- desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx | 15 +++------- desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.hxx | 6 ++-- desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 6 ++-- desktop/source/deployment/gui/dp_gui_extlistbox.hxx | 5 +-- 5 files changed, 17 insertions(+), 26 deletions(-)
New commits: commit d7fcacc3e2208437f0df92ddd61cde1b5a35a93a Author: Michael Weghorn <[email protected]> AuthorDate: Thu Oct 16 15:39:56 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Oct 18 00:47:52 2025 +0200 extension mgr: Pass mgr to ExtensionBox ctor Instead of having a ExtensionBox::setExtensionManager that needs to be called separately after the ctor, pass the TheExtensionManager as a param in the ctor dircectly. Change-Id: Icbb2d6b434661ce42691c1a5750f6a856ce1eb33 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192515 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 50d034f71bbf..93fe71e6ac69 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -797,7 +797,8 @@ UpdateRequiredDialog::UpdateRequiredDialog(weld::Window* pParent, TheExtensionMa , m_nProgress(0) , m_aIdle( "UpdateRequiredDialog m_aIdle TimeOutHdl" ) , m_rManager(rManager) - , m_xExtensionBox(new ExtensionBox(m_xBuilder->weld_scrolled_window(u"scroll"_ustr, true))) + , m_xExtensionBox( + new ExtensionBox(m_xBuilder->weld_scrolled_window(u"scroll"_ustr, true), rManager)) , m_xExtensionBoxWnd(new weld::CustomWeld(*m_xBuilder, u"extensions"_ustr, *m_xExtensionBox)) , m_xUpdateNeeded(m_xBuilder->weld_label(u"updatelabel"_ustr)) , m_xUpdateBtn(m_xBuilder->weld_button(u"ok"_ustr)) @@ -806,8 +807,6 @@ UpdateRequiredDialog::UpdateRequiredDialog(weld::Window* pParent, TheExtensionMa , m_xProgressText(m_xBuilder->weld_label(u"progresslabel"_ustr)) , m_xProgressBar(m_xBuilder->weld_progress_bar(u"progress"_ustr)) { - m_xExtensionBox->setExtensionManager(&rManager); - m_xUpdateBtn->connect_clicked( LINK( this, UpdateRequiredDialog, HandleUpdateBtn ) ); m_xCloseBtn->connect_clicked( LINK( this, UpdateRequiredDialog, HandleCloseBtn ) ); m_xCancelBtn->connect_clicked( LINK( this, UpdateRequiredDialog, HandleCancelBtn ) ); diff --git a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx index 9f59a90ce7ea..586ae38cafe6 100644 --- a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx @@ -41,11 +41,10 @@ namespace dp_gui { ExtensionBoxWithButtons::ExtensionBoxWithButtons(ExtMgrDialog* pParentDialog, std::unique_ptr<weld::ScrolledWindow> xScroll, TheExtensionManager& rManager) - : ExtensionBox(std::move(xScroll)) + : ExtensionBox(std::move(xScroll), rManager) , m_bInterfaceLocked(false) , m_pParent(pParentDialog) { - setExtensionManager(&rManager); } void ExtensionBoxWithButtons::RecalcAll() diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 05cf1f8b94bc..0e5a640a5b7f 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -177,8 +177,8 @@ ExtensionRemovedListener::~ExtensionRemovedListener() { } - -ExtensionBox::ExtensionBox(std::unique_ptr<weld::ScrolledWindow> xScroll) +ExtensionBox::ExtensionBox(std::unique_ptr<weld::ScrolledWindow> xScroll, + TheExtensionManager& rManager) : m_bHasScrollBar( false ) , m_bNeedsRecalc( true ) , m_bInCheckMode( false ) @@ -192,7 +192,7 @@ ExtensionBox::ExtensionBox(std::unique_ptr<weld::ScrolledWindow> xScroll) , m_aLockedImage(StockImage::Yes, RID_BMP_LOCKED) , m_aWarningImage(StockImage::Yes, RID_BMP_WARNING) , m_aDefaultImage(StockImage::Yes, RID_BMP_EXTENSION) - , m_pManager( nullptr ) + , m_pManager(&rManager) , m_xScrollBar(std::move(xScroll)) { } diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx index 4f10acf8231e..baded16ee319 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx @@ -155,7 +155,8 @@ class ExtensionBox : public weld::CustomWidgetController void Init(); public: - explicit ExtensionBox(std::unique_ptr<weld::ScrolledWindow> xScroll); + explicit ExtensionBox(std::unique_ptr<weld::ScrolledWindow> xScroll, + TheExtensionManager& rManager); virtual ~ExtensionBox() override; virtual bool MouseButtonDown( const MouseEvent& rMEvt ) override; @@ -185,8 +186,6 @@ public: void prepareChecking(); void checkEntries(); - void setExtensionManager(TheExtensionManager* pManager) { m_pManager = pManager; } - //These functions are used for automatic testing public: enum { ENTRY_NOTFOUND = -1 }; commit f45033bddd94f3e8f35a19e8dc0071053b368e16 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Oct 16 15:34:22 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Oct 18 00:47:43 2025 +0200 extension mgr: Move more init logic to ctor Add relevant params to the ExtensionBoxWithButtons ctor instead of having a separate method ExtensionBoxWithButtons::InitFromDialog that needs to be called separately in order to finish initialization. Change-Id: I8a9c3b2ffdae55377f7025df812e6894fb186a3d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192514 Tested-by: Jenkins Reviewed-by: Michael Weghorn <[email protected]> diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 25ca0b42a9f2..50d034f71bbf 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -219,8 +219,8 @@ ExtMgrDialog::ExtMgrDialog(weld::Window* pParent, TheExtensionManager& rManager) , m_nProgress(0) , m_aIdle( "ExtMgrDialog m_aIdle TimeOutHdl" ) , m_rManager(rManager) - , m_xExtensionBox( - new ExtensionBoxWithButtons(m_xBuilder->weld_scrolled_window(u"scroll"_ustr, true))) + , m_xExtensionBox(new ExtensionBoxWithButtons( + this, m_xBuilder->weld_scrolled_window(u"scroll"_ustr, true), rManager)) , m_xExtensionBoxWnd(new weld::CustomWeld(*m_xBuilder, u"extensions"_ustr, *m_xExtensionBox)) , m_xOptionsBtn(m_xBuilder->weld_button(u"optionsbtn"_ustr)) , m_xAddBtn(m_xBuilder->weld_button(u"addbtn"_ustr)) @@ -237,8 +237,6 @@ ExtMgrDialog::ExtMgrDialog(weld::Window* pParent, TheExtensionManager& rManager) , m_xCancelBtn(m_xBuilder->weld_button(u"cancel"_ustr)) , m_xSearchEntry(m_xBuilder->weld_entry(u"search"_ustr)) { - m_xExtensionBox->InitFromDialog(this); - m_xEnableBtn->set_help_id(HID_EXTENSION_MANAGER_LISTBOX_ENABLE); m_xOptionsBtn->connect_clicked( LINK( this, ExtMgrDialog, HandleOptionsBtn ) ); diff --git a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx index 5c41558d4628..9f59a90ce7ea 100644 --- a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx @@ -38,18 +38,14 @@ using namespace ::com::sun::star; namespace dp_gui { -ExtensionBoxWithButtons::ExtensionBoxWithButtons(std::unique_ptr<weld::ScrolledWindow> xScroll) +ExtensionBoxWithButtons::ExtensionBoxWithButtons(ExtMgrDialog* pParentDialog, + std::unique_ptr<weld::ScrolledWindow> xScroll, + TheExtensionManager& rManager) : ExtensionBox(std::move(xScroll)) , m_bInterfaceLocked(false) - , m_pParent(nullptr) + , m_pParent(pParentDialog) { -} - -void ExtensionBoxWithButtons::InitFromDialog(ExtMgrDialog* pParentDialog) -{ - setExtensionManager(&pParentDialog->getExtensionManager()); - - m_pParent = pParentDialog; + setExtensionManager(&rManager); } void ExtensionBoxWithButtons::RecalcAll() diff --git a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.hxx b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.hxx index f83aaed4b801..71dd02105f22 100644 --- a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.hxx +++ b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.hxx @@ -38,9 +38,9 @@ class ExtensionBoxWithButtons : public ExtensionBox OUString ShowPopupMenu(const Point& rPos, const tools::Long nPos); public: - explicit ExtensionBoxWithButtons(std::unique_ptr<weld::ScrolledWindow> xScroll); - - void InitFromDialog(ExtMgrDialog* pParentDialog); + explicit ExtensionBoxWithButtons(ExtMgrDialog* pParentDialog, + std::unique_ptr<weld::ScrolledWindow> xScroll, + TheExtensionManager& rManager); virtual bool MouseButtonDown(const MouseEvent& rMEvt) override; virtual bool Command(const CommandEvent& rCEvt) override;
