Skip to content

Fix removing hyperlinks#1128

Merged
tonyqus merged 4 commits into
nissl-lab:masterfrom
Bykiev:Bug689
Aug 12, 2023
Merged

Fix removing hyperlinks#1128
tonyqus merged 4 commits into
nissl-lab:masterfrom
Bykiev:Bug689

Conversation

@Bykiev
Copy link
Copy Markdown
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 xwpf label Aug 3, 2023
@tonyqus tonyqus added xssf and removed xwpf labels Aug 12, 2023
@tonyqus
Copy link
Copy Markdown
Member

tonyqus commented Aug 12, 2023

LGTM

@tonyqus tonyqus merged commit a89826b into nissl-lab:master Aug 12, 2023
@tonyqus tonyqus modified the milestones: NPOI 2.7.0, NPOI 2.6.2 Aug 23, 2023
@artemkoloskov-admin
Copy link
Copy Markdown
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
Copy Markdown
Collaborator Author

Bykiev commented Aug 24, 2023

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

@artemkoloskov-admin
Copy link
Copy Markdown
Contributor

Created a PR with potential fix for this: #1171

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