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

Function FindNextNode

crengine/src/lvtinydom.cpp:4261–4287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4259
4260
4261bool FindNextNode( ldomNode * & node, ldomNode * root )
4262{
4263 if ( node->getChildCount()>0 ) {
4264 // first child
4265 node = node->getChildNode(0);
4266 return true;
4267 }
4268 if (node->isRoot() || node == root )
4269 return false; // root node reached
4270 int index = node->getNodeIndex();
4271 ldomNode * parent = node->getParentNode();
4272 while (parent)
4273 {
4274 if ( index < (int)parent->getChildCount()-1 ) {
4275 // next sibling
4276 node = parent->getChildNode( index + 1 );
4277 return true;
4278 }
4279 if (parent->isRoot() || parent == root )
4280 return false; // root node reached
4281 // up one level
4282 index = parent->getNodeIndex();
4283 parent = parent->getParentNode();
4284 }
4285 //if ( node->getNodeType() == LXML_TEXT_NODE )
4286 return false;
4287}
4288
4289// base64 decode table
4290static const signed char base64_decode_table[] = {

Callers 1

findNextTextNodeMethod · 0.85

Calls 5

getChildNodeMethod · 0.80
isRootMethod · 0.80
getNodeIndexMethod · 0.80
getParentNodeMethod · 0.80
getChildCountMethod · 0.45

Tested by

no test coverage detected