Question unoType for getXmlToken (dbaccess/reportdesign module)
Lionel Elie Mamane
lionel at mamane.lu
Fri May 16 21:29:32 PDT 2014
On Fri, May 16, 2014 at 10:30:27AM -0700, julien2412 [via Document Foundation Mail Archive] wrote:
> I noticed this:
> s_aTypeNameMap[GetXMLToken( XML_FLOAT)] = ::cppu::UnoType<double>::get();
> present at 2 locations:
> Why shouldn't be this:
> s_aTypeNameMap[GetXMLToken( XML_FLOAT)] = ::cppu::UnoType<float>::get();
Also in xmloff/source/forms/propertyimport.cxx (which is not found by
the above search).
In that file I also see:
token::XMLTokenEnum OPropertyExport::implGetPropertyXMLType(const ::com::sun::star::uno::Type& _rType)
// handle the type description
So there, clearly, all numeric types (including the UNO double)
consistently map to XML_FLOAT, so taking the extra precision from the
C++ type "float" to "double" makes absolute sense. What is called
"float" in XML seems to be the general notion of number, not
specifically the IEE754 single precision 32-bit floating point.
Looking into an .odb file's reports, I don't see "double" used at
all. Again, "float" seems to be used in the general sense of
"number". This is confirmed by
which shows that the ODF format uses the XML token "float" to mean
"number", and does not have a difference between the notion of
"integer" and "floating point", much less between different precision
levels of floating point data types.
So again, it makes sense to use the C++ type "double" for that (extra
precision, matches the type used by our numeric formatters, ...).
View this message in context: http://nabble.documentfoundation.org/Question-unoType-for-getXmlToken-dbaccess-reportdesign-module-tp4109071p4109116.html
Sent from the Dev mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the LibreOffice