OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

office-comment message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [office-comment] covered-table-cell

On 12/17/2014 04:44 AM, Zorg wrote:
I'm writing a Qt library for .ods files, available at:

Can you please explain why one needs a special type
of cell (covered-table-cell) to designate the cells that
are next to the spanned ones?

I mean programmatically it's easy/possible to figure it out which
cells are covered, hence apparently the office suit shouldn't need a
hint for this.

It is indeed possible to calculate the positions of cells by evaluating all the table:number-columns-spanned and table:number-rows-spanned attributes. Infering the empty positions is quite cheap to do for the table:number-columns-spanned attribute, but requires iterating through previous rows for the table:number-rows-spanned attribute.

You can reduce the number of required table:covered-table-cell elements by using them like this:

   <t:table-cell t:number-rows-spanned="3" t:number-columns-spanned="2"/>
   <t:covered-table-cell t:number-columns-repeated="2"/>
   <t:table-cell t:number-rows-spanned="3"/>
   <t:covered-table-cell t:number-columns-repeated="2"/>

The explanation in version 1.0 of the specification adds:
  "The <table:covered-table-cell> is especially used by spreadsheet
   applications, where it is a common use case that a covered cell
   contains content."

Here is a real world example for row 1 and 2 in a spreadsheet:

    <table:table-cell table:formula="of:=[.B1]"
       table:number-columns-spanned="3" table:number-rows-spanned="2"/>
   <table:covered-table-cell office:value-type="string">
    <table:covered-table-cell table:number-columns-repeated="3"/>

As you can see, the word 'hello' from hidden cell b1 is also shown in cell A1.


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]