Parsed cell value contains validation error message for an .ods file #2446

Closed
opened 2021-11-04 16:27:13 +00:00 by mkoziarski · 1 comment
mkoziarski commented 2021-11-04 16:27:13 +00:00 (Migrated from github.com)

validation-parse-error.ods
The .ods file above has data validation defined for cell B3.
When parsed, the corresponding validation error message is returned as the value of cell A1, with the actual value of that cell appended to the end.
I've tested similar cases with .xslx files and the issue would not appear.

[validation-parse-error.ods](https://github.com/SheetJS/sheetjs/files/7476444/validation-parse-error.ods) The .ods file above has data validation defined for cell B3. When parsed, the corresponding validation error message is returned as the value of cell A1, with the actual value of that cell appended to the end. I've tested similar cases with .xslx files and the issue would not appear.
SheetJSDev commented 2021-11-04 17:49:35 +00:00 (Migrated from github.com)

Feel free to send a PR, changes apply to bits/80_parseods.js

--- a/bits/80_parseods.js
+++ b/bits/80_parseods.js
@@ -126,6 +126,7 @@ var parse_content_xml = (function() {
                                        C+= colpeat-1;
                                } else if(Rn[1]!=='/') {
                                        ++C;
+                                       textp = ""; textpidx = 0; textR = [];
                                        colpeat = 1;
                                        var rptR = rowpeat ? R + rowpeat - 1 : R
;
                                        if(C > range.e.c) range.e.c = C;
@@ -554,7 +555,7 @@ var parse_content_xml = (function() {
        };
 })();
Feel free to send a PR, changes apply to [`bits/80_parseods.js`](https://github.com/SheetJS/sheetjs/blob/master/bits/80_parseods.js#L128-L129) ```diff --- a/bits/80_parseods.js +++ b/bits/80_parseods.js @@ -126,6 +126,7 @@ var parse_content_xml = (function() { C+= colpeat-1; } else if(Rn[1]!=='/') { ++C; + textp = ""; textpidx = 0; textR = []; colpeat = 1; var rptR = rowpeat ? R + rowpeat - 1 : R ; if(C > range.e.c) range.e.c = C; @@ -554,7 +555,7 @@ var parse_content_xml = (function() { }; })(); ```
Sign in to join this conversation.
No Milestone
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: sheetjs/sheetjs#2446
No description provided.