[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:
Hi, I'm writing a Qt library for .ods files, available at: https://github.com/f35f22fan/QOds 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-row>
<t:table-cell t:number-rows-spanned="3" t:number-columns-spanned="2"/>
<t:covered-table-cell t:number-columns-repeated="2"/>
</t:table-row>
<t:table-row>
<t:table-cell t:number-rows-spanned="3"/>
<t:covered-table-cell t:number-columns-repeated="2"/>
</t:table-row>
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-row>
<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">
<text:p>hello</text:p>
</table:covered-table-cell>
<table:covered-table-cell/>
</table:table-row>
<table:table-row>
<table:covered-table-cell table:number-columns-repeated="3"/>
</table:table-row>
As you can see, the word 'hello' from hidden cell b1 is also shown in
cell A1.
Cheers, Jos
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]