There's an error in my description of the problem.

x.getValue() and  x.getTextValue() do not return null.  They throw 
NullPointerExceptions. E.g.

Exception in thread "main" java.lang.NullPointerException
    at org.jopendocument.dom.text.TextNode.getCharacterContent(Unknown 
Source)
    at 
org.jopendocument.dom.text.TextNode.getChildrenCharacterContent(Unknown 
Source)
    at 
org.jopendocument.dom.text.TextNode.getChildrenCharacterContent(Unknown 
Source)
    at org.jopendocument.dom.spreadsheet.Cell.getTextValue(Unknown Source)
    at org.jopendocument.dom.spreadsheet.Cell.getTextValue(Unknown Source)
    at org.jopendocument.dom.spreadsheet.Cell.getTextValue(Unknown Source)
    at org.jopendocument.dom.spreadsheet.Cell.getValue(Unknown Source)
    at test.ODSTEst.main(ODSTEst.java:35)

On Monday, August 31, 2020 at 2:58:02 AM UTC-7 guillaume.maill...@gmail.com 
wrote:

> Hi,
>
> Could you provide us the smallest document having this issue in order to 
> investigate 
> and to make it works on the next jOpenDocument version?
>
> Thanks.
>
> Guillaume
>
> Le lun. 31 août 2020 à 11:55, bdw...@gmail.com <bdw...@gmail.com> a 
> écrit :
>
>> I've encountered a surprising problem using jOpenDocument to read ods 
>> file created by libreoffice calc version 7.0.1:  the contents of text cells 
>> are returned as null.
>>
>> I've been using jOpenDocument to read ods files for years and have never 
>> encountered any problems before.
>>
>> E.g. I have an ods file with text in cell 0,0 of the first sheet, which I 
>> access with:
>>
>>     File ods = new File("some_file.ods");
>>     SpreadSheet spreadSheet = SpreadSheet.createFromFile(ods);
>>     Sheet sheet = spreadSheet.getFirstSheet();
>>     MutableCell x = sheet.getCellAt(0,0);
>>
>> Then
>>     x.isValid(); // returns true
>>     x.isEmpty(); // returns false
>>     x.getValueType(); // returns STRING
>>
>> *But*
>>
>>     x.getValue(); // returns null
>>     x.getTextValue(); // returns null
>>
>> This problem turned up when I upgraded to libreoffice 7.01, specifically 
>> 1:7.0.1~rc1-1~bpo10+1 amd64. It occurs in any file created *or opened *by 
>> libreoffice calc version 7.0.1
>>
>> FYI I'm using jOpenDocument-1.4rc2 on a debian 10 (buster) system.
>>
>> Reverting to version 1.6.5-3 (1:6.1.5-3+deb10u6) solves the problem.  In 
>> fact, a file created with version 7.01 that has subsequently been opened 
>> with version 1.6.5-3 is readable.
>>
>> The problem does not occur reading 'float' cells.  I have not tested 
>> other cell types.
>>
>> Does anyone have any idea what might be causing a problem like this? 
>>
>> It would be a quite serious problem if jOpenDocument can't read files 
>> created by future versions of libreoffice.
>>
>> Thanks,
>>
>>
>>
>>
>>
>>
>>  
>>
>> -- 
>>
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "jOpenDocument" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to jopendocumen...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/jopendocument/03bb8601-a2a7-4afd-8bb6-e78d823e906dn%40googlegroups.com
>>  
>> <https://groups.google.com/d/msgid/jopendocument/03bb8601-a2a7-4afd-8bb6-e78d823e906dn%40googlegroups.com?utm_medium=email&utm_source=footer>
>> .
>>
>

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"jOpenDocument" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jopendocument+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jopendocument/eea5d65f-f084-41b9-883f-6fea324eb79dn%40googlegroups.com.

Reply via email to