[github-264] bug in link external workbook. This closes #264

git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1894275 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
PJ Fanning 2021-10-15 07:40:29 +00:00
parent 76c0aaa338
commit 75cfdc75da

View File

@ -1994,7 +1994,7 @@ public class XSSFWorkbook extends POIXMLDocument implements Workbook, Date1904Su
int externalLinkIdx=-1;
if (!getCreationHelper().getReferencedWorkbooks().containsKey(name)){
externalLinkIdx = this.getNextPartNumber(XSSFRelation.EXTERNAL_LINKS,
this.getPackagePart().getPackage().getPartsByContentType(XSSFRelation.EXTERNAL_LINKS.getContentType()).size());
this.getPackagePart().getPackage().getPartsByContentType(XSSFRelation.EXTERNAL_LINKS.getContentType()).size() + 1);
POIXMLDocumentPart.RelationPart rp = this.createRelationship(XSSFRelation.EXTERNAL_LINKS, xssfFactory, externalLinkIdx, false);
ExternalLinksTable linksTable = rp.getDocumentPart();
linksTable.setLinkedFileName(name);