desktop/source/deployment/gui/dp_gui_dialog2.cxx | 2 desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx | 46 +++++----- desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.hxx | 4 desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 8 - desktop/source/deployment/gui/dp_gui_extlistbox.hxx | 5 - 5 files changed, 31 insertions(+), 34 deletions(-)
New commits: commit e2b34b89817646c1aebe3cde96dee0c68e5443ee Author: Michael Weghorn <[email protected]> AuthorDate: Thu Oct 16 18:36:27 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Oct 18 00:48:17 2025 +0200 extension mgr: Drop duplicate comment It was duplicated in commit c1080bf3e3afba17889d8438b35373d0bf768307 Date: Wed Jun 12 13:52:32 2019 +0100 drop intermediate IExtensionListBox class Change-Id: If5f6482b5d6239d66b3d025c3901dfaf24dad4ef Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192520 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx index a9d3d9f44d81..88e9423482e6 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx @@ -193,9 +193,6 @@ public: /** @return The count of the entries in the list box. */ sal_Int32 getItemCount() const; - /** @return The index of the first selected entry in the list box. - When nothing is selected, which is the case when getItemCount returns '0', - then this function returns ENTRY_NOTFOUND */ /** @return The index of the first selected entry in the list box. When nothing is selected, which is the case when getItemCount returns '0', then this function returns ENTRY_NOTFOUND */ commit 4a773798f5f3d64bd56c6944c81a4d6134a018b1 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Oct 16 16:14:11 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Oct 18 00:48:09 2025 +0200 extension mgr: Switch ExtensionBoxWithButtons::m_pParent to ref ... and rename accordingly. Change-Id: Idcbccc66f123e2f21b6506600769ef309c96c6be Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192519 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 93fe71e6ac69..3f900f471b00 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -220,7 +220,7 @@ ExtMgrDialog::ExtMgrDialog(weld::Window* pParent, TheExtensionManager& rManager) , m_aIdle( "ExtMgrDialog m_aIdle TimeOutHdl" ) , m_rManager(rManager) , m_xExtensionBox(new ExtensionBoxWithButtons( - this, m_xBuilder->weld_scrolled_window(u"scroll"_ustr, true), rManager)) + *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)) diff --git a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx index 586ae38cafe6..4c8c30732646 100644 --- a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx +++ b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.cxx @@ -38,12 +38,12 @@ using namespace ::com::sun::star; namespace dp_gui { -ExtensionBoxWithButtons::ExtensionBoxWithButtons(ExtMgrDialog* pParentDialog, +ExtensionBoxWithButtons::ExtensionBoxWithButtons(ExtMgrDialog& rParentDialog, std::unique_ptr<weld::ScrolledWindow> xScroll, TheExtensionManager& rManager) : ExtensionBox(std::move(xScroll), rManager) , m_bInterfaceLocked(false) - , m_pParent(pParentDialog) + , m_rParent(rParentDialog) { } @@ -57,9 +57,9 @@ void ExtensionBoxWithButtons::RecalcAll() } else { - m_pParent->enableOptionsButton( false ); - m_pParent->enableRemoveButton( false ); - m_pParent->enableEnableButton( false ); + m_rParent.enableOptionsButton(false); + m_rParent.enableRemoveButton(false); + m_rParent.enableEnableButton(false); } ExtensionBox::RecalcAll(); @@ -83,11 +83,11 @@ void ExtensionBoxWithButtons::SetButtonStatus(const TEntry_Impl& rEntry) if ((rEntry->m_eState == PackageState::REGISTERED) || (rEntry->m_eState == PackageState::NOT_AVAILABLE)) { - m_pParent->enableButtontoEnable( false ); + m_rParent.enableButtontoEnable(false); } else { - m_pParent->enableButtontoEnable( true ); + m_rParent.enableButtontoEnable(true); bShowOptionBtn = false; } @@ -95,32 +95,32 @@ void ExtensionBoxWithButtons::SetButtonStatus(const TEntry_Impl& rEntry) || rEntry->m_bMissingDeps) && !rEntry->m_bMissingLic) { - m_pParent->enableEnableButton( false ); + m_rParent.enableEnableButton(false); } else { - m_pParent->enableEnableButton( !rEntry->m_bLocked ); + m_rParent.enableEnableButton(!rEntry->m_bLocked); rEntry->m_bHasButtons = true; } if ( rEntry->m_bHasOptions && bShowOptionBtn ) { - m_pParent->enableOptionsButton( true ); + m_rParent.enableOptionsButton(true); rEntry->m_bHasButtons = true; } else { - m_pParent->enableOptionsButton( false ); + m_rParent.enableOptionsButton(false); } if ( rEntry->m_bUser || rEntry->m_bShared ) { - m_pParent->enableRemoveButton( !rEntry->m_bLocked ); + m_rParent.enableRemoveButton(!rEntry->m_bLocked); rEntry->m_bHasButtons = true; } else { - m_pParent->enableRemoveButton( false ); + m_rParent.enableRemoveButton(false); } } @@ -134,19 +134,19 @@ bool ExtensionBoxWithButtons::Command(const CommandEvent& rCEvt) OUString sCommand = ShowPopupMenu(aMousePos, nPos); if (sCommand == "CMD_ENABLE") - m_pParent->enablePackage( GetEntryData( nPos )->m_xPackage, true ); + m_rParent.enablePackage(GetEntryData(nPos)->m_xPackage, true); else if (sCommand == "CMD_DISABLE") - m_pParent->enablePackage( GetEntryData( nPos )->m_xPackage, false ); + m_rParent.enablePackage(GetEntryData(nPos)->m_xPackage, false); else if (sCommand == "CMD_UPDATE") - m_pParent->updatePackage( GetEntryData( nPos )->m_xPackage ); + m_rParent.updatePackage(GetEntryData(nPos)->m_xPackage); else if (sCommand == "CMD_REMOVE") - m_pParent->removePackage( GetEntryData( nPos )->m_xPackage ); + m_rParent.removePackage(GetEntryData(nPos)->m_xPackage); else if (sCommand == "CMD_SHOW_LICENSE") { - m_pParent->incBusy(); - ShowLicenseDialog aLicenseDlg(m_pParent->getDialog(), GetEntryData(nPos)->m_xPackage); + m_rParent.incBusy(); + ShowLicenseDialog aLicenseDlg(m_rParent.getDialog(), GetEntryData(nPos)->m_xPackage); aLicenseDlg.run(); - m_pParent->decBusy(); + m_rParent.decBusy(); } return true; @@ -204,9 +204,9 @@ void ExtensionBoxWithButtons::enableButtons(bool bEnable) } else { - m_pParent->enableEnableButton( false ); - m_pParent->enableOptionsButton( false ); - m_pParent->enableRemoveButton( false ); + m_rParent.enableEnableButton(false); + m_rParent.enableOptionsButton(false); + m_rParent.enableRemoveButton(false); } } diff --git a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.hxx b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.hxx index 71dd02105f22..a647013a9df8 100644 --- a/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.hxx +++ b/desktop/source/deployment/gui/dp_gui_extensionboxwithbuttons.hxx @@ -32,13 +32,13 @@ class ExtensionBoxWithButtons : public ExtensionBox { bool m_bInterfaceLocked; - ExtMgrDialog* m_pParent; + ExtMgrDialog& m_rParent; void SetButtonStatus(const TEntry_Impl& rEntry); OUString ShowPopupMenu(const Point& rPos, const tools::Long nPos); public: - explicit ExtensionBoxWithButtons(ExtMgrDialog* pParentDialog, + explicit ExtensionBoxWithButtons(ExtMgrDialog& rParentDialog, std::unique_ptr<weld::ScrolledWindow> xScroll, TheExtensionManager& rManager); commit aae1b29684d8ab9d353eff61ed2beefe30bf1f90 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Oct 16 15:43:00 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Oct 18 00:48:01 2025 +0200 extension mgr: Switch ExtensionBox::m_rManager to ref ... and rename accordingly. This makes more obvious that this is always non-null. Change-Id: Ie158ea4f29ed9d43e455d7187a54ffbcd4c52113 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192516 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 0e5a640a5b7f..33849b7cc776 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -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(&rManager) + , m_rManager(rManager) , m_xScrollBar(std::move(xScroll)) { } @@ -875,7 +875,7 @@ void ExtensionBox::addEntry(const uno::Reference<deployment::XPackage>& xPackage bool bLicenseMissing) { PackageState eState = TheExtensionManager::getPackageState( xPackage ); - bool bLocked = m_pManager->isReadOnly( xPackage ); + bool bLocked = m_rManager.isReadOnly(xPackage); TEntry_Impl pEntry = std::make_shared<Entry_Impl>( xPackage, eState, bLocked ); @@ -904,7 +904,7 @@ void ExtensionBox::addEntry(const uno::Reference<deployment::XPackage>& xPackage } } - pEntry->m_bHasOptions = m_pManager->supportsOptions(xPackage); + pEntry->m_bHasOptions = m_rManager.supportsOptions(xPackage); pEntry->m_bUser = (xPackage->getRepositoryName() == USER_PACKAGE_MANAGER); pEntry->m_bShared = (xPackage->getRepositoryName() == SHARED_PACKAGE_MANAGER); pEntry->m_bNew = m_bInCheckMode; @@ -931,7 +931,7 @@ void ExtensionBox::updateEntry(const uno::Reference<deployment::XPackage>& xPack if ( entry->m_xPackage == xPackage ) { PackageState eState = TheExtensionManager::getPackageState( xPackage ); - entry->m_bHasOptions = m_pManager->supportsOptions( xPackage ); + entry->m_bHasOptions = m_rManager.supportsOptions(xPackage); entry->m_eState = eState; entry->m_sTitle = xPackage->getDisplayName(); entry->m_sVersion = xPackage->getVersion(); diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx index baded16ee319..a9d3d9f44d81 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx @@ -119,7 +119,7 @@ class ExtensionBox : public weld::CustomWidgetController rtl::Reference<ExtensionRemovedListener> m_xRemoveListener; - TheExtensionManager *m_pManager; + TheExtensionManager& m_rManager; //This mutex is used for synchronizing access to m_vEntries. //Currently it is used to synchronize adding, removing entries and //functions like getItemName, getItemDescription, etc. to prevent
