From a403bddc0fe29f69e3fb2b0c04fd540fa2cec218 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 9 Dec 2014 09:22:39 +0000 Subject: surely it makes no sense to ignore return of Sanitize[Col|Row] Change-Id: I24ef940bcf4b2a7c5f40185f91ee234c844185f8 (cherry picked from commit e5c2fe0412585bc83bd6a99fc37a7c47eb8c3641) --- sc/inc/address.hxx | 20 ++++++++++---------- sc/source/core/tool/detfunc.cxx | 4 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) (limited to 'sc') diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx index a7e1a073f2cd..06c450b8eb27 100644 --- a/sc/inc/address.hxx +++ b/sc/inc/address.hxx @@ -108,52 +108,52 @@ const SCROW W16MAXROW = W16MAXROWCOUNT - 1; #endif // old stuff defines end -inline bool ValidCol( SCCOL nCol ) +SAL_WARN_UNUSED_RESULT inline bool ValidCol( SCCOL nCol ) { return nCol >= static_cast(0) && nCol <= MAXCOL; } -inline bool ValidRow( SCROW nRow ) +SAL_WARN_UNUSED_RESULT inline bool ValidRow( SCROW nRow ) { return nRow >= static_cast(0) && nRow <= MAXROW; } -inline bool ValidTab( SCTAB nTab ) +SAL_WARN_UNUSED_RESULT inline bool ValidTab( SCTAB nTab ) { return nTab >= static_cast(0) && nTab <= MAXTAB; } -inline bool ValidTab( SCTAB nTab, SCTAB nMaxTab ) +SAL_WARN_UNUSED_RESULT inline bool ValidTab( SCTAB nTab, SCTAB nMaxTab ) { return nTab >= static_cast(0) && nTab <= nMaxTab; } -inline bool ValidColRow( SCCOL nCol, SCROW nRow ) +SAL_WARN_UNUSED_RESULT inline bool ValidColRow( SCCOL nCol, SCROW nRow ) { return ValidCol( nCol) && ValidRow( nRow); } -inline bool ValidColRowTab( SCCOL nCol, SCROW nRow, SCTAB nTab ) +SAL_WARN_UNUSED_RESULT inline bool ValidColRowTab( SCCOL nCol, SCROW nRow, SCTAB nTab ) { return ValidCol( nCol) && ValidRow( nRow) && ValidTab( nTab); } -inline SCCOL SanitizeCol( SCCOL nCol ) +SAL_WARN_UNUSED_RESULT inline SCCOL SanitizeCol( SCCOL nCol ) { return nCol < 0 ? 0 : (nCol > MAXCOL ? MAXCOL : nCol); } -inline SCROW SanitizeRow( SCROW nRow ) +SAL_WARN_UNUSED_RESULT inline SCROW SanitizeRow( SCROW nRow ) { return nRow < 0 ? 0 : (nRow > MAXROW ? MAXROW : nRow); } -inline SCTAB SanitizeTab( SCTAB nTab ) +SAL_WARN_UNUSED_RESULT inline SCTAB SanitizeTab( SCTAB nTab ) { return nTab < 0 ? 0 : (nTab > MAXTAB ? MAXTAB : nTab); } -inline SCTAB SanitizeTab( SCTAB nTab, SCTAB nMaxTab ) +SAL_WARN_UNUSED_RESULT inline SCTAB SanitizeTab( SCTAB nTab, SCTAB nMaxTab ) { return nTab < 0 ? 0 : (nTab > nMaxTab ? nMaxTab : nTab); } diff --git a/sc/source/core/tool/detfunc.cxx b/sc/source/core/tool/detfunc.cxx index 7a8880b840d3..9dbc3e78308b 100644 --- a/sc/source/core/tool/detfunc.cxx +++ b/sc/source/core/tool/detfunc.cxx @@ -304,8 +304,8 @@ bool ScDetectiveFunc::HasError( const ScRange& rRange, ScAddress& rErrPos ) Point ScDetectiveFunc::GetDrawPos( SCCOL nCol, SCROW nRow, DrawPosMode eMode ) const { OSL_ENSURE( ValidColRow( nCol, nRow ), "ScDetectiveFunc::GetDrawPos - invalid cell address" ); - SanitizeCol( nCol ); - SanitizeRow( nRow ); + nCol = SanitizeCol( nCol ); + nRow = SanitizeRow( nRow ); Point aPos; -- cgit