Establishes the number of column headers. If there are no <th> headers there will still be columns. Method is to check if there has been an edit (any additional tags) since the last report (of either row or column count). If not then the value held in m_NoCols is returned. Otherwise the columns are counted explicitly. In the absence of the row of table headers, the column count will be the row with the maximum number of columns. Arguments: None
| Return Type | Function name | Arguments |
|---|---|---|
| uint32_t | hzHtmTbl::Colcount | (void) |
Declared in file: hzDocument.h
Defined in file : hzDocHtml.cpp
Function Logic:
Function body:
uint32_t hzHtmTbl::Colcount (void)
{
// Establishes the number of column headers. If there are no <th> headers there will still be columns.
//
// Method is to check if there has been an edit (any additional tags) since the last report (of either row or column count). If not then the value held in
// m_NoCols is returned. Otherwise the columns are counted explicitly. In the absence of the row of table headers, the column count will be the row with
// the maximum number of columns.
//
// Arguments: None
// Returns: Number of columns
hzHtmElem* pE ; // Table row tags
hzHtmElem* pC ; // Columns
if (!m_nCols)
{
pE = GetFirstChild() ;
for (pC = pE->GetFirstChild() ; pC ; pC = pC->Sibling())
{
if (pC->Type() != HTAG_TH)
continue ;
m_nCols++ ;
}
}
return m_nCols ;
}