[Kst] kdeextragear-2/kst/kst/datasources/lfiio

Andrew Walker arwalker at sumusltd.com
Fri Nov 19 22:18:00 CET 2004


CVS commit by arwalker: 

Fix problem with LFI simulated data.

Sorry, no patch as CVS is refusing to create at presents - for reasons not obvious.


  M +17 -9     lfiio.cpp   1.13


--- kdeextragear-2/kst/kst/datasources/lfiio/lfiio.cpp  #1.12:1.13
@@ -224,5 +224,5 @@ bool LFIIOSource::getColNumber( const QS
   if( bOk )
   {
-    if( iCol < _numCols )
+    if( iCol >= 0 && iCol < _numCols )
     {
       *piColNumber = iCol;
@@ -235,5 +235,8 @@ bool LFIIOSource::getColNumber( const QS
     iCount = _fieldList.count( );
 
-    for( i=0; i<iCount; i++ )
+    //
+    // start at 1, because the first entry is INDEX...
+    //
+    for( i=1; i<iCount; i++ )
     {
       strName = _fieldList[i].lower( );
@@ -242,5 +245,8 @@ bool LFIIOSource::getColNumber( const QS
         bRetVal = true;
 
-        *piColNumber = i;
+        //
+        // subtract 1 to be consistent with the value returned from the previous branch...
+        //
+        *piColNumber = i-1;
 
         break;
@@ -322,4 +328,5 @@ int understands_lfiio( KConfig*, const Q
   fitsfile* ffits;
   int       iStatus = 0;
+  int       iRetVal = 0;
 
   //
@@ -329,5 +336,6 @@ int understands_lfiio( KConfig*, const Q
   {
     fits_close_file( ffits, &iStatus );
-    return 99;
+
+    iRetVal = 99;
   }
   else
@@ -338,5 +346,5 @@ int understands_lfiio( KConfig*, const Q
   }
 
-  return 0;
+  return iRetVal;
 }
 





More information about the Kst mailing list