miachm / SODS

A simple Java library for handle ODS (Open Document Spreadsheet, compatible with Excel and Libreoffice)
The Unlicense
74 stars 30 forks source link

java.lang.NumberFormatException: For input string: "10.5" #26

Closed Nicramus closed 4 years ago

Nicramus commented 4 years ago

It seems that SODS have a problem with parsing spritesheet where font is 10.5 point

   InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("test.ods");
   try {
        SpreadSheet spread = new SpreadSheet(is);
    } catch (IOException e) {
        e.printStackTrace();
    }

cause: java.lang.NumberFormatException: For input string: "10.5" at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) at java.lang.Integer.parseInt(Integer.java:580) at java.lang.Integer.parseInt(Integer.java:615) at com.github.miachm.sods.OdsReader.readCellStyleEntry(OdsReader.java:147) at com.github.miachm.sods.OdsReader.iterateStyleEntries(OdsReader.java:95) at com.github.miachm.sods.OdsReader.processContent(OdsReader.java:74) at com.github.miachm.sods.OdsReader.load(OdsReader.java:43) at com.github.miachm.sods.OdsReader.load(OdsReader.java:35) at com.github.miachm.sods.SpreadSheet.<init>(SpreadSheet.java:52)

Version: 1.2.2 reproducible: yes

something like this cause the problem i think: style:font-size-complex="10.5pt"

Try to parse attached file link: https://drive.google.com/file/d/1ZrSObMqqxD70Bo0PfG-DrML_daEgjFsj/view?usp=sharing

miachm commented 4 years ago

Thanks for the report! Fixing in the next release

miachm commented 4 years ago

Solved in v1.3.0