From f83a4152d5324e6cad5c522ad98174dab8c79f47 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Wed, 11 Aug 2021 21:16:49 +0000 Subject: [PATCH] support removing hyperlink from one cell when hyperlink is shared by many cells git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1892247 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java index ce883fb8e2..615379087f 100644 --- a/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java +++ b/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java @@ -3387,6 +3387,9 @@ public class XSSFSheet extends POIXMLDocumentPart implements Sheet { */ @Internal public void removeHyperlink(int row, int column) { + // CTHyperlinks is regenerated from scratch when writing out the spreadsheet + // so don't worry about maintaining hyperlinks and CTHyperlinks in parallel. + // only maintain hyperlinks XSSFHyperlink hyperlink = getHyperlink(row, column); if (hyperlink != null) { if (hyperlink.getFirstRow() == row && hyperlink.getLastRow() == row -- 2.39.5