No hidden attribute in row properties #2658
Labels
No Label
DBF
Dates
Defined Names
Features
Formula
HTML
Images
Infrastructure
Integration
International
ODS
Operations
Performance
PivotTables
Pro
Protection
Read Bug
SSF
SYLK
Style
Write Bug
good first issue
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sheetjs/sheetjs#2658
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Hi!
I tried parse xslx file and got incorrect row properties. There is no attribute "hidden" for hidden rows.
Environment:
sheetjs ver. 0.18.5
xslx file created in LibreOffice with hidden rows (file: https://disk.yandex.by/d/nNDGAN25xFjVCw)
Actual result:
sheet['!rows'] => [ { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 42.5, "hpx": 42.5, "level": 0 }, { "hpt": 40.25, "hpx": 40.25, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, null, null, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 } ]
Actual result:
sheet['!rows'] => [ { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 42.5, "hpx": 42.5, "level": 0 }, { "hpt": 40.25, "hpx": 40.25, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, null, null, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0 }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0, hidden: true }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0, hidden: true }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0, hidden: true }, { "hpt": 12.8, "hpx": 12.800000000000002, "level": 0, hidden: true } ]
I did small investigation and found that
for columns value of attribute "hidden" is parsed via function
parsexmlbool
if(coll.hidden) coll.hidden = parsexmlbool(coll.hidden);
but for rows value isn't parsed, only compared with string "1"
if(tag.hidden == "1") { rowrite = true; rowobj.hidden = true; }
LibreOffice produces xslx with value "true" for row attribute "hidden" instead "1".
Good catch! We'd accept a PR that replaces those "1" or "true" checks with a call to
parsexmlbool
.