You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@poi.apache.org by fa...@apache.org on 2022/03/22 11:44:31 UTC
svn commit: r1899129 - /poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
Author: fanningpj
Date: Tue Mar 22 11:44:31 2022
New Revision: 1899129
URL: http://svn.apache.org/viewvc?rev=1899129&view=rev
Log:
[bug-65973] partial fix for removing hyperlinks that span multiple cells
Modified:
poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
Modified: poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java
URL: http://svn.apache.org/viewvc/poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java?rev=1899129&r1=1899128&r2=1899129&view=diff
==============================================================================
--- poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java (original)
+++ poi/trunk/poi-ooxml/src/main/java/org/apache/poi/xssf/usermodel/XSSFSheet.java Tue Mar 22 11:44:31 2022
@@ -3084,8 +3084,9 @@ public class XSSFSheet extends POIXMLDoc
// also remove any hyperlinks associated with this row
if (hyperlinks != null) {
for (XSSFHyperlink link : new ArrayList<>(hyperlinks)) {
- CellReference ref = new CellReference(link.getCellRef());
- if (rowsToRemoveSet.contains(ref.getRow())) {
+ CellRangeAddress range = CellRangeAddress.valueOf(link.getCellRef());
+ //TODO handle case where hyperlink ref spans many rows (https://bz.apache.org/bugzilla/show_bug.cgi?id=65973)
+ if (range.getFirstRow() == range.getLastRow() && rowsToRemoveSet.contains(range.getFirstRow())) {
hyperlinks.remove(link);
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@poi.apache.org
For additional commands, e-mail: commits-help@poi.apache.org