You are viewing a plain text version of this content. The canonical link for it is here.
Posted to odf-dev@incubator.apache.org by "Olivier Cailloux (JIRA)" <ji...@apache.org> on 2017/11/16 14:05:00 UTC
[jira] [Updated] (ODFTOOLKIT-466) Exceptions when trying to read
border
[ https://issues.apache.org/jira/browse/ODFTOOLKIT-466?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Olivier Cailloux updated ODFTOOLKIT-466:
----------------------------------------
Description:
When reading in an ODS document a border that has a diagonal set, I get various exceptions: IllegalArgumentException, NumberFormatException, NullPointerException.
See the example and sample files at https://github.com/oliviercailloux/Test-ODFToolkit-ODS/tree/bug-diag.
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).
was:
When reading in an ODS document a border that has a diagonal set, I get various exceptions: IllegalArgumentException, NumberFormatException, NullPointerException.
See the example and sample files at https://github.com/oliviercailloux/Test-ODFToolkit-ODS/tree/bug-diag.
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).
> Exceptions when trying to read border
> -------------------------------------
>
> Key: ODFTOOLKIT-466
> URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-466
> Project: ODF Toolkit
> Issue Type: Bug
> Components: simple api
> Reporter: Olivier Cailloux
>
> When reading in an ODS document a border that has a diagonal set, I get various exceptions: IllegalArgumentException, NumberFormatException, NullPointerException.
> See the example and sample files at https://github.com/oliviercailloux/Test-ODFToolkit-ODS/tree/bug-diag.
> 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).
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)