Bug 104310 - XLSX file looses data validations on import
Summary: XLSX file looses data validations on import
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:5.4.0 target:5.3.0.1
Keywords:
Depends on:
Blocks:
 
Reported: 2016-12-01 04:48 UTC by Mike Kaganski
Modified: 2017-01-04 20:47 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
Spreadsheet with validations in x14 namespace (4.56 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-12-01 04:48 UTC, Mike Kaganski
Details
Spreadsheet with standard validations (4.47 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-12-01 04:51 UTC, Mike Kaganski
Details
Excel 2013 spreadsheet with validations with AlternateContent (7.91 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2016-12-02 00:18 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Kaganski 2016-12-01 04:48:12 UTC
Created attachment 129177 [details]
Spreadsheet with validations in x14 namespace

Opening attached file with LO 5.2.3.3, the data validations for cells C1:C5 are lost.

The problem is that the validations are specified inside an ext, using x14:dataValidations items instead of plain top-level dataValidations.
Comment 1 Mike Kaganski 2016-12-01 04:51:04 UTC
Created attachment 129178 [details]
Spreadsheet with standard validations

This is the same file re-saved with usual validations, for comparison.

A patch is submitted to gerrit: https://gerrit.libreoffice.org/31456
Comment 2 Commit Notification 2016-12-01 17:39:16 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#104310: Accept also x14-style dataValidations

It will be available in 5.4.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 3 Xisco Faulí 2016-12-01 18:14:14 UTC
Moving it to NEW as there's already a commit for it
Comment 4 VLB 2016-12-01 18:55:20 UTC
Is it also solve bug 102368 and 99856 what also connect to this issue?
Comment 5 Mike Kaganski 2016-12-01 19:21:43 UTC
(In reply to vlb from comment #4)

No, it's just an import issue.
Comment 6 Mike Kaganski 2016-12-02 00:18:35 UTC
Created attachment 129218 [details]
Excel 2013 spreadsheet with validations with AlternateContent

This is another case of failing to parse the validations, because they use xmlns:x12ac extension in mc:AlternateContent item:

>  <dataValidations count="1">
>    <dataValidation type="list" operator="equal" allowBlank="1" showErrorMessage="1" sqref="A1">
>      <mc:AlternateContent xmlns:x12ac="http://schemas.microsoft.com/office/spreadsheetml/2011/1/ac" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
>        <mc:Choice Requires="x12ac">
>          <x12ac:list>1,"2,3",4</x12ac:list>
>        </mc:Choice>
>        <mc:Fallback>
>          <formula1>"1,2,3,4"</formula1>
>        </mc:Fallback>
>      </mc:AlternateContent>
>    </dataValidation>
>  </dataValidations>
Comment 7 Mike Kaganski 2016-12-02 00:40:22 UTC
Patch to read x12ac-list is posted to gerrit: https://gerrit.libreoffice.org/31516
Comment 8 Commit Notification 2016-12-02 02:55:07 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

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

tdf#104310: Accept x12ac lists and fallbacks in dataValidations

It will be available in 5.4.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 9 Commit Notification 2016-12-02 08:36:14 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=438bb23d7225cb32c273950845e71c0d74486e5a&h=libreoffice-5-3

tdf#104310: Accept also x14-style dataValidations

It will be available in 5.3.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 10 Commit Notification 2016-12-05 06:40:30 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-5-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=90aca5a284c0d0828853b1a9ed2e4a0fd05f7f1a&h=libreoffice-5-3

tdf#104310: Accept x12ac lists and fallbacks in dataValidations

It will be available in 5.3.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 Timur 2017-01-04 12:10:51 UTC
Please comment what was done here and whether it can be closed?
All 3 files report errors when checked with Open XML SDK 2.5 Productivity Tool?
Comment 12 Mike Kaganski 2017-01-04 20:47:37 UTC
(In reply to Timur from comment #11)
> Please comment what was done here and whether it can be closed?

All three cases are handled properly now (previously only the second file, i.e. attachment 129178 [details], was handled properly).

> All 3 files report errors when checked with Open XML SDK 2.5 Productivity
> Tool?

Cannot reproduce. Validating all three files doesn't return errors against all available formats (2007, 2010 and 2013) in Open XML SDK 2.5 Productivity Tool for Microsoft Office (build 2.5.5631.0) on my system. All three files are hand-made to be absolutely minimal test cases, though.