[PATCH 3/9] warnings in binfilters sc_interpr4.cxx

Pierre-André Jacquod pjacquod at alumni.ethz.ch
Tue Nov 23 12:48:11 PST 2010


all changes based on debugger waring:
sc_interpr4.cxx: warning: comparison is always false due to limited range of data type
---
 binfilter/bf_sc/source/core/tool/sc_interpr4.cxx |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/binfilter/bf_sc/source/core/tool/sc_interpr4.cxx b/binfilter/bf_sc/source/core/tool/sc_interpr4.cxx
index 1a64001..31201a3 100644
--- a/binfilter/bf_sc/source/core/tool/sc_interpr4.cxx
+++ b/binfilter/bf_sc/source/core/tool/sc_interpr4.cxx
@@ -99,7 +99,7 @@ ScSpew ScInterpreter::theSpew;
 #endif
 
 //-------------------------------------------------------------------------
-// Funktionen für den Zugriff auf das Document
+// Funktionen f? den Zugriff auf das Document
 //-------------------------------------------------------------------------
 
 
@@ -785,11 +785,11 @@ void ScInterpreter::PopSingleRef(USHORT& rCol, USHORT &rRow, USHORT& rTab)
                 rTab = aPos.Tab() + rRef.nRelTab;
             else
                 rTab = rRef.nTab;
-            if( rCol < 0 || rCol > MAXCOL || rRef.IsColDeleted() )
+            if( rCol > MAXCOL || rRef.IsColDeleted() )
                 SetError( errNoRef ), rCol = 0;
-            if( rRow < 0 || rRow > MAXROW || rRef.IsRowDeleted() )
+            if( rRow > MAXROW || rRef.IsRowDeleted() )
                 SetError( errNoRef ), rRow = 0;
-            if( rTab < 0 || rTab >= pDok->GetTableCount() || rRef.IsTabDeleted() )
+            if( rTab >= pDok->GetTableCount() || rRef.IsTabDeleted() )
                 SetError( errNoRef ), rTab = 0;
             if ( pDok->aTableOpList.Count() > 0 )
                 ReplaceCell( rCol, rRow, rTab );
@@ -872,11 +872,11 @@ void ScInterpreter::PopSingleRef(USHORT& rCol, USHORT &rRow, USHORT& rTab)
 /*N*/ 					rTab1 = aPos.Tab() + rRef.nRelTab;
 /*N*/ 				else
 /*N*/ 					rTab1 = rRef.nTab;
-/*N*/ 				if( rCol1 < 0 || rCol1 > MAXCOL || rRef.IsColDeleted() )
+/*N*/ 				if( rCol1 > MAXCOL || rRef.IsColDeleted() )
 /*N*/ 					SetError( errNoRef ), rCol1 = 0;
-/*N*/ 				if( rRow1 < 0 || rRow1 > MAXROW || rRef.IsRowDeleted() )
+/*N*/ 				if( rRow1 > MAXROW || rRef.IsRowDeleted() )
 /*N*/ 					SetError( errNoRef ), rRow1 = 0;
-/*N*/ 				if( rTab1 < 0 || rTab1 >= nMaxTab || rRef.IsTabDeleted() )
+/*N*/ 				if( rTab1 >= nMaxTab || rRef.IsTabDeleted() )
 /*N*/ 					SetError( errNoRef ), rTab1 = 0;
 /*N*/ 			}
 /*N*/ 			{
@@ -893,11 +893,11 @@ void ScInterpreter::PopSingleRef(USHORT& rCol, USHORT &rRow, USHORT& rTab)
 /*N*/ 					rTab2 = aPos.Tab() + rRef.nRelTab;
 /*N*/ 				else
 /*N*/ 					rTab2 = rRef.nTab;
-/*N*/ 				if( rCol2 < 0 || rCol2 > MAXCOL || rRef.IsColDeleted() )
+/*N*/ 				if( rCol2 > MAXCOL || rRef.IsColDeleted() )
 /*N*/ 					SetError( errNoRef ), rCol2 = 0;
-/*N*/ 				if( rRow2 < 0 || rRow2 > MAXROW || rRef.IsRowDeleted() )
+/*N*/ 				if( rRow2 > MAXROW || rRef.IsRowDeleted() )
 /*N*/ 					SetError( errNoRef ), rRow2 = 0;
-/*N*/ 				if( rTab2 < 0 || rTab2 >= nMaxTab || rRef.IsTabDeleted() )
+/*N*/ 				if( rTab2 >= nMaxTab || rRef.IsTabDeleted() )
 /*N*/ 					SetError( errNoRef ), rTab2 = 0;
 /*N*/ 			}
 /*N*/ 			if ( pDok->aTableOpList.Count() > 0 && !bDontCheckForTableOp )
-- 
1.7.1


--------------090809010008020802000306--


More information about the LibreOffice mailing list