DEBUG_MSG(L"Starting at node "<<initNode->getDebugInfo());\r
std::set<int> possibleBreaks;\r
//Find the node at which to limit the search for line endings.\r
- VBufStorage_fieldNode_t* limitNode=NULL;\r
- if(useScreenLayout) {\r
- for(limitNode=initNode->parent;limitNode!=NULL&&!limitNode->isBlock;limitNode=limitNode->parent);\r
- } else {\r
- limitNode=initNode->parent;\r
- }\r
- DEBUG_MSG(L"limit node is "<<limitNode->getDebugInfo());\r
+ VBufStorage_fieldNode_t* limitBlockNode=NULL;\r
+ for(limitBlockNode=initNode->parent;limitBlockNode!=NULL&&!limitBlockNode->isBlock;limitBlockNode=limitBlockNode->parent);\r
//Some needed variables for searching back and forward\r
VBufStorage_fieldNode_t* node=NULL;\r
int relative, bufferStart, bufferEnd, tempRelativeStart;\r
}\r
}\r
//Move on to the next node.\r
- node = node->nextNodeInTree(TREEDIRECTION_FORWARD,limitNode,&tempRelativeStart);\r
+ node = node->nextNodeInTree(TREEDIRECTION_FORWARD,limitBlockNode,&tempRelativeStart);\r
//If not using screen layout, make sure not to pass in to another control field node\r
if(node&&((!useScreenLayout&&node->firstChild)||node->isBlock)) {\r
node=NULL;\r
}\r
}\r
//Move on to the previous node.\r
- node = node->nextNodeInTree(TREEDIRECTION_SYMMETRICAL_BACK,limitNode,&tempRelativeStart);\r
+ node = node->nextNodeInTree(TREEDIRECTION_SYMMETRICAL_BACK,useScreenLayout?limitBlockNode:node->parent,&tempRelativeStart);\r
//If not using screen layout, make sure not to pass in to another control field node\r
- if(node&&((!useScreenLayout&&node->firstChild)||node->isBlock)) {\r
+ if(node&&node->isBlock) {\r
node=NULL;\r
}\r
if(node) {\r