Bug 169019 - Data provider SPLIT_TRANSFORMATION wrongly written to file and wrongly read on loading the file
Summary: Data provider SPLIT_TRANSFORMATION wrongly written to file and wrongly read o...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
26.2.0.0 alpha0+ master
Hardware: All All
: medium normal
Assignee: Regina Henschel
URL:
Whiteboard: target:26.2.0 target:25.8.4
Keywords:
Depends on:
Blocks: Data-Provider
  Show dependency treegraph
 
Reported: 2025-10-23 13:06 UTC by Regina Henschel
Modified: 2025-10-30 19:46 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
To be imported data (1.76 KB, application/vnd.ms-excel)
2025-10-23 13:06 UTC, Regina Henschel
Details
The target document for Dataprovider import (7.20 KB, application/vnd.oasis.opendocument.spreadsheet)
2025-10-23 13:07 UTC, Regina Henschel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Regina Henschel 2025-10-23 13:06:23 UTC
Created attachment 203501 [details]
To be imported data

Download the attached csv file and the "DataProviderTarget.ods" file to your PC.
Open the ods file.
Menu > Data > Data Provider.
In that dialog do these:
* in section `Source` select the database range "myImport".
* Click on the `Browse` button and select the downloaded csv file.
* in section `Transformations` select entry `Split Column` and click on `Add` button. You get additional fields.
* In field `Separator string` insert a pipe symbol, that is | . In field `Column index` enter 1. Click the `Apply` button below the Preview.
* in section `Transformations` click on `Add` again to insert the next `Split Column` transformation.
* Enter the pipe symbol in the field `Separator string` and value 2 in `Column index` field. Click the `Apply` button below the Preview.
The preview looks goood. Click on OK button.
You should have got a list with 100 popular male and female English names.

Make sure you save to extended ods format.
Save the document to a new name.

When you examine the saved file, you will find a <calcext:data-mappings> element in the content.xml, that contains all the settings you have made in the dialog.

Reopen the saved file. Error: The "Split column" transformations are not applied and thus the entire record is in the first column.
Comment 1 Regina Henschel 2025-10-23 13:07:01 UTC
Created attachment 203502 [details]
The target document for Dataprovider import
Comment 2 Regina Henschel 2025-10-23 13:55:21 UTC
The import looks strange. The export writes a structure
<calcext:data-mappings>
    <calcext:data-mapping ...>
        <calcext:data-transforms>
            <calcext:.../>
            <Calcext:.../>
        </calcext:data-transforms>
    </calcext:data-mapping>
<calcext:data-mappings>

That is, the export writes the transformations as child element of a single data-mapping.

But the import in ScXMLMappingsContext::createFastChildContext() has ScXMLTransformationsContext on same level as ScXMLMappingContext.
Comment 3 raal 2025-10-23 14:42:27 UTC
I can confirm with Version: 26.2.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 2595f031fa93c1eb89fb4dce6f337de9be813e15
CPU threads: 4; OS: Linux 6.8; UI render: default; VCL: gtk3
Locale: cs-CZ (cs_CZ.UTF-8); UI: en-US
Calc: threaded

First column contains all the data (for example "1|James|Mary"), second contains second column (James) and third contains third column (Mary).
Comment 4 Regina Henschel 2025-10-24 08:54:29 UTC
I think, I've found the reason: https://gerrit.libreoffice.org/c/core/+/192929. The patch has no unit test, thus I have not submitted it.
Comment 5 Commit Notification 2025-10-27 09:08:44 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/48cf7f1123637be847140ef9acc49e8f5f056677

tdf#169019 write char not number, read col from 0

It will be available in 26.2.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 6 Regina Henschel 2025-10-27 09:57:40 UTC
Unit tests will be made with further patches.
Comment 7 Commit Notification 2025-10-30 19:46:56 UTC
Regina Henschel committed a patch related to this issue.
It has been pushed to "libreoffice-25-8":

https://git.libreoffice.org/core/commit/4ff6d294eac41288bce19b377c0a8857b8cb4992

tdf#169019 write char not number, read col from 0

It will be available in 25.8.4.

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.