]> source.dussan.org Git - poi.git/commitdiff
support removing hyperlink from one cell when hyperlink is shared by many cells
authorPJ Fanning <fanningpj@apache.org>
Wed, 11 Aug 2021 21:16:49 +0000 (21:16 +0000)
committerPJ Fanning <fanningpj@apache.org>
Wed, 11 Aug 2021 21:16:49 +0000 (21:16 +0000)
git-svn-id: https://svn.apache.org/repos/asf/poi/trunk@1892247 13f79535-47bb-0310-9956-ffa450edef68

poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java

index ce883fb8e288f40c40edfe5252419c6416ea5919..615379087fbfd96e806f6354d829644e0f9409b6 100644 (file)
@@ -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