incubator-odf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alain Fagot Béarez (JIRA) <j...@apache.org>
Subject [jira] [Commented] (ODFTOOLKIT-355) NullPointerException when removing rows from a new Spreadsheet table
Date Wed, 03 Jul 2013 10:55:21 GMT

    [ https://issues.apache.org/jira/browse/ODFTOOLKIT-355?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13698812#comment-13698812
] 

Alain Fagot Béarez commented on ODFTOOLKIT-355:
-----------------------------------------------

I didn't forged a code fragment to test this but for use in my application, I fixed it this
way:

Index: simple/src/main/java/org/odftoolkit/simple/table/Row.java
===================================================================
--- simple/src/main/java/org/odftoolkit/simple/table/Row.java	(revision 1499231)
+++ simple/src/main/java/org/odftoolkit/simple/table/Row.java	(working copy)
@@ -958,6 +958,10 @@
 		Table table = getTable();
 		for (int i = 0; i < table.getColumnCount();) {
 			Cell cell = getCellByIndex(i);
+			if (cell == null) {
+				i++;
+				continue;
+			}
 			if (cell.isCoveredElement()) {
 				// cell is a cover cell
 				Cell coverCell = cell.getCoverCellInSameColumn();

                
> NullPointerException when removing rows from a new Spreadsheet table
> --------------------------------------------------------------------
>
>                 Key: ODFTOOLKIT-355
>                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-355
>             Project: ODF Toolkit
>          Issue Type: Bug
>          Components: simple api
>    Affects Versions: 0.6-incubating
>            Reporter: Florian Hopf
>            Assignee: Florian Hopf
>         Attachments: ODFTOOLKIT-355-Test.patch
>
>
> When removing a row from a newly create Table a NullPointerException is thrown in removeAllCellsRelationship()

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message