[ 
https://issues.apache.org/jira/browse/ODFTOOLKIT-185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Florian Hopf updated ODFTOOLKIT-185:
------------------------------------

    Fix Version/s:     (was: odfdom-0.8.7)
    
> Error setting column width with german locale
> ---------------------------------------------
>
>                 Key: ODFTOOLKIT-185
>                 URL: https://issues.apache.org/jira/browse/ODFTOOLKIT-185
>             Project: ODF Toolkit
>          Issue Type: Bug
>          Components: java
>    Affects Versions: odfdom-0.8.7
>         Environment: Operating System: Mac OS
> Platform: Macintosh
> URL: http://www.ansys.de
>            Reporter: subruch
>            Assignee: subruch
>
> 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");

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to