Uploaded image for project: 'ODF Toolkit'
  1. ODF Toolkit
  2. ODFTOOLKIT-224

Column.setWidth() don't work for new created table

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • odfdom-1.0
    • None
    • performance
    • None
    • Operating System: Linux
      Platform: PC
    • 253

    Description

      org.odftoolkit.simple.table.Column.setWidth() don't work for new created table.

      Example:

      import org.odftoolkit.simple.SpreadsheetDocument;
      import org.odftoolkit.simple.table.Table;

      public class TestBugOdsSimple {
      public static void main(String[] args) throws Exception

      { SpreadsheetDocument spreadsheet = SpreadsheetDocument.newSpreadsheetDocument(); Table table = spreadsheet.getTableByName("Sheet1"); table.getColumnByIndex(0).setWidth(50); // all is ok! table.setTableName("Table1"); table.getColumnByIndex(1).setWidth(50); // all is ok! table = Table.newTable(spreadsheet, 30, 7); table.setTableName("Table2"); table.getColumnByIndex(2).setWidth(50); // NumberFormatException spreadsheet.save("test.ods"); spreadsheet.close(); }

      }

      Error stack trace:

      Exception in thread "main" java.lang.NumberFormatException: For input string: "000,8571"
      at sun.misc.FloatingDecimal.readJavaFormatString(FloatingDecimal.java:1224)
      at java.lang.Double.valueOf(Double.java:475)
      at org.odftoolkit.odfdom.type.Length.parseDouble(Length.java:193)
      at org.odftoolkit.odfdom.type.Length.parseLong(Length.java:165)
      at org.odftoolkit.simple.table.Column.getWidth(Column.java:145)
      at org.odftoolkit.simple.table.Column.setWidth(Column.java:174)
      at TestBugOdsSimple.main(TestBugOdsSimple.java:18)

      Attachments

        Activity

          People

            Unassigned Unassigned
            eqlbin@odftoolkit.org eqlbin
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: