Skip to content
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

Fix removing hyperlinks #1128

Merged
merged 4 commits into from
Aug 12, 2023
Merged

Fix removing hyperlinks #1128

merged 4 commits into from
Aug 12, 2023

Conversation

Bykiev
Copy link
Collaborator

@Bykiev Bykiev commented Jul 25, 2023

This PR closes #690

This PR closes nissl-lab#690

Unfortunately, I was unable to create a test (help is welcome)
@tonyqus tonyqus added this to the NPOI 2.7.0 milestone Aug 3, 2023
@tonyqus tonyqus added the docx label Aug 3, 2023
@tonyqus tonyqus added xlsx and removed docx labels Aug 12, 2023
@tonyqus
Copy link
Member

tonyqus commented Aug 12, 2023

LGTM

@tonyqus tonyqus merged commit a89826b into nissl-lab:master Aug 12, 2023
1 of 2 checks passed
@tonyqus tonyqus modified the milestones: NPOI 2.7.0, NPOI 2.6.2 Aug 23, 2023
@artem-iron
Copy link
Contributor

Hi!

It seems that when an empty node of hyperlinks is added in a sheetN.xml, the resulting workbook is considered corrupted by the Excel. I'll attach two files where the only difference is that the sheet1.xml in NotOK.xlsx file has an empty hyperlinks node and the file is repaired by Excel on open.

With removal of the condition for hyperlinks count to be more than 0 when writing to stream by this change, the XSSF workbooks with sheets that have no hyperlinks are now coming out "broken" as far as Excel is concerned.

Screenshot 2023-08-24 at 17 20 50

OK.xlsx
NotOK.xlsx

@Bykiev Could you maybe look into this? Maybe there's a way to do this without removing that guard?

@Bykiev
Copy link
Collaborator Author

Bykiev commented Aug 24, 2023

@artem-iron, thanks, I'll check later what can be wrong

@artem-iron
Copy link
Contributor

Created a PR with potential fix for this: #1171

@tonyqus tonyqus added the bug label Dec 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Hyperlinks not working
3 participants