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

Raimund Hölle commented on ODFTOOLKIT-356:
------------------------------------------

Hello Svante,

a preliminary note on my work and statements: my use cases are constricted on 
spreadsheet documents.
* creating spreadsheets for reports and similar needs
* parsing spreadsheets used for data exchange
So I don't see the whole picture (text documents with tables and so on).

I agree that a table without any cell is not valid. But I think it is a 
question which strategy the framework follows to ensure that, I see two 
possibilities:
# Avoid to have an empty table at any time during the document creation process 
(validation on remove-methods).
# Validate the document before it is being used, t. m., on saving.
The first is easier to implement, but it need additional effort by the user of 
the framework for creating own spreadsheet documents (see my comment above). 
The second allows the user to start with an empty table and just add rows and 
cells, but it may be more effort to implement the validation (ensure that all 
append-methods work with empty tables,  need to parse the whole DOM again, find 
all places where validation must be performed).

In the moment, odftoolkit don't implement any of the both validation 
strategies, but I assume that the architects had no. 1 in mind. Therefore i 
think it would be the easiest to just forbid removing the last row of a sheet / 
last cell of a row. To my mind, automatically removing the table if it becomes 
empty is an unexpected side effect. Beside, how can it be handled if it is the 
last table of a spreadsheet document? Then the document will become invalid too.

Regarding your general comments:
# I didn't delete existing patches, because I see my own patches only as 
proposals; I think they need thorough checking by a person with deep knowledge 
of the framework.
# My mistake. I converted the indents to tabs, but maybe an additional opening 
in my IDE converts them back to spaces.

> IllegalArgumentException when removing all columns from a fresh Table
> ---------------------------------------------------------------------
>
>                 Key: ODFTOOLKIT-356
>                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-356
>             Project: ODF Toolkit
>          Issue Type: Bug
>    Affects Versions: 0.6-incubating
>            Reporter: Florian Hopf
>            Assignee: Florian Hopf
>         Attachments: HandlingEmptyTables-Test.patch, 
> HandlingEmptyTables.patch, ODFTOOLKIT-356-Test.patch, 
> ODFTOOLKIT-356-contribution.patch
>
>
> When trying to remove all columns from the Table of a newly created 
> SpreadsheetDocument an illegal index is passed in to Row#getCellByIndex()



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to