You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@poi.apache.org by bu...@apache.org on 2014/10/27 13:58:01 UTC

[Bug 57151] New: [PATCH] Document CellRangeAddress

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


[Bug 57151] [PATCH] Document CellRangeAddress

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=57151

Dominik Stadler <do...@gmx.at> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Dominik Stadler <do...@gmx.at> ---
Thanks for the patch, applied via r1635389.


I also added some more unit tests to verify the changes, would be nice if you
can provide an accompanying unit-test as part of future patches.

-- 
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