Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Protect cell fix#166

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
guyonroche merged 1 commit intoexceljs:masterfromjayflo:protected-cell-fix
Sep 14, 2016
Merged

Conversation

@jayflo
Copy link

@jayflojayflo commentedAug 10, 2016
edited
Loading

Integer cell values are interpreted as Dates based oncellXfs.xf elements inxl/styles.xml. However, when any spreadsheet has "protected" cells, thesexf elements can have the form:

<xfborderId="1"fillId="10"fontId="3"numFmtId="0"xfId="0"applyProtection="1"applyAlignment="1"applyFill="1"applyBorder="1"applyFont="1">  <alignmenthorizontal="center"vertical="center"/>  <protectionlocked="0"/></xf>

Currently, unknown child elements ofxf elements are not handled correctly and this causesxl/styles.xml to be parsed incorrectly (this is the root of the problem). Whenxl/styles.xml is parsed incorrectly, thelib/xlsx/style/styles-xform.js methodgetStyleModel can fail to find thenumFmt for Date types. The change here does not have to be "the fix" (you/we can also add an xform for protected elements) but it does fix the problem since unknown child cells ofxf elements will not cause the parentListXform.parseClose to remove theparser.

Since exceljs may not be able to account for all possible element types in the xml files, it shouldat least ignore unknown elements and only process those that it knows how to "handle." This way exceljs will do its best to work correctly for the subset of features it supports.

Let me know if more info is needed.

osecki and jayflo reacted with thumbs up emojiosecki and jayflo reacted with laugh emojiosecki and jayflo reacted with hooray emoji
@jayflo
Copy link
Author

You might also consider throwing an error when a cell needs to lookup a style for an index that does not exist. Since Excel is provides correct indices, the only reason the index would not exist during the parsing process would be because of a bug in exceljs. Then the bug could be found much more quickly and be dealt with.

osecki and jayflo reacted with thumbs up emoji

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@jayflo@guyonroche

[8]ページ先頭

©2009-2025 Movatter.jp