[Libreoffice-commits] core.git: sc/inc sc/source

Caolán McNamara caolanm at redhat.com
Tue Dec 9 01:30:37 PST 2014


 sc/inc/address.hxx              |   20 ++++++++++----------
 sc/source/core/tool/detfunc.cxx |    4 ++--
 2 files changed, 12 insertions(+), 12 deletions(-)

New commits:
commit e5c2fe0412585bc83bd6a99fc37a7c47eb8c3641
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Dec 9 09:22:39 2014 +0000

    surely it makes no sense to ignore return of Sanitize[Col|Row]
    
    Change-Id: I24ef940bcf4b2a7c5f40185f91ee234c844185f8

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index a7e1a07..06c450b 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<SCCOL>(0) && nCol <= MAXCOL;
 }
 
-inline bool ValidRow( SCROW nRow )
+SAL_WARN_UNUSED_RESULT inline bool ValidRow( SCROW nRow )
 {
     return nRow >= static_cast<SCROW>(0) && nRow <= MAXROW;
 }
 
-inline bool ValidTab( SCTAB nTab )
+SAL_WARN_UNUSED_RESULT inline bool ValidTab( SCTAB nTab )
 {
     return nTab >= static_cast<SCTAB>(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<SCTAB>(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 7a8880b..9dbc3e7 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;
 


More information about the Libreoffice-commits mailing list