Date: prev next · Thread: first prev next last
2014 Archives by date, by thread · List index


So, really, I want to grab all rows and find the max columns count among
them.


On Thu, Aug 28, 2014 at 2:56 PM, Michael Stahl <mstahl@redhat.com> wrote:

On 28/08/14 20:43, Grover Blue wrote:
I have a Writer document with a table that has two rows and 5 columns.
When XTextTable is first created, xTextTable.getColumns().getCount()
returns the correct count of 5. When I merge 4 columns in the first row,
xTextTable.getColumns().getCount() then returns a count of 2. But that's
wrong, since row 2 has 5 columns.


Is this a bug?  If not, how to properly get the number of columns/rows
in a table?

must be this function:

sal_Int32 SwXTableColumns::getCount(void) throw( uno::RuntimeException,
std::exception )
{
   ...
        SwTable* pTable = SwTable::FindTable( pFrmFmt );
        if(!pTable->IsTblComplex())
        {
            SwTableLines& rLines = pTable->GetTabLines();
            SwTableLine* pLine = rLines.front();
            nRet = pLine->GetTabBoxes().size();
        }
    }
    return nRet;
}

as you see it just counts the cells in the first row of the table, and
calls that the number of columns...

whether that is correct or not is arguable: in core Writer tables, there
are actually no columns; there are just rows, and each rows contains
some number of cells, and there's no requirement that there must be the
same number of cells in each row; the columns in the API wrappers then
somehow badly try to emulate columns on top of the core rows-and-cells
data structure...




-- 
“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

"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

www.CampaignForLiberty.org

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.