ODF Toolkit
  1. ODF Toolkit
  2. ODFTOOLKIT-185

Error setting column width with german locale

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: odfdom-0.8.7
    • Fix Version/s: None
    • Component/s: java
    • Labels:
      None
    • Environment:
      Operating System: Mac OS
      Platform: Macintosh
      URL: http://www.ansys.de

      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");

        Issue Links

          Activity

          subruch created issue -
          Mark Thomas made changes -
          Field Original Value New Value
          issue.field.bugzillaimportkey 298 12524114
          made changes -
          Link This issue is duplicated by ODFTOOLKIT-192 [ ODFTOOLKIT-192 ]
          Mark Thomas made changes -
          Workflow jira [ 12634129 ] Default workflow, editable Closed status [ 12634246 ]
          Mark Thomas made changes -
          Workflow Default workflow, editable Closed status [ 12634246 ] jira [ 12634565 ]
          Florian Hopf made changes -
          Fix Version/s odfdom-0.8.7 [ 12318045 ]

            People

            • Assignee:
              subruch
              Reporter:
              subruch
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Development