desktop/source/deployment/gui/dp_gui_dialog2.cxx | 6 +++--- desktop/source/deployment/gui/dp_gui_dialog2.hxx | 9 ++++----- desktop/source/deployment/gui/dp_gui_extlistbox.cxx | 16 ++++++---------- desktop/source/deployment/gui/dp_gui_extlistbox.hxx | 2 +- 4 files changed, 14 insertions(+), 19 deletions(-)
New commits: commit 5cd3c5a197265e47a709140b5db43de86b8535a9 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Oct 16 19:45:28 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Oct 18 00:48:53 2025 +0200 extension mgr: Simplify ExtensionBox::GetEntryRect It's only ever called with the index of the currently active rect, so rename it to ExtensionBox::GetActiveEntryRect and drop unused logic. Change-Id: I140f500df2eb179e71aebb573d6639bbd35c1d6b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192538 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 f4a81504be4c..b73e0a0c7b51 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -286,20 +286,16 @@ void ExtensionBox::CalcActiveHeight(const tools::Long nPos) m_nActiveHeight += 2; } -tools::Rectangle ExtensionBox::GetEntryRect(const tools::Long nPos) const +tools::Rectangle ExtensionBox::GetActiveEntryRect() const { + assert(m_nActive >= 0 && "No active entry"); + const ::osl::MutexGuard aGuard( m_entriesMutex ); Size aSize( GetOutputSizePixel() ); + aSize.setHeight(m_nActiveHeight); - if ( m_vEntries[ nPos ]->m_bActive ) - aSize.setHeight( m_nActiveHeight ); - else - aSize.setHeight( m_nStdHeight ); - - Point aPos( 0, -m_nTopIndex + nPos * m_nStdHeight ); - if (m_nActive >= 0 && nPos < m_nActive) - aPos.AdjustY(m_nActiveHeight - m_nStdHeight ); + Point aPos(0, -m_nTopIndex + m_nActive * m_nStdHeight); return tools::Rectangle( aPos, aSize ); } @@ -531,7 +527,7 @@ void ExtensionBox::RecalcAll() if (m_nActive >= 0) { - tools::Rectangle aEntryRect = GetEntryRect( m_nActive ); + tools::Rectangle aEntryRect = GetActiveEntryRect(); if ( m_bAdjustActive ) { diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx index 8362564e78af..7b37bfa3ea0b 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.hxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.hxx @@ -170,7 +170,7 @@ public: TEntry_Impl const & GetEntryData( tools::Long nPos ) { return m_vEntries[ nPos ]; } tools::Long GetEntryCount() const { return static_cast<tools::Long>(m_vEntries.size()); } - tools::Rectangle GetEntryRect( const tools::Long nPos ) const; + tools::Rectangle GetActiveEntryRect() const; bool HasActive() const { return m_nActive >= 0; } tools::Long PointToPos( const Point& rPos ); virtual void RecalcAll(); commit 933530587cbc79be9454c38b314de83684211aa0 Author: Michael Weghorn <[email protected]> AuthorDate: Thu Oct 16 18:51:58 2025 +0200 Commit: Michael Weghorn <[email protected]> CommitDate: Sat Oct 18 00:48:45 2025 +0200 extension mgr: Use more specific weld::Dialog ptr This will allow using the weld::Dialog API if needed. Change-Id: I83f1c5533cd86ef5c1c91b620f5c6164154427cf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/192523 Reviewed-by: Michael Weghorn <[email protected]> Tested-by: Jenkins diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index a8db569efcfa..a31e33d7822e 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -81,8 +81,8 @@ constexpr OUStringLiteral BUNDLED_PACKAGE_MANAGER = u"bundled"; // DialogHelper DialogHelper::DialogHelper(const uno::Reference< uno::XComponentContext > &xContext, - weld::Window* pWindow) - : m_pWindow(pWindow) + weld::Dialog* pDialog) + : m_pDialog(pDialog) , m_nEventID(nullptr) { m_xContext = xContext; @@ -108,7 +108,7 @@ bool DialogHelper::continueOnSharedExtension(const uno::Reference<deployment::XP const SolarMutexGuard guard; incBusy(); std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog( - m_pWindow, VclMessageType::Warning, VclButtonsType::OkCancel, DpResId(pResID))); + m_pDialog, VclMessageType::Warning, VclButtonsType::OkCancel, DpResId(pResID))); bHadWarning = true; bool bRet = RET_OK == xBox->run(); diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.hxx b/desktop/source/deployment/gui/dp_gui_dialog2.hxx index 109023d05bba..c4305cce351e 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.hxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.hxx @@ -46,17 +46,16 @@ class TheExtensionManager; class DialogHelper { css::uno::Reference< css::uno::XComponentContext > m_xContext; - weld::Window* m_pWindow; + weld::Dialog* m_pDialog; ImplSVEvent * m_nEventID; TopLevelWindowLocker m_aBusy; public: - DialogHelper(const css::uno::Reference< css::uno::XComponentContext > &, - weld::Window* pWindow); + DialogHelper(const css::uno::Reference<css::uno::XComponentContext>&, weld::Dialog* pDialog); virtual ~DialogHelper(); void openWebBrowser(const OUString& rURL, const OUString& rTitle); - weld::Window* getFrameWeld() const { return m_pWindow; } + weld::Window* getFrameWeld() const { return m_pDialog; } void PostUserEvent( const Link<void*,void>& rLink, void* pCaller ); void clearEventID() { m_nEventID = nullptr; } @@ -76,7 +75,7 @@ public: bool continueOnSharedExtension(const css::uno::Reference<css::deployment::XPackage>&, TranslateId pResID, bool& bHadWarning); - void incBusy() { m_aBusy.incBusy(m_pWindow); } + void incBusy() { m_aBusy.incBusy(m_pDialog); } void decBusy() { m_aBusy.decBusy(); } bool isBusy() const { return m_aBusy.isBusy(); } bool installExtensionWarn(std::u16string_view rExtensionURL);
