Bug 32400 - Copying a HTML table from a webrowser and pasting into a new sheet causes permanent auto-formatting and other strange behaviours
Summary: Copying a HTML table from a webrowser and pasting into a new sheet causes per...
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
(earliest affected)
Hardware: All All
: medium critical
Assignee: Kohei Yoshida
: 31896 (view as bug list)
Depends on:
Reported: 2010-12-14 17:29 UTC by Peter Morgan
Modified: 2010-12-20 08:40 UTC (History)
0 users

See Also:
Crash report or crash signature:

Paste autoformats bug table (506.45 KB, text/html)
2010-12-14 17:29 UTC, Peter Morgan

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Morgan 2010-12-14 17:29:13 UTC
Created attachment 41127 [details]
Paste autoformats bug table

Copying a html <table> into a new sheet causes auto-formatting of cell contents into "something else".

Attached is a sample html document and also a link here

The area of interest is the "data table" area, headers ignored.

First column ie "Code" ends up with all strange stuff, eg dates, calcs etc.

Source - copy:

Paste -> after

From some quick research:
 * The "text" is formatted on paste, ie one cannot un-format it after
 * I can't make head or tail of how it makes up some of the stuff
 * changing the "formatting", setting format before etc is unaffected
 * trying to setup all various preferences didn't work.
 * not tested on Libre Office, but confirmed via IRC (circa 1am 25/12/10)

What is expected is that the cell contents are in the least, "pasteable" (pun intended) as "raw text", that can be formatted later.

This is a Show Stopper for me.
Comment 1 Kohei Yoshida 2010-12-14 18:17:54 UTC
I'll take this.
Comment 2 Kohei Yoshida 2010-12-14 19:30:16 UTC
So, I can at least fix the regular pasting of html, by providing an option to enable or disable this special "auto-formatting" (that we call automatic number detection).

What'll happen is that when you copy and paste an html table into Calc, Calc will launch an html import option dialog to let you choose

1. Language to use (or 'Automatic' for the system language), and
2. Whether to automatically detect special numbers, such as date, time, percentage etc.

If you disable automatic number detection, then the data will be pasted as texts, which I believe is what you want.
Comment 3 Kohei Yoshida 2010-12-14 19:38:13 UTC
I won't fix the pasting of html as unformatted text, though, since that's not what's being asked here & that would be a separate code path.
Comment 4 Kohei Yoshida 2010-12-14 19:44:23 UTC
Fixed on master.  This will not make it into 3.3 (since we are already way past the deep code freeze), but it will be in the next major release.

Comment 5 Kohei Yoshida 2010-12-20 08:40:08 UTC
*** Bug 31896 has been marked as a duplicate of this bug. ***