Bug 126049 - Copying a table in HTML from web browser to Calc, automatic data format correction is wrong (ignoring settings)
Summary: Copying a table in HTML from web browser to Calc, automatic data format corre...
Status: RESOLVED NOTABUG
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.4.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-22 08:19 UTC by roberto.turturro
Modified: 2019-06-22 15:45 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description roberto.turturro 2019-06-22 08:19:19 UTC
Description:
There's a table in HTML (with standard tags <tr> and <td>) that I copy and paste in Calc with standard "Paste" command (CTRL + V).
The table is pasted correctly, with the right row/column structure.
By the way, there's a strange behavior with the interpretation of the pasted text: Calc applies an automatic correction with text-type cells (even if I previously set "Text" in cell format).
In detail, cells that contain the string format "Mar. xx" (eg. "Mar. 04", "Mar. 11", "Mar. 18", ...) are converted automatically to "01-March-xx", where XX is interpreted as YEAR (eg. "01/03/2004", "01/03/2011", "01/03/2018").
Instead, "Mar. 04", in the site I am copyng from, should be intended as "Martedì 04" (italian localization of "Tuesday, 04th March 2019"), not "March 01st, 2004".

This problem occurs only if copyng text from inside a HTML table (text: "<tr><td>Mar. 04</td></tr>"). If I copy plain text "Mar. 04" no auto-correction is applied (if I previously set "Text" in cells format).

Steps to Reproduce:
1. In a web browser, copy a HTML table that contains cells with text "Mar. XX" (where XX is a two-digits number, from 00 to 31)
2. In Calc, paste (CTRL+V)

Actual Results:
Cells with text "Mar. XX" (eg. "Mar. 04") are interpreted as date and automatically corrected to 01-March-XXXX (eg. "01/03/2004").

Expected Results:
If I previously set "Text" as cells format and then I paste, Calc should not automatically interprete cells as date and should leave text as it is ("Mar. 04" --> "Mar. 04").


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Can't check if OpenGL is enabled.
Comment 1 roberto.turturro 2019-06-22 08:23:13 UTC
Just to be precise: date format after auto-correction is "01/03/04" (two-digit year), not "01/03/2004".
Comment 2 roberto.turturro 2019-06-22 08:26:03 UTC
And "Mar. 04" should intended as "Tuesday, 04th June 2019", not "March" as I wrote before.
Sorry for these additional comments but I can't edit first post and I noticed too late.
Comment 3 m_a_riosv 2019-06-22 12:13:07 UTC
Maybe the option Menu/Tools/Options/Load_Save/Html compatibility help tho solve the issue.

By the way can you give a link for test the copy.
Comment 4 roberto.turturro 2019-06-22 12:37:59 UTC
(In reply to m.a.riosv from comment #3)
> Maybe the option Menu/Tools/Options/Load_Save/Html compatibility help tho
> solve the issue.
> 
> By the way can you give a link for test the copy.

I tried these settings, but nothing changed.

Here's a demo page to check this bug on your own.
http://rtur.altervista.org/demo/bug/calc-bug.html

Just select all the table as you'd normally do, then copy it and paste in Calc.
Comment 5 m_a_riosv 2019-06-22 15:45:49 UTC
Use paste special [Ctrl+Shift+V], select the column head of dates and in the dropbox select text, or click on the right arrow of paste button, select unformatted text and do the same.

The issue happens with lines where the letters of a day can be interpreted as a letter of a month.