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 /sc | |
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 'sc')
-rw-r--r-- | sc/inc/cellsuno.hxx | 1 | ||||
-rw-r--r-- | sc/inc/editutil.hxx | 1 | ||||
-rw-r--r-- | sc/inc/funcdesc.hxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/funcdesc.cxx | 6 | ||||
-rw-r--r-- | sc/source/core/tool/editutil.cxx | 3 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLTableHeaderFooterContext.cxx | 2 | ||||
-rw-r--r-- | sc/source/filter/xml/XMLTableHeaderFooterContext.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/cctrl/tbzoomsliderctrl.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/inc/solveroptions.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/inc/tbzoomsliderctrl.hxx | 1 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/solveroptions.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/unoobj/cellsuno.cxx | 11 |
12 files changed, 14 insertions, 21 deletions
diff --git a/sc/inc/cellsuno.hxx b/sc/inc/cellsuno.hxx index 0fd9bbf991cf..5a937becad14 100644 --- a/sc/inc/cellsuno.hxx +++ b/sc/inc/cellsuno.hxx @@ -1170,7 +1170,6 @@ class ScUniqueCellFormatsObj final : public cppu::WeakImplHelper< { private: ScDocShell* pDocShell; - ScRange const aTotalRange; ScMyRangeLists aRangeLists; public: diff --git a/sc/inc/editutil.hxx b/sc/inc/editutil.hxx index 101d5740ca73..f1da9fe2784b 100644 --- a/sc/inc/editutil.hxx +++ b/sc/inc/editutil.hxx @@ -87,7 +87,6 @@ public: class ScEditAttrTester { - ScEditEngineDefaulter* pEngine; std::unique_ptr<SfxItemSet> pEditAttrs; bool bNeedsObject; bool bNeedsCellAttr; diff --git a/sc/inc/funcdesc.hxx b/sc/inc/funcdesc.hxx index 4e8d62777258..0150b5a95310 100644 --- a/sc/inc/funcdesc.hxx +++ b/sc/inc/funcdesc.hxx @@ -387,7 +387,6 @@ public: virtual sal_Unicode getSingleToken(const formula::IFunctionManager::EToken _eToken) const override; private: - ScFunctionList* pFuncList; /**< list of all calc functions */ std::unique_ptr<std::vector<const ScFuncDesc*>> aCatLists[MAX_FUNCCAT]; /**< array of all categories, 0 is the cumulative ('All') category */ mutable std::map< sal_uInt32, std::shared_ptr<ScFunctionCategory> > m_aCategories; /**< map of category pos to IFunctionCategory */ mutable std::vector<const ScFuncDesc*>::iterator pCurCatListIter; /**< position in current category */ diff --git a/sc/source/core/data/funcdesc.cxx b/sc/source/core/data/funcdesc.cxx index 2a3f4219eae1..6e94059461b9 100644 --- a/sc/source/core/data/funcdesc.cxx +++ b/sc/source/core/data/funcdesc.cxx @@ -1034,9 +1034,11 @@ sal_uInt32 ScFunctionCategory::getNumber() const } -ScFunctionMgr::ScFunctionMgr() : - pFuncList( ScGlobal::GetStarCalcFunctionList() ) +ScFunctionMgr::ScFunctionMgr() { + ScFunctionList* pFuncList /**< list of all calc functions */ + = ScGlobal::GetStarCalcFunctionList(); + OSL_ENSURE( pFuncList, "Functionlist not found." ); sal_uInt32 catCount[MAX_FUNCCAT] = {0}; diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index bf050cb93e35..a16d3b416474 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -371,8 +371,7 @@ tools::Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bF return tools::Rectangle( aStartPos, Size(nCellX-1,nCellY-1) ); } -ScEditAttrTester::ScEditAttrTester( ScEditEngineDefaulter* pEng ) : - pEngine( pEng ), +ScEditAttrTester::ScEditAttrTester( ScEditEngineDefaulter* pEngine ) : bNeedsObject( false ), bNeedsCellAttr( false ) { diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx index 40d98ce77a7f..d75b7c0cd1e8 100644 --- a/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx +++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.cxx @@ -45,11 +45,11 @@ XMLTableHeaderFooterContext::XMLTableHeaderFooterContext( SvXMLImport& rImport, bool bFooter, bool bLeft ) : SvXMLImportContext( rImport, nPrfx, rLName ), xPropSet( rPageStylePropSet ), - sOn( bFooter ? OUString(SC_UNO_PAGE_FTRON) : OUString(SC_UNO_PAGE_HDRON) ), bContainsLeft(false), bContainsRight(false), bContainsCenter(false) { + OUString sOn( bFooter ? OUString(SC_UNO_PAGE_FTRON) : OUString(SC_UNO_PAGE_HDRON) ); OUString sContent( bFooter ? OUString(SC_UNO_PAGE_RIGHTFTRCON) : OUString(SC_UNO_PAGE_RIGHTHDRCON) ); OUString sContentLeft( bFooter ? OUString(SC_UNO_PAGE_LEFTFTRCONT) : OUString(SC_UNO_PAGE_LEFTHDRCONT) ); OUString sShareContent( bFooter ? OUString(SC_UNO_PAGE_FTRSHARED) : OUString(SC_UNO_PAGE_HDRSHARED) ); diff --git a/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx b/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx index 209a6054e295..73f791d3ae44 100644 --- a/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx +++ b/sc/source/filter/xml/XMLTableHeaderFooterContext.hxx @@ -35,7 +35,6 @@ class XMLTableHeaderFooterContext: public SvXMLImportContext css::uno::Reference< css::beans::XPropertySet > xPropSet; css::uno::Reference< css::sheet::XHeaderFooterContent > xHeaderFooterContent; - const OUString sOn; OUString sCont; bool bContainsLeft; diff --git a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx index 7ff3c26035c6..f74b4789dacf 100644 --- a/sc/source/ui/cctrl/tbzoomsliderctrl.cxx +++ b/sc/source/ui/cctrl/tbzoomsliderctrl.cxx @@ -207,9 +207,9 @@ ScZoomSliderWnd::ScZoomSliderWnd( vcl::Window* pParent, sal_uInt16 nCurrentZoom ): InterimItemWindow(pParent, "modules/scalc/ui/zoombox.ui", "ZoomBox"), mxWidget(new ScZoomSlider(rDispatchProvider, nCurrentZoom)), - mxWeld(new weld::CustomWeld(*m_xBuilder, "zoom", *mxWidget)), - aLogicalSize( 115, 40 ) + mxWeld(new weld::CustomWeld(*m_xBuilder, "zoom", *mxWidget)) { + Size aLogicalSize( 115, 40 ); Size aSliderSize = LogicToPixel(aLogicalSize, MapMode(MapUnit::Map10thMM)); Size aPreferredSize(aSliderSize.Width() * nSliderWidth-1, aSliderSize.Height() + nSliderHeight); mxWidget->GetDrawingArea()->set_size_request(aPreferredSize.Width(), aPreferredSize.Height()); diff --git a/sc/source/ui/inc/solveroptions.hxx b/sc/source/ui/inc/solveroptions.hxx index 3ad4891d7a02..edce0a56b226 100644 --- a/sc/source/ui/inc/solveroptions.hxx +++ b/sc/source/ui/inc/solveroptions.hxx @@ -58,7 +58,6 @@ class ScSolverValueDialog; class ScSolverOptionsDialog : public weld::GenericDialogController { css::uno::Sequence<OUString> maImplNames; - css::uno::Sequence<OUString> maDescriptions; OUString maEngine; css::uno::Sequence<css::beans::PropertyValue> maProperties; diff --git a/sc/source/ui/inc/tbzoomsliderctrl.hxx b/sc/source/ui/inc/tbzoomsliderctrl.hxx index d12de0f29294..fbcc6c339bc4 100644 --- a/sc/source/ui/inc/tbzoomsliderctrl.hxx +++ b/sc/source/ui/inc/tbzoomsliderctrl.hxx @@ -67,7 +67,6 @@ class ScZoomSliderWnd final : public InterimItemWindow private: std::unique_ptr<ScZoomSlider> mxWidget; std::unique_ptr<weld::CustomWeld> mxWeld; - Size const aLogicalSize; public: ScZoomSliderWnd(vcl::Window* pParent, const css::uno::Reference<css::frame::XDispatchProvider>& rDispatchProvider, diff --git a/sc/source/ui/miscdlgs/solveroptions.cxx b/sc/source/ui/miscdlgs/solveroptions.cxx index b336460734b6..2136f4e14ad8 100644 --- a/sc/source/ui/miscdlgs/solveroptions.cxx +++ b/sc/source/ui/miscdlgs/solveroptions.cxx @@ -60,7 +60,6 @@ ScSolverOptionsDialog::ScSolverOptionsDialog(weld::Window* pParent, const uno::Sequence<beans::PropertyValue>& rProperties ) : GenericDialogController(pParent, "modules/scalc/ui/solveroptionsdialog.ui", "SolverOptionsDialog") , maImplNames(rImplNames) - , maDescriptions(rDescriptions) , maEngine(rEngine) , maProperties(rProperties) , m_xLbEngine(m_xBuilder->weld_combo_box("engine")) @@ -86,7 +85,7 @@ ScSolverOptionsDialog::ScSolverOptionsDialog(weld::Window* pParent, for (sal_Int32 nImpl=0; nImpl<nImplCount; ++nImpl) { OUString aImplName( maImplNames[nImpl] ); - OUString aDescription( maDescriptions[nImpl] ); // user-visible descriptions in list box + OUString aDescription( rDescriptions[nImpl] ); // user-visible descriptions in list box m_xLbEngine->append_text(aDescription); if ( aImplName == maEngine ) nSelect = nImpl; diff --git a/sc/source/ui/unoobj/cellsuno.cxx b/sc/source/ui/unoobj/cellsuno.cxx index f8fb4d6fc847..e1ffc7e9cf26 100644 --- a/sc/source/ui/unoobj/cellsuno.cxx +++ b/sc/source/ui/unoobj/cellsuno.cxx @@ -9229,20 +9229,19 @@ struct ScUniqueFormatsOrder } -ScUniqueCellFormatsObj::ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rRange) : +ScUniqueCellFormatsObj::ScUniqueCellFormatsObj(ScDocShell* pDocSh, const ScRange& rTotalRange) : pDocShell( pDocSh ), - aTotalRange( rRange ), aRangeLists() { pDocShell->GetDocument().AddUnoObject(*this); - OSL_ENSURE( aTotalRange.aStart.Tab() == aTotalRange.aEnd.Tab(), "different tables" ); + OSL_ENSURE( rTotalRange.aStart.Tab() == rTotalRange.aEnd.Tab(), "different tables" ); ScDocument& rDoc = pDocShell->GetDocument(); - SCTAB nTab = aTotalRange.aStart.Tab(); + SCTAB nTab = rTotalRange.aStart.Tab(); ScAttrRectIterator aIter( &rDoc, nTab, - aTotalRange.aStart.Col(), aTotalRange.aStart.Row(), - aTotalRange.aEnd.Col(), aTotalRange.aEnd.Row() ); + rTotalRange.aStart.Col(), rTotalRange.aStart.Row(), + rTotalRange.aEnd.Col(), rTotalRange.aEnd.Row() ); SCCOL nCol1, nCol2; SCROW nRow1, nRow2; |