[Libreoffice-bugs] [Bug 130530] New: User fields broken for time formats broken

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Sat Feb 8 14:56:00 UTC 2020


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

            Bug ID: 130530
           Summary: User fields broken for time formats broken
           Product: LibreOffice
           Version: 6.3.4.2 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Writer
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: wd at denx.de

Created attachment 157746
  --> https://bugs.documentfoundation.org/attachment.cgi?id=157746&action=edit
Test documents using plain text data resp. data in a User Field

I'm trying to use a User Field for some calculations in a table.  This works
fine for plain numbers, but fails to work for time formatted entries.

Document "Test-field.odt" shows the intended use: the left column holds entries
that represent some time (given in hours and minutes, using time format string
"[H]:MM" resp. "876613:37"), the middle column has some hourly rate, and the
right column calculates the amount. This works fine here.

In document "Test-field.od" the time entry in the last line has been replaced
by a User Field. The name is "var_time", format is Time, time format string
again "[H]:MM" resp. "876613:37", value is 6:30.  However, the document
displays not the expected "6:30", but "0:00" instead. Also, the calculation
does not give the expected result.

I think the input format "6:30" for the value is not recognized as a valid
number.  When I change the value for the field to a plain number, say 6, the
following happens: if I click the green checkmark, the value in the table
changes into "6"; but as soon as I clock OK, it changes into "144:00".
Apparently the number is counting in days here. I can try confirm this by
entering a float number 0,270833333 as value for the field. clicking on the
green checkmark, it shows the float number as entered as value for the field,
but when clicking OK it shows "6:30", and the computation gives the expected
result.

However, when I select a "[H]:MM" time format, I should also be able to enter
data in that format.

I wonder if the resulting declaration of the field in the XML file is correct;
it reads:

<text:user-field-decl office:value-type="float" office:value="0"
text:name="var_time"/>

Using plain numbers, I see this is represented as something like

...office:value-type="time" office:time-value="PT06H30M00S"...

-- 
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/20200208/f0b1c300/attachment-0001.htm>


More information about the Libreoffice-bugs mailing list