-
Notifications
You must be signed in to change notification settings - Fork 423
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
Multiple exceptions when count
does not match the number of elements
#735
Comments
Fix XLNT issue tfussell#735
Pull Request #736 fixes the issues I had. |
a new question in this restoration,When you insert data, if it's a number, no problem, if it's a string then there's a problem, it's going to be a different character than what you inserted. I found that the tag number corresponding to sheeting.xml is incorrect. |
if excel is size don't match ,i write some word to excel ,but excel word is error .i found error is here
in size don't match we don't return sz isn't |
@mankaixin Could you please share an XLSX file where I can test your issue? |
test2.xlsx |
@mankaixin Thanks for the example. The issue I described above is about reading data, while the issue you described is about writing data. Since your issue is a different one than mine, so please open a new GitHub issue. Furthermore, you could also create a Pull Request containing your fix. I quickly looked at the code and I agree - if |
Co-authored-by: Laurențiu Leahu-Vlăducu <[email protected]>
I noticed that
xlsx_consumer.cpp
throws exceptions in multiple cases whencount
does not match the number of elements. This causes issues because:count="1"
but the actual count is 2. Of course this is wrong and is actually an issue of the SAP software - however, Microsoft Excel is still able to open the file correctly. For users of our software, it looks like our software is broken because it cannot open the file (while Excel can), since users do not know that the SAP software is actually the broken one 😅 On the other hand, while it is not nice to accept obviously broken files, there is no actual disadvantage for XLNT to simply ignore the fact that the count does not match.My proposed solution:
std::vector::reserve
to allocate enough memory right away (small performance improvement, because why not?).THROW_ON_INVALID_XML
is defined and the count is known, throw an exception, just like before. In other words, if a very strict XML parser is desired, exceptions can still be enabled.I will send a pull request containing the proposed changes.
The text was updated successfully, but these errors were encountered: