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

Fix misinterpreted ranges from <definedName>#636

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 3 commits intoexceljs:masterfrompeakon:bogusDefinedName
Feb 7, 2019

Conversation

papandreou
Copy link
Contributor

Hi!

I ran into a file that contained a bunch of formulas and external references in<definedName>s, which caused this crash:

     Error: Out of bounds. Invalid column letter: OFFSET      at Object.l2n (lib/utils/col-cache.js:60:13)      at Object.decodeAddress (lib/utils/col-cache.js:97:24)      at Object.decodeEx (lib/utils/col-cache.js:189:24)      at CellMatrix.addCell (lib/utils/cell-matrix.js:19:29)      at lib/doc/defined-names.js:159:18      at Array.forEach (<anonymous>)      at lib/doc/defined-names.js:157:26      at Array.forEach (<anonymous>)      at module.exports.set model [as model] (lib/doc/defined-names.js:155:11)      at module.exports.set model [as model] (lib/doc/workbook.js:206:30)      at lib/xlsx/xlsx.js:348:31

Turns out it's caused by what looks likea rather naive range extraction algorithm that doesn't take into account that the defined names could contain double quoted strings or formulas.

I'm unable to share the original file in its full glory, but I made a new one that reproduces one variant of the error.

I'm really not sure that this is the right fix -- it would probably be better to implement proper tokenization/parsing inextractRanges so that the full syntax is understood. Then again, that would be a lot of work, and to be honest I'm have no idea if those ranges are even used for anything important during the parsing?

@papandreou
Copy link
ContributorAuthor

@guyonroche, is anything holding this back? It happened to us again today, and we'd rather not go back to forking exceljs :)

@papandreou
Copy link
ContributorAuthor

@guyonroche, sorry to be a ping-in-the-ass 😼, but have you had a chance to take a look at this?

Copy link
Member

@SiemienikSiemienik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I trust that tests are green ;)

papandreou reacted with hooray emoji
Copy link
Member

@alubbealubbe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

looks good

papandreou reacted with hooray emoji
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@alubbealubbealubbe approved these changes

@SiemienikSiemienikSiemienik approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@papandreou@alubbe@Siemienik@guyonroche

[8]ページ先頭

©2009-2025 Movatter.jp