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>
diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 8a75126..f2ac359 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 5336107..045e697 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 58206e3..c73dbdb 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 a2b2f18..ea07622 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 09a4162..31eaf827 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 ad82b72..72b1862 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 5130dc0..20f6f52 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 a08f8e9..25f9224 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 c616253..2aac5a9a 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 c366521..4717fcf6 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 082ca84..6c99a32 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++)