poi-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject [Bug 57151] New: [PATCH] Document CellRangeAddress
Date Mon, 27 Oct 2014 12:58:01 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=57151

            Bug ID: 57151
           Summary: [PATCH] Document CellRangeAddress
           Product: POI
           Version: 3.11-dev
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P2
         Component: XSSF
          Assignee: dev@poi.apache.org
          Reporter: a6537691@bofthew.com

Created attachment 32150
  --> https://issues.apache.org/bugzilla/attachment.cgi?id=32150&action=edit
The patch (generated from SVN on the current revision)

In the current version of POI it is easy to generate merged cells in an XLSX
document, that excel fails to read, if merged regions overlap or are of zero or
negative size.

My patch is very simple, but helpful. It documents the constructor of
CellRangeAddress, because to Java developers it is not obvious, that the
end-index is included in the range. The common practice in Java API is that the
end index is the index of the first not-included element.

Secondly, it adds the check, that lastRow (lastCol) cannot be less than
firstRow (firstCol). This check may cause minor backward incompatibility, but
only in cases, when the generated output was already unreadable by Excel.
Similar check was already implemented for the HSSF format, in
InternalSheet.java, line 447 (addMergedRegion method). So it will not cause
incompatibility here, the error will just be reported earlier.

It could be helpful to add overlap check, but this will be an more in-depth
patch. HSSF format, unlike XSSF, seems to forgive this error:
http://apache-poi.1045710.n5.nabble.com/XSSFSheet-addMergedRegion-giving-excel-error-td3389764.html

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@poi.apache.org
For additional commands, e-mail: dev-help@poi.apache.org


Mime
View raw message