returns first text child element
| 9842 | |
| 9843 | /// returns first text child element |
| 9844 | ldomNode * ldomNode::getFirstTextChild(bool skipEmpty) |
| 9845 | { |
| 9846 | ASSERT_NODE_NOT_NULL; |
| 9847 | if ( isText() ) { |
| 9848 | if ( !skipEmpty ) |
| 9849 | return this; |
| 9850 | lString16 txt = getText(); |
| 9851 | bool nonSpaceFound = false; |
| 9852 | for ( unsigned i=0; i<txt.length(); i++ ) { |
| 9853 | lChar16 ch = txt[i]; |
| 9854 | if ( ch!=' ' && ch!='\t' && ch!='\r' && ch!='\n' ) { |
| 9855 | nonSpaceFound = true; |
| 9856 | break; |
| 9857 | } |
| 9858 | } |
| 9859 | if ( nonSpaceFound ) |
| 9860 | return this; |
| 9861 | return NULL; |
| 9862 | } |
| 9863 | for ( int i=0; i<(int)getChildCount(); i++ ) { |
| 9864 | ldomNode * p = getChildNode(i)->getFirstTextChild(skipEmpty); |
| 9865 | if (p) |
| 9866 | return p; |
| 9867 | } |
| 9868 | return NULL; |
| 9869 | } |
| 9870 | |
| 9871 | /// returns last text child element |
| 9872 | ldomNode * ldomNode::getLastTextChild() |
no test coverage detected