Uploaded image for project: 'ODF Toolkit'
  1. ODF Toolkit
  2. ODFTOOLKIT-466

Exceptions when trying to read border

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • None
    • None
    • simple api
    • None

    Description

      When reading in an ODS document a border that has a diagonal set, I get various exceptions: IllegalArgumentException, NumberFormatException, NullPointerException.
      Example and sample files here.

      Here is the code.

      try (InputStream inputStream = TestODS.class.getResourceAsStream("IAE.ods");
      		SpreadsheetDocument spreadsheetDoc = SpreadsheetDocument.loadDocument(inputStream)) {
      	Table table = spreadsheetDoc.getTableByName("Table");
      	Cell a1Cell = table.getCellByPosition("A1");
      	Cell borderCell = table.getCellByPosition("F4");
      	Border left = borderCell.getStyleHandler().getBorder(CellBordersType.LEFT);
      	Border borderBottomLeft = borderCell.getStyleHandler().getBorder(CellBordersType.DIAGONALBLTR);
      	Border borderTopLeft = borderCell.getStyleHandler().getBorder(CellBordersType.DIAGONALTLBR);
      }
      

      The code generally crashes at borderCell.getStyleHandler().getBorder(CellBordersType.LEFT); (or later, depending on the document).

      Attachments

        Activity

          People

            Unassigned Unassigned
            oliviercailloux Olivier Cailloux
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: