[Libreoffice-commits] core.git: Branch 'libreoffice-4-3' - sc/inc sc/source

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


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

New commits:
commit fc95fb6eb235331b2564b78f2c026364263db6e1
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
    (cherry picked from commit e5c2fe0412585bc83bd6a99fc37a7c47eb8c3641)
    (cherry picked from commit a403bddc0fe29f69e3fb2b0c04fd540fa2cec218)
    Reviewed-on: https://gerrit.libreoffice.org/13389
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
    Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/sc/inc/address.hxx b/sc/inc/address.hxx
index 7fcdee1..2018dfe 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 static_cast<SCCOL>(0) <= nCol && nCol <= MAXCOL;
 }
 
-inline bool ValidRow( SCROW nRow )
+SAL_WARN_UNUSED_RESULT inline bool ValidRow( SCROW nRow )
 {
     return static_cast<SCROW>(0) <= nRow && nRow <= MAXROW;
 }
 
-inline bool ValidTab( SCTAB nTab )
+SAL_WARN_UNUSED_RESULT inline bool ValidTab( SCTAB nTab )
 {
     return static_cast<SCTAB>(0) <= nTab && nTab <= MAXTAB;
 }
 
-inline bool ValidTab( SCTAB nTab, SCTAB nMaxTab )
+SAL_WARN_UNUSED_RESULT inline bool ValidTab( SCTAB nTab, SCTAB nMaxTab )
 {
     return static_cast<SCTAB>(0) <= nTab && 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 14d6aae..5c24396 100644
--- a/sc/source/core/tool/detfunc.cxx
+++ b/sc/source/core/tool/detfunc.cxx
@@ -303,8 +303,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