[prev in list] [next in list] [prev in thread] [next in thread]
List: koffice-devel
Subject: KSpread: Value::asDateTime oddity
From: Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date: 2006-12-29 16:42:34
Message-ID: 200612291742.37464.stefan.nikolaus () kdemail ! net
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
Hi all,
the definition of Value::asDateTime looks very strange. It composes the date
and the time of the same integer value. I expected the time to be the
non-integer part of the floating point value. Anyone, who's able to let my
concerns end up in smoke (no farts, please. enough wind here ;) )?
// get the value as date/time
QDateTime Value::asDateTime( const Doc* doc ) const
{
return QDateTime( asDate( doc ), asTime( doc ) );
}
// get the value as date
QDate Value::asDate( const Doc* doc ) const
{
QDate dt( doc->referenceDate() );
int i = asInteger();
dt = dt.addDays( i );
return dt;
}
// get the value as time
QTime Value::asTime( const Doc* doc ) const
{
Q_UNUSED(doc);
QTime dt;
int i = asInteger();
dt = dt.addMSecs(i) /*( f * 86400 * 1000 )*/;
return dt;
}
Regards,
Stefan
[Attachment #5 (application/pgp-signature)]
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic