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
35 stars 6 forks source link

PreambleAppender#appendColumns : prevent systematic table:table-column=1024 #250

Open rguihard opened 3 weeks ago

rguihard commented 3 weeks ago

When an ODS contains only one or few columns, it is not desirable to export the constant MAX_COLUMN_COUNT=1024 as attribute number-columns-repeated. ODS readers (like SODS) will consider a generated file with 2 columns contains "rows 1024" cells wheras it contains only "rows 2" cells.

The TableModel#columnCapacity knows the initial columnCapacity. Using this value is more accurate.