vcl/inc/unx/cupsmgr.hxx | 4 +++- vcl/source/window/menubarwindow.cxx | 4 ++-- vcl/source/window/menubarwindow.hxx | 2 +- vcl/unx/generic/printer/cupsmgr.cxx | 12 ++++++------ 4 files changed, 12 insertions(+), 10 deletions(-)
New commits: commit c049ac6503c0f0f6bb7170b68c19ccb400c525f7 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Nov 7 13:48:52 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Nov 8 06:02:12 2023 +0100 loplugin:fieldcast in CUPSManager Change-Id: I97cf8b9dc0553b9771209bde3fd9ae0301012186 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159086 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/inc/unx/cupsmgr.hxx b/vcl/inc/unx/cupsmgr.hxx index 36d837d558b7..096efdea6e77 100644 --- a/vcl/inc/unx/cupsmgr.hxx +++ b/vcl/inc/unx/cupsmgr.hxx @@ -24,6 +24,8 @@ #include <osl/thread.h> #include <osl/mutex.hxx> +class cups_dest_s; + namespace psp { @@ -39,7 +41,7 @@ class CUPSManager final : public PrinterInfoManager { std::unordered_map< FILE*, OString, FPtrHash > m_aSpoolFiles; int m_nDests; - void* m_pDests; + cups_dest_s* m_pDests; bool m_bNewDests; std::unordered_map< OUString, int > m_aCUPSDestMap; diff --git a/vcl/unx/generic/printer/cupsmgr.cxx b/vcl/unx/generic/printer/cupsmgr.cxx index b81f630cd788..1fab7a172353 100644 --- a/vcl/unx/generic/printer/cupsmgr.cxx +++ b/vcl/unx/generic/printer/cupsmgr.cxx @@ -214,7 +214,7 @@ CUPSManager::~CUPSManager() } if (m_nDests && m_pDests) - cupsFreeDests( m_nDests, static_cast<cups_dest_t*>(m_pDests) ); + cupsFreeDests( m_nDests, m_pDests ); } void CUPSManager::runDestThread( void* pThis ) @@ -325,7 +325,7 @@ void CUPSManager::initialize() // introduced in dests with 1.2 // this is needed to check for %%IncludeFeature support // (#i65684#, #i65491#) - cups_dest_t* pDest = static_cast<cups_dest_t*>(m_pDests); + cups_dest_t* pDest = m_pDests; rtl_TextEncoding aEncoding = osl_getThreadTextEncoding(); int nPrinter = m_nDests; @@ -338,7 +338,7 @@ void CUPSManager::initialize() // with the same name as a CUPS printer, overwrite it while( nPrinter-- ) { - pDest = static_cast<cups_dest_t*>(m_pDests)+nPrinter; + pDest = m_pDests+nPrinter; OUString aPrinterName = OStringToOUString( pDest->name, aEncoding ); if( pDest->instance && *pDest->instance ) { @@ -470,7 +470,7 @@ const PPDParser* CUPSManager::createCUPSParser( const OUString& rPrinter ) m_aCUPSDestMap.find( aPrinter ); if( dest_it != m_aCUPSDestMap.end() ) { - cups_dest_t* pDest = static_cast<cups_dest_t*>(m_pDests) + dest_it->second; + cups_dest_t* pDest = m_pDests + dest_it->second; OString aPPDFile = threadedCupsGetPPD( pDest->name ); SAL_INFO("vcl.unx.print", "PPD for " << aPrinter << " is " << aPPDFile); @@ -890,7 +890,7 @@ bool CUPSManager::endSpool( const OUString& rPrintername, const OUString& rJobTi sJobName = OUStringToOString(rFaxNumber, aEnc); } - cups_dest_t* pDest = static_cast<cups_dest_t*>(m_pDests) + dest_it->second; + cups_dest_t* pDest = m_pDests + dest_it->second; nJobID = cupsPrintFile(pDest->name, it->second.getStr(), sJobName.getStr(), @@ -943,7 +943,7 @@ bool CUPSManager::checkPrintersChanged( bool bWait ) // there is no way to query CUPS whether the printer list has changed // so get the dest list anew if( m_nDests && m_pDests ) - cupsFreeDests( m_nDests, static_cast<cups_dest_t*>(m_pDests) ); + cupsFreeDests( m_nDests, m_pDests ); m_nDests = 0; m_pDests = nullptr; runDests(); commit 1f27c361531af17a13510deb86f0b8917d4d4276 Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Tue Nov 7 13:31:14 2023 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Wed Nov 8 06:02:00 2023 +0100 loplugin:fieldcast in MenuBarWindow Change-Id: I2b8d8ce3bd20166637d1051fd0d4407a9b2a76b9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159084 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/vcl/source/window/menubarwindow.cxx b/vcl/source/window/menubarwindow.cxx index 89e6b9246148..e77b600ea445 100644 --- a/vcl/source/window/menubarwindow.cxx +++ b/vcl/source/window/menubarwindow.cxx @@ -224,7 +224,7 @@ IMPL_LINK_NOARG(MenuBarWindow, CloseHdl, ToolBox *, void) // #i106052# call close hdl asynchronously to ease handler implementation // this avoids still being in the handler while the DecoToolBox already // gets destroyed - Application::PostUserEvent(static_cast<MenuBar*>(m_pMenu.get())->GetCloseButtonClickHdl()); + Application::PostUserEvent(m_pMenu->GetCloseButtonClickHdl()); } else { @@ -1010,7 +1010,7 @@ void MenuBarWindow::LayoutChanged() // depending on the native implementation or the displayable flag // the menubar windows is suppressed (ie, height=0) - if (!static_cast<MenuBar*>(m_pMenu.get())->IsDisplayable() || + if (!m_pMenu->IsDisplayable() || (m_pMenu->ImplGetSalMenu() && m_pMenu->ImplGetSalMenu()->VisibleMenuBar())) { nHeight = 0; diff --git a/vcl/source/window/menubarwindow.hxx b/vcl/source/window/menubarwindow.hxx index cc7963a1bed0..b5f026254ddd 100644 --- a/vcl/source/window/menubarwindow.hxx +++ b/vcl/source/window/menubarwindow.hxx @@ -68,7 +68,7 @@ private: Link<MenuBarButtonCallbackArg&,bool> m_aHighlightLink; }; - VclPtr<Menu> m_pMenu; + VclPtr<MenuBar> m_pMenu; VclPtr<PopupMenu> m_pActivePopup; VclPtr<PopupMenu> mpParentPopup; sal_uInt16 m_nHighlightedItem;