diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-06 14:40:40 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-03-09 11:33:43 +0100 |
commit | abe39f7781f59b96c5a8d3dd5b41c60fdf04ad84 (patch) | |
tree | 0f72d1968e5f25e3f280688a414398e3f4a7cce8 /vcl | |
parent | bdb1c72198f60fdd91460e26282134d43bc0e2df (diff) |
improve loplugin:unusedfields
noticed something that wasn't being picked up, wrote some tests,
and found an unhandled case in Plugin::getParentFunctionDecl
Change-Id: I52b4ea273be6614e197392dfc4d6053bbc1704de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90141
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/inc/bitmap/Octree.hxx | 1 | ||||
-rw-r--r-- | vcl/inc/unx/saldisp.hxx | 1 | ||||
-rw-r--r-- | vcl/source/bitmap/BitmapFilterStackBlur.cxx | 8 | ||||
-rw-r--r-- | vcl/source/bitmap/Octree.cxx | 18 | ||||
-rw-r--r-- | vcl/source/gdi/textlayout.cxx | 7 | ||||
-rw-r--r-- | vcl/unx/generic/app/saldisp.cxx | 14 | ||||
-rw-r--r-- | vcl/unx/gtk3/gtk3gtkinst.cxx | 11 |
7 files changed, 26 insertions, 34 deletions
diff --git a/vcl/inc/bitmap/Octree.hxx b/vcl/inc/bitmap/Octree.hxx index 59246ae5053d..f1d6e2a583c0 100644 --- a/vcl/inc/bitmap/Octree.hxx +++ b/vcl/inc/bitmap/Octree.hxx @@ -52,7 +52,6 @@ private: std::unique_ptr<OctreeNode> pTree; std::vector<OctreeNode*> mpReduce; BitmapColor const* mpColor; - const BitmapReadAccess* mpAccess; sal_uInt16 mnPalIndex; public: diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx index 20735b83d462..d779916a77c4 100644 --- a/vcl/inc/unx/saldisp.hxx +++ b/vcl/inc/unx/saldisp.hxx @@ -122,7 +122,6 @@ class SalColormap Pixel m_nWhitePixel; Pixel m_nBlackPixel; Pixel m_nUsed; // Pseudocolor - SalX11Screen m_nXScreen; void GetPalette(); void GetLookupTable(); diff --git a/vcl/source/bitmap/BitmapFilterStackBlur.cxx b/vcl/source/bitmap/BitmapFilterStackBlur.cxx index 28a0cbc80ffe..9629cc079c00 100644 --- a/vcl/source/bitmap/BitmapFilterStackBlur.cxx +++ b/vcl/source/bitmap/BitmapFilterStackBlur.cxx @@ -50,7 +50,6 @@ class BlurSharedData public: long mnRadius; long mnComponentWidth; - long mnColorChannels; long mnDiv; std::vector<sal_uInt8> maStackBuffer; std::vector<long> maPositionTable; @@ -63,14 +62,13 @@ public: BlurSharedData(long aRadius, long nComponentWidth, long nColorChannels) : mnRadius(aRadius) , mnComponentWidth(nComponentWidth) - , mnColorChannels(nColorChannels) , mnDiv(aRadius + aRadius + 1) , maStackBuffer(mnDiv * mnComponentWidth) , maPositionTable(mnDiv) , maWeightTable(mnDiv) - , mnSumVector(mnColorChannels) - , mnInSumVector(mnColorChannels) - , mnOutSumVector(mnColorChannels) + , mnSumVector(nColorChannels) + , mnInSumVector(nColorChannels) + , mnOutSumVector(nColorChannels) { } diff --git a/vcl/source/bitmap/Octree.cxx b/vcl/source/bitmap/Octree.cxx index fce531d4966b..44f911ef0c92 100644 --- a/vcl/source/bitmap/Octree.cxx +++ b/vcl/source/bitmap/Octree.cxx @@ -35,24 +35,24 @@ Octree::Octree(const BitmapReadAccess& rReadAcc, sal_uLong nColors) , mnLevel(0) , mpReduce(OCTREE_BITS + 1, nullptr) , mpColor(nullptr) - , mpAccess(&rReadAcc) , mnPalIndex(0) { + const BitmapReadAccess* pAccess = &rReadAcc; sal_uLong nMax(nColors); - if (!!*mpAccess) + if (!!*pAccess) { - const long nWidth = mpAccess->Width(); - const long nHeight = mpAccess->Height(); + const long nWidth = pAccess->Width(); + const long nHeight = pAccess->Height(); - if (mpAccess->HasPalette()) + if (pAccess->HasPalette()) { for (long nY = 0; nY < nHeight; nY++) { - Scanline pScanline = mpAccess->GetScanline(nY); + Scanline pScanline = pAccess->GetScanline(nY); for (long nX = 0; nX < nWidth; nX++) { - mpColor = &mpAccess->GetPaletteColor(mpAccess->GetIndexFromData(pScanline, nX)); + mpColor = &pAccess->GetPaletteColor(pAccess->GetIndexFromData(pScanline, nX)); mnLevel = 0; add(pTree); @@ -69,10 +69,10 @@ Octree::Octree(const BitmapReadAccess& rReadAcc, sal_uLong nColors) for (long nY = 0; nY < nHeight; nY++) { - Scanline pScanline = mpAccess->GetScanline(nY); + Scanline pScanline = pAccess->GetScanline(nY); for (long nX = 0; nX < nWidth; nX++) { - aColor = mpAccess->GetPixelFromData(pScanline, nX); + aColor = pAccess->GetPixelFromData(pScanline, nX); mnLevel = 0; add(pTree); diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index bcd7c8cb204e..1efe1e617432 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -90,7 +90,6 @@ namespace vcl OutputDevice& m_rTargetDevice; OutputDevice& m_rReferenceDevice; - Font const m_aUnzoomedPointFont; const bool m_bRTLEnabled; tools::Rectangle m_aCompleteTextRect; @@ -100,9 +99,9 @@ namespace vcl OutputDevice& _rReferenceDevice ) :m_rTargetDevice( _rTargetDevice ) ,m_rReferenceDevice( _rReferenceDevice ) - ,m_aUnzoomedPointFont( _rControl.GetUnzoomedControlPointFont() ) ,m_bRTLEnabled( _rControl.IsRTLEnabled() ) { + Font const aUnzoomedPointFont( _rControl.GetUnzoomedControlPointFont() ); const Fraction& aZoom( _rControl.GetZoom() ); m_rTargetDevice.Push( PushFlags::MAPMODE | PushFlags::FONT | PushFlags::TEXTLAYOUTMODE ); @@ -129,13 +128,13 @@ namespace vcl m_rTargetDevice.SetMapMode( aTargetMapMode ); // now that the Zoom is part of the map mode, reset the target device's font to the "unzoomed" version - Font aDrawFont( m_aUnzoomedPointFont ); + Font aDrawFont( aUnzoomedPointFont ); aDrawFont.SetFontSize( OutputDevice::LogicToLogic(aDrawFont.GetFontSize(), MapMode(MapUnit::MapPoint), MapMode(eTargetMapUnit)) ); _rTargetDevice.SetFont( aDrawFont ); // transfer font to the reference device m_rReferenceDevice.Push( PushFlags::FONT | PushFlags::TEXTLAYOUTMODE ); - Font aRefFont( m_aUnzoomedPointFont ); + Font aRefFont( aUnzoomedPointFont ); aRefFont.SetFontSize( OutputDevice::LogicToLogic( aRefFont.GetFontSize(), MapMode(MapUnit::MapPoint), m_rReferenceDevice.GetMapMode()) ); m_rReferenceDevice.SetFont( aRefFont ); diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx index 4ffea9b58364..99d0652df7ff 100644 --- a/vcl/unx/generic/app/saldisp.cxx +++ b/vcl/unx/generic/app/saldisp.cxx @@ -2518,10 +2518,9 @@ Pixel SalVisual::GetTCPixel( Color nColor ) const SalColormap::SalColormap( const SalDisplay *pDisplay, Colormap hColormap, SalX11Screen nXScreen ) : m_pDisplay( pDisplay ), - m_hColormap( hColormap ), - m_nXScreen( nXScreen ) + m_hColormap( hColormap ) { - m_aVisual = m_pDisplay->GetVisual( m_nXScreen ); + m_aVisual = m_pDisplay->GetVisual( nXScreen ); XColor aColor; @@ -2587,8 +2586,7 @@ SalColormap::SalColormap() m_hColormap( None ), m_nWhitePixel( 1 ), m_nBlackPixel( 0 ), - m_nUsed( 2 ), - m_nXScreen( m_pDisplay != nullptr ? m_pDisplay->GetDefaultXScreen() : SalX11Screen( 0 ) ) + m_nUsed( 2 ) { m_aPalette = std::vector<Color>(m_nUsed); @@ -2602,10 +2600,10 @@ SalColormap::SalColormap( sal_uInt16 nDepth ) m_hColormap( None ), m_nWhitePixel( (1 << nDepth) - 1 ), m_nBlackPixel( 0x00000000 ), - m_nUsed( 1 << nDepth ), - m_nXScreen( vcl_sal::getSalDisplay(GetGenericUnixSalData())->GetDefaultXScreen() ) + m_nUsed( 1 << nDepth ) { - const SalVisual *pVisual = &m_pDisplay->GetVisual( m_nXScreen ); + SalX11Screen nXScreen( vcl_sal::getSalDisplay(GetGenericUnixSalData())->GetDefaultXScreen() ); + const SalVisual *pVisual = &m_pDisplay->GetVisual( nXScreen ); if( pVisual->GetClass() == TrueColor && pVisual->GetDepth() == nDepth ) m_aVisual = *pVisual; diff --git a/vcl/unx/gtk3/gtk3gtkinst.cxx b/vcl/unx/gtk3/gtk3gtkinst.cxx index 202b5f4c1c10..35e9f8d53742 100644 --- a/vcl/unx/gtk3/gtk3gtkinst.cxx +++ b/vcl/unx/gtk3/gtk3gtkinst.cxx @@ -13385,7 +13385,6 @@ class GtkInstanceBuilder : public weld::Builder { private: ResHookProc m_pStringReplace; - OUString m_sHelpRoot; OString m_aUtf8HelpRoot; OUString m_aIconTheme; OUString m_aUILang; @@ -13582,19 +13581,19 @@ public: GtkInstanceBuilder(GtkWidget* pParent, const OUString& rUIRoot, const OUString& rUIFile, SystemChildWindow* pInterimGlue) : weld::Builder(rUIFile) , m_pStringReplace(Translate::GetReadStringHook()) - , m_sHelpRoot(rUIFile) , m_pParentWidget(pParent) , m_nNotifySignalId(0) , m_xInterimGlue(pInterimGlue) { + OUString sHelpRoot(rUIFile); ensure_intercept_drawing_area_accessibility(); ensure_disable_ctrl_page_up_down_bindings(); - sal_Int32 nIdx = m_sHelpRoot.lastIndexOf('.'); + sal_Int32 nIdx = sHelpRoot.lastIndexOf('.'); if (nIdx != -1) - m_sHelpRoot = m_sHelpRoot.copy(0, nIdx); - m_sHelpRoot += OUString('/'); - m_aUtf8HelpRoot = OUStringToOString(m_sHelpRoot, RTL_TEXTENCODING_UTF8); + sHelpRoot = sHelpRoot.copy(0, nIdx); + sHelpRoot += OUString('/'); + m_aUtf8HelpRoot = OUStringToOString(sHelpRoot, RTL_TEXTENCODING_UTF8); m_aIconTheme = Application::GetSettings().GetStyleSettings().DetermineIconTheme(); m_aUILang = Application::GetSettings().GetUILanguageTag().getBcp47(); |