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

New cell pseudo-type text #15

Closed jferard closed 7 years ago

jferard commented 7 years ago

Some cells may contain complex text, similar to the footer/header text. With new cell pseudo-type, it would be easy to do that. String version: TableCell.setStringValue("string") Outputs a very short XML:

<table:table-cell office:value-type="string" office:string-value="string"/>

Text version (see syntax for builder here https://github.com/jferard/fastods/issues/14): TableCell.setTextValue(TextValue.builder().<some methods to build the text value>.build()) Outputs a longer XML:

<table:table-cell office:value-type="string" calcext:value-type="string">
    <text:p>
        <text:span text:style-name="...">te</text:span><text:span text:style-name="...">xt</text:span>
    </text:p>
</table:table-cell>
jferard commented 7 years ago

See http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415146_253892949 and http://docs.oasis-open.org/office/v1.2/os/OpenDocument-v1.2-os-part1.html#__RefHeading__1415196_253892949 for possible improvements.

jferard commented 7 years ago

There is in 0_1_2 branch a new class Text. It should work with a little glue...