[Kst] extragear/graphics/kst/src/datasources/lfiio
Andrew Walker
arwalker at sumusltd.com
Tue Mar 14 20:27:58 CET 2006
SVN commit 518642 by arwalker:
BUG:123399 Allow for the posibility that column labels are identical.
M +12 -3 lfiio.cpp
--- trunk/extragear/graphics/kst/src/datasources/lfiio/lfiio.cpp #518641:518642
@@ -117,19 +117,28 @@
for( i=0; i<iNumCols; i++ )
{
iStatus = 0;
-
+
sprintf( charTemplate, "%d", i+1 );
iResult = fits_get_colname( ffits, CASEINSEN, charTemplate, charName, &iColNumber, &iStatus );
if( iResult == 0 )
{
+ int iOffset = i;
+
strName = charName;
- _fieldList.append( strName );
+ //
+ // ensure that we don't add duplicates to the _fieldList...
+ //
+ while( _fieldList.findIndex( strName ) != -1 )
+ {
+ strName = QString("%1[%2]").arg( charName ). arg( iOffset );
+ iOffset++;
+ }
}
else
{
strName.setNum( i );
- _fieldList.append( strName );
}
+ _fieldList.append( strName );
iStatus = 0;
iResult = fits_get_coltype( ffits, i+1, &iTypeCode, &lRepeat, &lWidth, &iStatus );
More information about the Kst
mailing list