https://bz.apache.org/bugzilla/show_bug.cgi?id=62810

            Bug ID: 62810
           Summary: AreaReference ctor looses sheet name if rows or
                    columns swapped
           Product: POI
           Version: 4.0.0-FINAL
          Hardware: PC
                OS: Mac OS X 10.1
            Status: NEW
          Severity: major
          Priority: P2
         Component: SS Common
          Assignee: [email protected]
          Reporter: [email protected]
  Target Milestone: ---

The constructor

public AreaReference(CellReference topLeft, CellReference botRight,
SpreadsheetVersion version)

loses the sheet name if the topLeft is below or to the right of botRight.

The unit test below writes the following to the System console:

topLeft=Sheet0!$B$2
bottomRight=Sheet0!$K$6
goodAreaRef=Sheet0!$B$2:$K$6
badAreaRef=$B$2:$K$6

/*** Start of unit test code ***/

 private static void areaReferenceCtorTest(XSSFSheet sheet) {
  final String sheetName = sheet.getSheetName();
  final CellReference topLeft = new CellReference(sheetName, 1, 1, true, true);
  final CellReference bottomRight = new CellReference(sheetName, 5, 10, true,
true);
  final AreaReference goodAreaRef = new AreaReference(topLeft, bottomRight,
SpreadsheetVersion.EXCEL2007);
  final AreaReference badAreaRef = new AreaReference(bottomRight, topLeft,
SpreadsheetVersion.EXCEL2007);

  System.out.println(String.format("topLeft=%s", topLeft.formatAsString()));
  System.out.println(String.format("bottomRight=%s",
bottomRight.formatAsString()));
  System.out.println(String.format("goodAreaRef=%s",
goodAreaRef.formatAsString()));
  System.out.println(String.format("badAreaRef=%s",
badAreaRef.formatAsString()));

 }



/*** End of unit test code ***/

-- 
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to