Hi, > > hi all, > > because of a bug in OOo's ODF export i'd like to change the implementation > of ::rtl::math::doubleToString() in sal/rtl/source/math.cxx. > > currently the function does not produce the right strings for double > values Not-a-Number and +/- Infinity. > > the XMLSchema-2 specification defines specific literals for these, but > currently the ::rtl::math::doubleToString() function produces different > strings, apparently inspired from what the MSFT runtime library does. > > this would be a ABI compatible change, but it would change the strings > produced for these double values. > (of course the other direction is easy: parse both variants.) > > this would change the value produced by various RTL methods. > - various ::rtl::math::doubleTo* functions. > - various "C" rtl_math_doubleTo* functions. > - most importantly ::rtl::OUString::valueOf(double). > > does anybody rely on the current RTL string representation of > Infinity/Not-a-Number?
Looking into this it seems OUString does depend on it. Namely OUString OUString::valueOf( float f ) and OUString OUString::valueOf( double d ) e.g. by calling rtl_ustr_valueOfDouble which in turn calls rtl_math_doubleToUString. Also the functions float OUString::toFloat() and double OUString::toDouble() need to match the above ones. Also keep in mind that Java does define what nan and inf gets converted to as String http://www.ifs.tuwien.ac.at/ifs/lehre/eprog/javadoc/jdk/docs/api/java/lang/Double.html#toString%28double%29 and from string http://www.ifs.tuwien.ac.at/ifs/lehre/eprog/javadoc/jdk/docs/api/java/lang/Double.html#valueOf%28java.lang.String%29 I don't know though if the Java bridge or whatever takes care of this task or not when OUStrings are involved in the Uno API. Thomas --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
