From koffice-devel Mon Jul 26 08:10:44 2004 From: Ariya Hidayat Date: Mon, 26 Jul 2004 08:10:44 +0000 To: koffice-devel Subject: Re: Casting rules in kspread Message-Id: <4104BC84.6090307 () kde ! org> X-MARC-Message: https://marc.info/?l=koffice-devel&m=109082959430577 > libs/koscript/ has a couple of functions that do the casting. I'm > just a bit confused about how kspread decides when the > contents are integer, and when it is a bool. Can anyone > give me a hint as to how it is supposed to work? These are the tryParse* functions. However, for the function TEXT above, rather than using KSUtil::checkType (which checks e.g integer can be casted to boolean, hence the bug if the order of the checks are not good), how about directly check the type of the KSValue of the argument and convert it to the correspoding string value ? Pseudocode: switch( type of arg ) { case string: result = arg; break; case integer: result = format integer as string; break; case double: result = format double as string; break; }; _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org https://mail.kde.org/mailman/listinfo/koffice-devel