Details
-
Bug
-
Status: Open
-
Major
-
Resolution: Unresolved
-
odfdom-0.8.7
-
None
-
None
-
-
298
Description
During setting an new width of a column raises a NumberFormatException because the initial column width contains an invalid character due to mistake of using the default locale (in my case german wich uses "," instead of "." as decimal separator).
The Wron code is located in the method "createTable" of class "OdfTable", approx. line 370.
Wrong Code:
columnStyle.setProperty(StyleTableColumnPropertiesElement.ColumnWidth,
new DecimalFormat("000.0000").format(DEFAULT_TABLE_WIDTH / numCols) + "in");
Corrected Code uses Locale.US:
columnStyle.setProperty(StyleTableColumnPropertiesElement.ColumnWidth,
new DecimalFormat("000.0000",new DecimalFormatSymbols(Locale.US)).
format(DEFAULT_TABLE_WIDTH / numCols) + "in");
Attachments
Issue Links
- is duplicated by
-
ODFTOOLKIT-192 org.odftoolkit.odfdom.doc.table.OdfTableColumn.setWidth error
- Resolved