Skip to content

fix(worksheet.state): corrected worksheet state #621

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Feb 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/doc/worksheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ var Worksheet = module.exports = function(options) {
this.name = options.name || 'Sheet' + this.id;

// add a state
this.state = options.state || 'show';
this.state = options.state || 'visible';

// rows allows access organised by row. Sparse array of arrays indexed by row-1, col
// Note: _rows is zero based. Must subtract 1 to go from cell.row to index
Expand Down
2 changes: 1 addition & 1 deletion lib/stream/xlsx/worksheet-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ var WorksheetWriter = module.exports = function(options) {
this.name = options.name || 'Sheet' + this.id;

// add a state
this.state = options.state || 'show';
this.state = options.state || 'visible';

// rows are stored here while they need to be worked on.
// when they are committed, they will be deleted.
Expand Down
7 changes: 4 additions & 3 deletions spec/unit/xlsx/xform/book/data/book.1.1.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
{"visibility": "hidden"}
],
"sheets": [
{"name": "Values", "id": 1, "rId": "rId1", "state": "show"},
{"name": "Other", "id": 2, "rId": "rId2", "state": "hidden"}
{"name": "Visible", "id": 1, "rId": "rId1", "state": "visible"},
{"name": "Hidden", "id": 2, "rId": "rId2", "state": "hidden"},
{"name": "VeryHidden", "id": 3, "rId": "rId3", "state": "veryHidden"}
],
"properties": {
"date1904": true
}
}
}
7 changes: 4 additions & 3 deletions spec/unit/xlsx/xform/book/data/book.1.2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
<workbookView visibility="hidden" xWindow="0" yWindow="0" windowWidth="12000" windowHeight="24000"/>
</bookViews>
<sheets>
<sheet name="Values" sheetId="1" r:id="rId1" state="show"/>
<sheet name="Other" sheetId="2" r:id="rId2" state="hidden"/>
<sheet name="Visible" sheetId="1" r:id="rId1" state="visible"/>
<sheet name="Hidden" sheetId="2" r:id="rId2" state="hidden"/>
<sheet name="VeryHidden" sheetId="3" r:id="rId3" state="veryHidden"/>
</sheets>
<calcPr calcId="171027"/>
</workbook>
</workbook>
7 changes: 4 additions & 3 deletions spec/unit/xlsx/xform/book/data/book.1.3.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
{"visibility": "hidden", "x": 0, "y": 0, "width": 12000, "height": 24000}
],
"sheets": [
{"name": "Values", "id": 1, "rId": "rId1", "state": "show"},
{"name": "Other", "id": 2, "rId": "rId2", "state": "hidden"}
{"name": "Visible", "id": 1, "rId": "rId1", "state": "visible"},
{"name": "Hidden", "id": 2, "rId": "rId2", "state": "hidden"},
{"name": "VeryHidden", "id": 3, "rId": "rId3", "state": "veryHidden"}
],
"properties": {
"date1904": true
}
}
}