Bug 114487 - Importing HTML creates questionable named ranges
Summary: Importing HTML creates questionable named ranges
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: All All
: medium minor
Assignee: Justin L
URL:
Whiteboard: target:6.2.0 target:6.1.0.1 target:6.0.6
Keywords:
Depends on:
Blocks: Cell-Name
  Show dependency treegraph
 
Reported: 2017-12-15 12:08 UTC by Aron Budea
Modified: 2018-10-10 10:05 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
HTML with table (1.07 KB, text/html)
2017-12-15 12:08 UTC, Aron Budea
Details
link to external data (33.62 KB, image/png)
2017-12-17 08:12 UTC, raal
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Aron Budea 2017-12-15 12:08:41 UTC
Created attachment 138459 [details]
HTML with table

Open the attached HTML file in Calc. The HTML was saved from the web, and contains a table.
Check Sheet -> Named Ranges and Expressions -> Manage...

=> Three global named ranges are created for seemingly no reason: HTML_1, HTML_all, HTML_tables.
And even if there's a reason, their scope shouldn't be Document (Global).

Observed using LO 6.1 master build (4af729f31c64c09c76ea8bcfa5067092571b92de) & 4.0.0.3 / Ubuntu 17.04.
Comment 1 raal 2017-12-17 08:12:06 UTC
Created attachment 138480 [details]
link to external data

it's used for linking external data probably.
Comment 2 Buovjaga 2017-12-25 19:02:26 UTC
(In reply to raal from comment #1)
> Created attachment 138480 [details]
> link to external data
> 
> it's used for linking external data probably.

Notabug then?
Comment 3 Aron Budea 2017-12-26 10:52:20 UTC
(In reply to raal from comment #1)
> it's used for linking external data probably.

Fair point, I found this help page that explains the existence of names:
https://help.libreoffice.org/Calc/Inserting_External_Data_in_Table_WebQuery

However, the named ranges are global, while they refer to ranges on a single sheet. This is a bug in my opinion.

A couple of details aren't clear to me based on the help page:
- the help says the tables will be named "HTML_table1" and so on, while actually it's named "HTML_1",
- what does "designate" mean? How does it work when there are multiple tables? Is it fine that "HTML_tables" refers to a single cell, A1 (in this case)?
Comment 4 Justin L 2018-05-23 17:55:30 UTC Comment hidden (no-value)
Comment 5 Commit Notification 2018-06-04 11:50:05 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=c42b1cf2464924b125aeae15968fb79cf795bc81

tdf#114487 sc htmlimp: rangeNames should be 3D

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 Eike Rathke 2018-06-04 12:01:16 UTC
What should be done in a second step / follow-up commit is to set the named range's scope to sheet-local instead of global, otherwise importing a second HTML document with the same default range names would clash and the names not be added. This does *not* mean that they couldn't be referenced from other sheets, sheet-local names are definitions local to a sheet, by prefixing the sheet name can be used from any other sheet, for example Sheet2.HTML_1 (this wasn't possible in early versions with sheet-local names but is since a while already).
Comment 7 Commit Notification 2018-06-04 18:16:35 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=513204bcf7b9a43535ed585251e73a6d77805148&h=libreoffice-6-1

tdf#114487 sc htmlimp: rangeNames should be 3D

It will be available in 6.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2018-06-04 18:16:46 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cd51f388c96cafdf81303722c43c6025d9f0073e&h=libreoffice-6-0

tdf#114487 sc htmlimp: rangeNames should be 3D

It will be available in 6.0.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 9 Commit Notification 2018-06-11 21:21:28 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=5720c85ccea9f1481bd604b806c5be728e59a13f

tdf#114487 sc htmlimp: non-global sheet range names

It will be available in 6.2.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2018-06-12 13:44:41 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-6-1":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=f62340a104813e4a6a34e7281d86407bc8314ffd&h=libreoffice-6-1

tdf#114487 sc htmlimp: non-global sheet range names

It will be available in 6.1.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2018-06-13 11:03:59 UTC
Justin Luth committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=399bf0dcd26ed23d2864d60ccba0541d81f48cdc&h=libreoffice-6-0

tdf#114487 sc htmlimp: non-global sheet range names

It will be available in 6.0.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 12 Xisco Faulí 2018-08-15 13:57:16 UTC
Since the fix for this issue has been reverted in http://cgit.freedesktop.org/libreoffice/core/commit/?id=1597dbb5ba5d68b5807236c1d045f5215f221c91, let's put it back to NEW
Comment 13 Justin L 2018-08-15 15:16:03 UTC
(In reply to Xisco Faulí from comment #12)
> Since the fix for this issue has been reverted let's put it back to NEW
No, the fix is the commit in comment 5.  The reverted commit was just a bonus response to comment 6
Comment 14 Xisco Faulí 2018-08-15 15:20:13 UTC
(In reply to Justin L from comment #13)
> (In reply to Xisco Faulí from comment #12)
> > Since the fix for this issue has been reverted let's put it back to NEW
> No, the fix is the commit in comment 5.  The reverted commit was just a
> bonus response to comment 6

oh I see, sorry for the noise. Happy to hear both bugs are fixed now!