<div dir="ltr">So, really, I want to grab all rows and find the max columns count among them.<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Aug 28, 2014 at 2:56 PM, Michael Stahl <span dir="ltr"><<a href="mailto:mstahl@redhat.com" target="_blank">mstahl@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On 28/08/14 20:43, Grover Blue wrote:<br>
> I have a Writer document with a table that has two rows and 5 columns.<br>
> When XTextTable is first created, xTextTable.getColumns().getCount()<br>
> returns the correct count of 5. When I merge 4 columns in the first row,<br>
> xTextTable.getColumns().getCount() then returns a count of 2. But that's<br>
> wrong, since row 2 has 5 columns.<br>
><br>
><br>
> Is this a bug?  If not, how to properly get the number of columns/rows<br>
> in a table?<br>
<br>
</div></div>must be this function:<br>
<br>
> sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException, std::exception )<br>
> {<br>
>    ...<br>
>         SwTable* pTable = SwTable::FindTable( pFrmFmt );<br>
>         if(!pTable->IsTblComplex())<br>
>         {<br>
>             SwTableLines& rLines = pTable->GetTabLines();<br>
>             SwTableLine* pLine = rLines.front();<br>
>             nRet = pLine->GetTabBoxes().size();<br>
>         }<br>
>     }<br>
>     return nRet;<br>
> }<br>
<br>
as you see it just counts the cells in the first row of the table, and<br>
calls that the number of columns...<br>
<br>
whether that is correct or not is arguable: in core Writer tables, there<br>
are actually no columns; there are just rows, and each rows contains<br>
some number of cells, and there's no requirement that there must be the<br>
same number of cells in each row; the columns in the API wrappers then<br>
somehow badly try to emulate columns on top of the core rows-and-cells<br>
data structure...<br>
</blockquote></div><br><br clear="all"><br>-- <br>“If the American people ever allow private banks to control the issue of their currency, first by inflation, then by deflation, the banks...will deprive the people of all property until their children wake-up homeless on the continent their fathers conquered... The issuing power should be taken from the banks and restored to the people, to whom it properly belongs."   -- Thomas Jefferson<br>
<br>"Government big enough to supply everything...is big enough to take everything you have. The course of history shows that as a government grows, liberty decreases" --- Thomas Jefferson<br><br><a href="http://www.CampaignForLiberty.org">www.CampaignForLiberty.org</a>
</div>