diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-11 11:46:10 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-04-12 10:10:46 +0200 |
commit | 4b57c28302def4dd56b2dc8ffb73f21b688a6534 (patch) | |
tree | 7e6ecddbcea60ec39e0525c4902783f6a97dd8ee | |
parent | 9e4d84daf279a63052cfd0aeebd2d67dfaf07c67 (diff) |
tag ScAddress and friends with SAL_WARN_UNUSED
Change-Id: I4ed6b1e8b4225a87fbcb863a47c84e30228b5352
Reviewed-on: https://gerrit.libreoffice.org/36407
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | sc/inc/address.hxx | 8 | ||||
-rw-r--r-- | sc/qa/unit/ucalc_formula.cxx | 4 | ||||
-rw-r--r-- | sc/source/core/data/column2.cxx | 10 | ||||
-rw-r--r-- | sc/source/core/data/conditio.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/data/documen5.cxx | 1 | ||||
-rw-r--r-- | sc/source/core/tool/address.cxx | 1 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/acredlin.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/miscdlgs/highred.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/namedlg/namedlg.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/vba/vbanames.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/view/printfun.cxx | 1 |
11 files changed, 8 insertions, 27 deletions
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index 8a7512678bd2..f2ac3595b6c7 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -180,7 +180,7 @@ inline void applyStartToEndFlags(ScRefFlags &target) } // ScAddress -class ScAddress +class SAL_WARN_UNUSED ScAddress { private: SCROW nRow; @@ -459,7 +459,7 @@ inline bool ValidAddress( const ScAddress& rAddress ) } // ScRange -class ScRange +class SAL_WARN_UNUSED ScRange { public: ScAddress aStart; @@ -720,7 +720,7 @@ inline bool ValidRange( const ScRange& rRange ) } // ScRangePair -class ScRangePair +class SAL_WARN_UNUSED ScRangePair { private: ScRange aRange[2]; @@ -756,7 +756,7 @@ inline ScRangePair& ScRangePair::operator= ( const ScRangePair& rRange ) } // ScRefAddress -class ScRefAddress +class SAL_WARN_UNUSED ScRefAddress { private: ScAddress aAdr; diff --git a/sc/qa/unit/ucalc_formula.cxx b/sc/qa/unit/ucalc_formula.cxx index 5336107f0bb2..045e6976b9d8 100644 --- a/sc/qa/unit/ucalc_formula.cxx +++ b/sc/qa/unit/ucalc_formula.cxx @@ -5108,10 +5108,6 @@ void Test::testFuncINDIRECT2() CPPUNIT_ASSERT_MESSAGE ("failed to insert sheet", m_pDoc->InsertTab (2, "baz")); - ScAddress aStart; - ScAddress aEnd; - ScAddress aRef; - m_pDoc->SetValue(0,0,0, 10.0); m_pDoc->SetValue(0,1,0, 10.0); m_pDoc->SetValue(0,2,0, 10.0); diff --git a/sc/source/core/data/column2.cxx b/sc/source/core/data/column2.cxx index 58206e30dda5..c73dbdbd73d6 100644 --- a/sc/source/core/data/column2.cxx +++ b/sc/source/core/data/column2.cxx @@ -2222,15 +2222,13 @@ class FillMatrixHandler size_t mnMatCol; size_t mnTopRow; - SCCOL mnCol; - SCTAB mnTab; ScDocument* mpDoc; svl::SharedStringPool& mrPool; svl::SharedStringPool* mpPool; // if matrix is not in the same document public: - FillMatrixHandler(ScMatrix& rMat, size_t nMatCol, size_t nTopRow, SCCOL nCol, SCTAB nTab, ScDocument* pDoc, svl::SharedStringPool* pPool) : - mrMat(rMat), mnMatCol(nMatCol), mnTopRow(nTopRow), mnCol(nCol), mnTab(nTab), + FillMatrixHandler(ScMatrix& rMat, size_t nMatCol, size_t nTopRow, ScDocument* pDoc, svl::SharedStringPool* pPool) : + mrMat(rMat), mnMatCol(nMatCol), mnTopRow(nTopRow), mpDoc(pDoc), mrPool(pDoc->GetSharedStringPool()), mpPool(pPool) {} void operator() (const sc::CellStoreType::value_type& node, size_t nOffset, size_t nDataSize) @@ -2320,8 +2318,6 @@ public: double fVal; if (rCell.GetErrorOrValue(nErr, fVal)) { - ScAddress aAdr(mnCol, nThisRow, mnTab); - if (nErr != FormulaError::NONE) fVal = CreateDoubleError(nErr); @@ -2370,7 +2366,7 @@ public: void ScColumn::FillMatrix( ScMatrix& rMat, size_t nMatCol, SCROW nRow1, SCROW nRow2, svl::SharedStringPool* pPool ) const { - FillMatrixHandler aFunc(rMat, nMatCol, nRow1, nCol, nTab, pDocument, pPool); + FillMatrixHandler aFunc(rMat, nMatCol, nRow1, pDocument, pPool); sc::ParseBlock(maCells.begin(), maCells, aFunc, nRow1, nRow2); } diff --git a/sc/source/core/data/conditio.cxx b/sc/source/core/data/conditio.cxx index a2b2f1886b60..ea0762295e87 100644 --- a/sc/source/core/data/conditio.cxx +++ b/sc/source/core/data/conditio.cxx @@ -1375,7 +1375,6 @@ ScTokenArray* ScConditionEntry::CreateFlatCopiedTokenArray( sal_uInt16 nIndex ) { assert(nIndex <= 1); ScTokenArray* pRet = nullptr; - ScAddress aAddr; if ( nIndex==0 ) { diff --git a/sc/source/core/data/documen5.cxx b/sc/source/core/data/documen5.cxx index 09a4162da72c..31eaf827911f 100644 --- a/sc/source/core/data/documen5.cxx +++ b/sc/source/core/data/documen5.cxx @@ -123,7 +123,6 @@ void ScDocument::UpdateAllCharts() SdrPage* pPage = pDrawLayer->GetPage(static_cast<sal_uInt16>(nTab)); OSL_ENSURE(pPage,"Page ?"); - ScRange aRange; SdrObjListIter aIter( *pPage, SdrIterMode::DeepNoGroups ); SdrObject* pObject = aIter.Next(); while (pObject) diff --git a/sc/source/core/tool/address.cxx b/sc/source/core/tool/address.cxx index ad82b72a2218..72b1862f221d 100644 --- a/sc/source/core/tool/address.cxx +++ b/sc/source/core/tool/address.cxx @@ -1146,7 +1146,6 @@ static ScRefFlags lcl_ScAddress_Parse_OOo( const sal_Unicode* p, ScDocument* pDo OUString aTab; bool bExtDoc = false; bool bExtDocInherited = false; - const ScAddress aCurPos(rAddr); // Lets see if this is a reference to something in an external file. A // document name is always quoted and has a trailing #. diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 5130dc0411cc..20f6f5286c11 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -200,8 +200,6 @@ void ScAcceptChgDlg::ReInit(ScViewData* ptrViewData) void ScAcceptChgDlg::Init() { - ScRange aRange; - OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found!" ); ScChangeTrack* pChanges=pDoc->GetChangeTrack(); diff --git a/sc/source/ui/miscdlgs/highred.cxx b/sc/source/ui/miscdlgs/highred.cxx index a08f8e9eb489..25f9224f1e33 100644 --- a/sc/source/ui/miscdlgs/highred.cxx +++ b/sc/source/ui/miscdlgs/highred.cxx @@ -78,8 +78,6 @@ void ScHighlightChgDlg::dispose() void ScHighlightChgDlg::Init() { - ScRange aRange; - OSL_ENSURE( pViewData && pDoc, "ViewData or Document not found!" ); ScChangeTrack* pChanges=pDoc->GetChangeTrack(); diff --git a/sc/source/ui/namedlg/namedlg.cxx b/sc/source/ui/namedlg/namedlg.cxx index c6162534bc6f..2aac5a9a3ae9 100644 --- a/sc/source/ui/namedlg/namedlg.cxx +++ b/sc/source/ui/namedlg/namedlg.cxx @@ -122,8 +122,6 @@ void ScNameDlg::dispose() void ScNameDlg::Init() { - ScRange aRange; - OSL_ENSURE( mpViewData && mpDoc, "ViewData or Document not found!" ); //init UI diff --git a/sc/source/ui/vba/vbanames.cxx b/sc/source/ui/vba/vbanames.cxx index c366521f81e0..4717fcf6611f 100644 --- a/sc/source/ui/vba/vbanames.cxx +++ b/sc/source/ui/vba/vbanames.cxx @@ -198,8 +198,7 @@ ScVbaNames::Add( const css::uno::Any& Name , uno::Reference< sheet::XCellRangeAddressable > thisRangeAdd( aAny, ::uno::UNO_QUERY_THROW); table::CellRangeAddress aAddr = thisRangeAdd->getRangeAddress(); - ScAddress aPos( static_cast< SCCOL >( aAddr.StartColumn ) , static_cast< SCROW >( aAddr.StartRow ) , static_cast< SCTAB >(aAddr.Sheet ) ); - uno::Any aAny2 ; + uno::Any aAny2; if ( mxNames.is() ) { sal_Int32 nUnoType = 0; diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 082ca8400712..6c99a32a6605 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -476,7 +476,6 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr long nDevSizeY = aRect.Bottom()-aRect.Top()+1; tools::Rectangle aLines; - ScRange aRange( nX1,nY1,nTab, nX2,nY2,nTab ); long nTwipsSizeX = 0; for (SCCOL i=nX1; i<=nX2; i++) |