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


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

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.