MCPcopy Create free account
hub / github.com/buggins/coolreader / initTableRendMethods

Function initTableRendMethods

crengine/src/lvtinydom.cpp:3731–3827  ·  view source on GitHub ↗

init table element render methods states: 0=table, 1=colgroup, 2=rowgroup, 3=row, 4=cell returns table cell count

Source from the content-addressed store, hash-verified

3729// states: 0=table, 1=colgroup, 2=rowgroup, 3=row, 4=cell
3730// returns table cell count
3731int initTableRendMethods( ldomNode * enode, int state )
3732{
3733 //main node: table
3734 if ( state==0 && enode->getStyle()->display==css_d_table )
3735 enode->setRendMethod( erm_table ); // for table
3736 int cellCount = 0;
3737 int cnt = enode->getChildCount();
3738 int i;
3739 for (i=0; i<cnt; i++)
3740 {
3741 ldomNode * child = enode->getChildNode( i );
3742 if ( child->isElement() )
3743 {
3744 switch( child->getStyle()->display )
3745 {
3746 case css_d_table_caption:
3747 if ( state==0 ) {
3748 child->setRendMethod( erm_table_caption );
3749 } else {
3750 child->setRendMethod( erm_invisible );
3751 }
3752 break;
3753 case css_d_inline:
3754 {
3755 }
3756 break;
3757 case css_d_table_row_group:
3758 if ( state==0 ) {
3759 child->setRendMethod( erm_table_row_group );
3760 cellCount += initTableRendMethods( child, 2 );
3761 } else {
3762 child->setRendMethod( erm_invisible );
3763 }
3764 break;
3765 case css_d_table_header_group:
3766 if ( state==0 ) {
3767 child->setRendMethod( erm_table_header_group );
3768 cellCount += initTableRendMethods( child, 2);
3769 } else {
3770 child->setRendMethod( erm_invisible );
3771 }
3772 break;
3773 case css_d_table_footer_group:
3774 if ( state==0 ) {
3775 child->setRendMethod( erm_table_footer_group );
3776 cellCount += initTableRendMethods( child, 2 );
3777 } else {
3778 child->setRendMethod( erm_invisible );
3779 }
3780 break;
3781 case css_d_table_row:
3782 if ( state==0 || state==2 ) {
3783 child->setRendMethod( erm_table_row );
3784 cellCount += initTableRendMethods( child, 3 );
3785 } else {
3786 child->setRendMethod( erm_invisible );
3787 }
3788 break;

Callers 1

initNodeRendMethodMethod · 0.85

Calls 6

getStyleMethod · 0.80
setRendMethodMethod · 0.80
getChildNodeMethod · 0.80
getChildCountMethod · 0.45
isElementMethod · 0.45

Tested by

no test coverage detected