Bug 126565 - Import XML data with only a 2D cell address imports always to first sheet
Summary: Import XML data with only a 2D cell address imports always to first sheet
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
6.2.5.2 release
Hardware: All All
: medium normal
Assignee: Eike Rathke
URL:
Whiteboard: target:7.4.0 target:7.3.0.0.beta2 tar...
Keywords:
Depends on:
Blocks: Data-XMLsource
  Show dependency treegraph
 
Reported: 2019-07-26 12:09 UTC by Rizal Muttaqin
Modified: 2021-12-18 12:11 UTC (History)
6 users (show)

See Also:
Crash report or crash signature:


Attachments
XML File Example (1.58 KB, text/xml)
2019-12-12 23:38 UTC, Rizal Muttaqin
Details
XLM Mapping to Document (25.66 KB, image/png)
2019-12-12 23:39 UTC, Rizal Muttaqin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Rizal Muttaqin 2019-07-26 12:09:33 UTC
While import XML as data source works in a new Calc default sheet, importing to a new sheet does not work.

Step to reproduce:

1. Create a new Calc spreadsheet, add a new sheet
2. Import XML data to the new sheet (Data > Import XML Source)
Comment 1 Oliver Brinzing 2019-07-26 12:46:02 UTC
Thank you for reporting the bug. 
Please attach a sample document, as this makes it easier for us to verify the bug. 
(Please note that the attachment will be public, remove any sensitive information before attaching it. 
See https://wiki.documentfoundation.org/QA/FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help on how to do so.)

I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' once the requested document is provided.
Comment 2 Rizal Muttaqin 2019-12-06 15:08:27 UTC
(In reply to Oliver Brinzing from comment #1)
> Thank you for reporting the bug. 
> Please attach a sample document, as this makes it easier for us to verify
> the bug. 
> (Please note that the attachment will be public, remove any sensitive
> information before attaching it. 
> See
> https://wiki.documentfoundation.org/QA/
> FAQ#How_can_I_eliminate_confidential_data_from_a_sample_document.3F for help
> on how to do so.)
> 
> I have set the bug's status to 'NEEDINFO'. Please change it back to
> 'UNCONFIRMED' once the requested document is provided.

You can use any XML files to be imported while keeping in mind this issue occurs when importing to a NEW SHEET, not default existing one.
Comment 3 QA Administrators 2019-12-07 03:45:01 UTC Comment hidden (obsolete)
Comment 4 Xisco Faulí 2019-12-10 15:59:39 UTC
Hi Rizal,
Could you please try to reproduce it with a master build from http://dev-builds.libreoffice.org/daily/master/ ?
You can install it alongside the standard version.
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the master build
Comment 5 Rizal Muttaqin 2019-12-11 23:47:31 UTC
OK here my testing come

When importing to the Sheet2 (A new sheet) with "Mapped cell: $A$1" the XML content go to Sheet1

But with addition in "Mapped cell: $Sheet2.$A$1" then the XML content go to Sheet2.

Is this happen by design? By default without defining Sheet variable the content go to Sheet1. I just think this is a little bit misleading, without defining $Sheet variable the content SHOULD BE go to THE active sheet.

Tested with
Version: 6.5.0.0.alpha0+
Build ID: d5d8fa63282a433da9c49d811f04390b8d6ab9cc
CPU threads: 4; OS: Linux 5.0; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-12-11_04:03:13
Locale: id-ID (id_ID.UTF-8); UI-Language: en-US
Calc: threaded
Comment 6 Xisco Faulí 2019-12-12 15:54:56 UTC
Hi Rizal,
could you please attach a document ?
Comment 7 Rizal Muttaqin 2019-12-12 23:38:53 UTC
Created attachment 156534 [details]
XML File Example
Comment 8 Rizal Muttaqin 2019-12-12 23:39:47 UTC
Created attachment 156535 [details]
XLM Mapping to Document
Comment 9 Oliver Brinzing 2019-12-14 06:18:13 UTC
> When importing to the Sheet2 (A new sheet) with "Mapped cell: $A$1" the XML
> content go to Sheet1.
> But with addition in "Mapped cell: $Sheet2.$A$1" then the XML content go to 
> Sheet2.

reproducible with:

Version: 6.4.0.0.beta1 (x64)
Build-ID: 4d7e5b0c40ed843384704eca3ce21981d4e98920
CPU-Threads: 4; BS: Windows 10.0 Build 18363; UI-Render: Standard; VCL: win; 
Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE
Calc:
Comment 10 BogdanB 2020-09-28 05:51:03 UTC Comment hidden (obsolete)
Comment 11 Rizal Muttaqin 2020-09-29 08:00:03 UTC Comment hidden (obsolete)
Comment 12 BogdanB 2020-09-29 08:14:05 UTC Comment hidden (obsolete)
Comment 13 Rizal Muttaqin 2020-09-29 09:16:03 UTC Comment hidden (obsolete)
Comment 14 BogdanB 2020-10-05 06:54:06 UTC
I confirm this
Version: 7.0.1.2
Build ID: 7cbcfc562f6eb6708b5ff7d7397325de9e764452
CPU threads: 4; OS: Linux 5.4; UI render: default; VCL: gtk3
Locale: nl-BE (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 15 Kevin Suo 2021-12-14 07:50:40 UTC
Works for me in

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 7390401fa21d9ebf35d9473bef6b44b42ea7475d
CPU threads: 8; OS: Linux 5.14; UI render: default; VCL: gtk3
Locale: zh-CN (zh_CN.UTF-8); UI: zh-CN
Build Platform: Fedora34@X64, Branch:master, bibisect-linux-64-7.4-CN
Calc: threaded

Rizal Muttaqin: Could you please retest with a daily build or the 7.3 beta version?
Comment 16 Xisco Faulí 2021-12-14 09:10:32 UTC
(In reply to Rizal Muttaqin from comment #5)
> OK here my testing come
> 
> When importing to the Sheet2 (A new sheet) with "Mapped cell: $A$1" the XML
> content go to Sheet1
> 
> But with addition in "Mapped cell: $Sheet2.$A$1" then the XML content go to
> Sheet2.
> 
> Is this happen by design? By default without defining Sheet variable the
> content go to Sheet1. I just think this is a little bit misleading, without
> defining $Sheet variable the content SHOULD BE go to THE active sheet.
> 
> Tested with
> Version: 6.5.0.0.alpha0+
> Build ID: d5d8fa63282a433da9c49d811f04390b8d6ab9cc
> CPU threads: 4; OS: Linux 5.0; UI render: default; VCL: gtk3; 
> TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time:
> 2019-12-11_04:03:13
> Locale: id-ID (id_ID.UTF-8); UI-Language: en-US
> Calc: threaded

Still reproducible in

Version: 7.3.0.0.beta1+ / LibreOffice Community
Build ID: ecfb83d7463bed7c89baeccc03286c1ac9956d70
CPU threads: 4; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: en-US (en_US.UTF-8); UI: en-US
Calc: threaded

Steps:
1. Open Calc
2. Insert a new sheet
3. Data - XML Source
4. "Mapped cell: $A$1"

@Eike, I thought you might be interested in this issue
Comment 17 Eike Rathke 2021-12-15 18:48:45 UTC
Looks like some dumb reference processing not taking relative references (here relative to the current sheet if no sheet is given) into account..
Comment 18 Commit Notification 2021-12-15 23:28:59 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/ec4f8cd2172bf7b232961f31ebd22d7e13af261e

Resolves: tdf#126565 RefEditModified() preset current sheet for address-only

It will be available in 7.4.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 19 Eike Rathke 2021-12-15 23:32:12 UTC
Pending review https://gerrit.libreoffice.org/c/core/+/126883 for 7-2
Comment 20 Commit Notification 2021-12-16 01:40:21 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/a79fc65f583b3ec2bb924bc25b105dda59099f61

Resolves: tdf#126565 RefEditModified() preset current sheet for address-only

It will be available in 7.3.0.0.beta2.

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

Affected users are encouraged to test the fix and report feedback.
Comment 21 Eike Rathke 2021-12-16 01:44:10 UTC
Fwiw, this is not related at all to new sheets, only the 2D address (without sheet name) that always imports to the first sheet. Adjusted summary.
Comment 22 Commit Notification 2021-12-16 09:46:39 UTC
Eike Rathke committed a patch related to this issue.
It has been pushed to "libreoffice-7-2":

https://git.libreoffice.org/core/commit/262656092fda6398e6b028a92f2ac7222ce11d30

Resolves: tdf#126565 RefEditModified() preset current sheet for address-only

It will be available in 7.2.6.

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

Affected users are encouraged to test the fix and report feedback.
Comment 23 Commit Notification 2021-12-16 16:49:55 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/759da7e51d73ad4a0ae40156097eea96f029bd4f

tdf#126565: sc: Add UItest

It will be available in 7.4.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 24 Rizal Muttaqin 2021-12-18 12:11:50 UTC
I can verify this bug has been fixed

Version: 7.4.0.0.alpha0+ / LibreOffice Community
Build ID: 17a4f4d5e4d49189b43e748271d2d4fa330eef9b
CPU threads: 4; OS: Linux 5.11; UI render: default; VCL: kf5 (cairo+xcb)
Locale: id-ID (id_ID.UTF-8); UI: id-ID
Calc: threaded