[Libreoffice-bugs] [Bug 138409] FIREBIRD: decimal fields in table are falsifying their default values

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Jan 21 20:19:24 UTC 2021


https://bugs.documentfoundation.org/show_bug.cgi?id=138409

--- Comment #18 from Caolán McNamara <caolanm at redhat.com> ---
what I know so far:

dbaccess/source/core/api/KeySet.cxx
  OKeySet::executeInsert is what's called when the newly edited row is added to
the table
  impl_convertValue_throw searches for a "." so at this point the values should
definitely be in a .-using format, if an explicit e.g. 11,11 is typed 11.11 is
seen here.
If the default of 22,22 is used then 22,22 appears here. It looks to me that
LibreOffice is using OUString::toIntX and will get "22" when it parses that.
And I feel that firebird is given the raw "22,22" and it's firebird that parses
than in a value 0.22, I certainly see in
connectivity/source/commontools/FValue.cxx
  ORowSetValue::impl_fill that we get a literal string of 0.22 back when we
read the row.

its also the fact that on unzipping the .odb that the xml contains
db:default-value="22,22" so the 'bad' default value is in the source document.

So I think the problem is at the initial setting of the default value via the
UI letting through a literal "22,22" as a default value instead of turning it
into 22.22. I presume this value is set by using the "Default value" field of
the "Field Properties" panel in the design view.

dbaccess/source/ui/control/FieldDescControl.cxx
  OFieldDescControl::SaveData just takes the string as
sDefault = m_xDefault->get_text() here

interestingly if you enter e.g. 70 click on another row and return it is
formatted as 70,00. When we initially set the controlvalue the raw "70" is set
as the default string but OFieldDescControl::DisplayData uses
OFieldDescControl::getControlDefault to format 70 to 70,00 and sets that as the
text in the widget.

my guess is that at that sDefault = m_xDefault->get_text() location we should
do something similar to the reverse of getControlDefault to turn sDefault in a
.-using number string for appropriate types of fields

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20210121/f1bc71f6/attachment.htm>


More information about the Libreoffice-bugs mailing list