Commit 0098678f authored by claes's avatar claes

Bugfix in timeformat in table object

parent 5a65028c
/*
* Proview $Id: ge_dyn.cpp,v 1.54 2007-09-19 15:07:22 claes Exp $
* Proview $Id: ge_dyn.cpp,v 1.55 2007-09-19 15:27:33 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
*
* This program is free software; you can redistribute it and/or
......@@ -7418,6 +7418,56 @@ int GeTable::scan( grow_tObject object)
len = sprintf( buf, "%s", name);
break;
}
case pwr_eType_Time: {
int sts;
char timstr[40];
switch ( format[i][1]) {
case '1':
// Format %1t, only time, no hundredth
sts = time_AtoAscii( (pwr_tTime *)(p[i] + offs), time_eFormat_Time,
timstr, sizeof(timstr));
timstr[8] = 0;
break;
case '2':
// Format %2t, only time, with hundredth
sts = time_AtoAscii( (pwr_tTime *)(p[i] + offs), time_eFormat_Time,
timstr, sizeof(timstr));
break;
case '3':
// Format %3t, compressed date and time, no hundredth
sts = time_AtoAscii( (pwr_tTime *)(p[i] + offs), time_eFormat_ComprDateAndTime,
timstr, sizeof(timstr));
timstr[17] = 0;
break;
default:
sts = time_AtoAscii( (pwr_tTime *)(p[i] + offs), time_eFormat_DateAndTime,
timstr, sizeof(timstr));
}
if ( EVEN(sts))
strcpy( timstr, "-");
len = sprintf( buf, "%s", timstr);
break;
}
case pwr_eType_DeltaTime: {
int sts;
char timstr[40];
switch ( format[i][1]) {
case '1':
// Format %1t, only time, no hundredth
sts = time_DtoAscii( (pwr_tDeltaTime *)(p[i] + offs), 0,
timstr, sizeof(timstr));
break;
default:
sts = time_DtoAscii( (pwr_tDeltaTime *)(p[i] + offs), 1,
timstr, sizeof(timstr));
}
if ( EVEN(sts))
strcpy( timstr, "-");
len = sprintf( buf, "%s", timstr);
break;
}
default: {
int sts;
sts = cdh_AttrValueToString( (pwr_eType) type_id[i],
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment