jferard / fastods

A very fast and lightweight (no dependency) library for creating ODS (Open Document Spreadsheet, mainly for Calc) files in Java. It's a Martin Schulz's SimpleODS fork
GNU General Public License v3.0
36 stars 6 forks source link

Default cell style for a row #111

Closed jferard closed 6 years ago

jferard commented 6 years ago

19.615 table:default-cell-style-name The table:default-cell-style-name attribute is usable with the following elements: 9.1.6 and 9.1.3.

Let's see if it is understood by LO.

jferard commented 6 years ago

Ok, this wasn't a LO issue. In TableCellImpl (l. 224):

    TableCellStyle curStyle = this.style;
    if (curStyle == null) // adds the data style
        curStyle = TableCellStyle.DEFAULT_CELL_STYLE;

that's clearly a bug: if the current style is null, we should take the style from the row. If the row style is null, we should take it from the column.

Cell first:

The table:default-cell-style-name attribute specifies a default cell style. Cells defined by a element that do not have a table:style-name attribute value use the specified default cell style.

Then row, and finally column:

If an individual cell has a default style specified by a table:default-cell-style-name attribute on a element and by a style:default-cell-style-name on a element, the default style specified by the element shall be applied to the cell and the default style specified by the <table:table-column element shall be ignored.