summaryrefslogtreecommitdiffstats
path: root/quanta/parsers/parser.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-16 19:02:47 +0000
commite985f7e545f4739493965aad69bbecb136dc9346 (patch)
tree54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /quanta/parsers/parser.cpp
parentf7670c198945adc3b95ad69a959fe5f8ae55b493 (diff)
downloadtdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.tar.gz
tdewebdev-e985f7e545f4739493965aad69bbecb136dc9346.zip
TQt4 port kdewebdev
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1237029 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/parsers/parser.cpp')
-rw-r--r--quanta/parsers/parser.cpp286
1 files changed, 143 insertions, 143 deletions
diff --git a/quanta/parsers/parser.cpp b/quanta/parsers/parser.cpp
index 707d97b0..0a9441db 100644
--- a/quanta/parsers/parser.cpp
+++ b/quanta/parsers/parser.cpp
@@ -115,13 +115,13 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
bool nodeFound = false;
bool goUp;
Node *rootNode = 0L;
- Node *parentNode = a_node;
+ Node *tqparentNode = a_node;
Node *currentNode = a_node;
if (currentNode && (currentNode->tag->type != Tag::XmlTag ||
currentNode->tag->single))
- parentNode = currentNode->parent;
+ tqparentNode = currentNode->tqparent;
Tag *tag = 0L;
- QTag *qTag = 0L;
+ TQTag *qTag = 0L;
textLine.append(write->text(startLine, startCol, startLine, write->editIf->lineLength(startLine)));
if (line == endLine)
{
@@ -137,21 +137,21 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
nodeFound = false;
goUp = false;
//find the first "<" and the first special area start definition in this line
- tagStartPos = textLine.find('<', col);
- specialStartPos = specialAreaCount ? textLine.find(m_dtd->specialAreaStartRx, col): -1;
+ tagStartPos = textLine.tqfind('<', col);
+ specialStartPos = specialAreaCount ? textLine.tqfind(m_dtd->specialAreaStartRx, col): -1;
//if the special area start definition is before the first "<" it means
//that we have found a special area
if ( specialStartPos != -1 &&
(specialStartPos <= tagStartPos || tagStartPos == -1) )
{
- currentNode = ParserCommon::createTextNode(write, currentNode, line, specialStartPos, parentNode);
+ currentNode = ParserCommon::createTextNode(write, currentNode, line, specialStartPos, tqparentNode);
if (!rootNode)
rootNode = currentNode;
TQString foundText = m_dtd->specialAreaStartRx.cap();
//create a toplevel node for the special area
AreaStruct area(line, specialStartPos, line, specialStartPos + foundText.length() - 1);
- Node *node = ParserCommon::createScriptTagNode(write, area, foundText, m_dtd, parentNode, currentNode);
- if (node->parent && node->prev == node->parent) //some strange cases, but it's possible, eg.: <a href="<? foo ?>""></a><input size="<? foo ?>" >
+ Node *node = ParserCommon::createScriptTagNode(write, area, foundText, m_dtd, tqparentNode, currentNode);
+ if (node->tqparent && node->prev == node->tqparent) //some strange cases, but it's possible, eg.: <a href="<? foo ?>""></a><input size="<? foo ?>" >
{
node->prev->next = 0L;
node->prev = 0L;
@@ -263,37 +263,37 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
tag->name.truncate(tag->name.length() - 1);
}
//the tag we found indicates the beginning of a special area, like <script type=... >
- if (m_dtd->specialTags.contains(tag->name.lower()) && !tag->single)
+ if (m_dtd->specialTags.tqcontains(tag->name.lower()) && !tag->single)
{
//TODO: handle goUp here
- Node *node = new Node(parentNode);
+ Node *node = new Node(tqparentNode);
nodeNum++;
node->tag = tag;
node->insideSpecial = true;
- if (currentNode && currentNode != parentNode)
+ if (currentNode && currentNode != tqparentNode)
{
currentNode->next = node;
node->prev = currentNode;
} else
{
- if (parentNode)
- parentNode->child = node;
+ if (tqparentNode)
+ tqparentNode->child = node;
}
if (!rootNode)
rootNode = node;
//find the DTD that needs to be used for the special area
TQString tmpStr = m_dtd->specialTags[tag->name.lower()];
- int defPos = tmpStr.find('[');
+ int defPos = tmpStr.tqfind('[');
TQString defValue;
if (defPos != 0)
{
- defValue = tmpStr.mid(defPos+1, tmpStr.findRev(']')-defPos-1).stripWhiteSpace();
+ defValue = tmpStr.mid(defPos+1, tmpStr.tqfindRev(']')-defPos-1).stripWhiteSpace();
tmpStr = tmpStr.left(defPos);
}
TQString s = tag->attributeValue(tmpStr);
if (s.isEmpty())
s = defValue;
- const DTDStruct *dtd = DTDs::ref()->find(s);
+ const DTDStruct *dtd = DTDs::ref()->tqfind(s);
if (!dtd)
dtd = m_dtd;
//a trick here: replace the node's DTD with this one //Note: with the new SAParser, the top level nodes must be Tag::ScriptTag-s!
@@ -315,21 +315,21 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
}
qTag = 0L;
- goUp = ( parentNode &&
- ( (tag->type == Tag::XmlTagEnd && QuantaCommon::closesTag(parentNode->tag, tag)
+ goUp = ( tqparentNode &&
+ ( (tag->type == Tag::XmlTagEnd && QuantaCommon::closesTag(tqparentNode->tag, tag)
) ||
- parentNode->tag->single )
+ tqparentNode->tag->single )
);
- if (parentNode && !goUp)
+ if (tqparentNode && !goUp)
{
- qTag = QuantaCommon::tagFromDTD(m_dtd, parentNode->tag->name);
+ qTag = QuantaCommon::tagFromDTD(m_dtd, tqparentNode->tag->name);
if ( qTag )
{
TQString searchFor = (m_dtd->caseSensitive)?tag->name:tag->name.upper();
searchFor.remove('/');
- if ( qTag->stoppingTags.contains(searchFor))
+ if ( qTag->stoppingTags.tqcontains(searchFor))
{
- parentNode->tag->closingMissing = true; //parent is single...
+ tqparentNode->tag->closingMissing = true; //tqparent is single...
goUp = true;
}
}
@@ -340,9 +340,9 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
if (nodeFound)
{
//first create a text/empty node between the current position and the last node
- Node *savedParentNode = parentNode;
- currentNode = ParserCommon::createTextNode(write, currentNode, tagStartLine, tagStartPos, parentNode);
- if (savedParentNode != parentNode)
+ Node *savedParentNode = tqparentNode;
+ currentNode = ParserCommon::createTextNode(write, currentNode, tagStartLine, tagStartPos, tqparentNode);
+ if (savedParentNode != tqparentNode)
goUp = false;
if (!rootNode)
rootNode = currentNode;
@@ -351,31 +351,31 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
if (goUp)
{
//handle cases like <ul><li></ul>
- if (tag->type == Tag::XmlTagEnd && !QuantaCommon::closesTag(parentNode->tag, tag))
+ if (tag->type == Tag::XmlTagEnd && !QuantaCommon::closesTag(tqparentNode->tag, tag))
{
- while ( parentNode->parent &&
- QuantaCommon::closesTag(parentNode->parent->tag, tag)
+ while ( tqparentNode->tqparent &&
+ QuantaCommon::closesTag(tqparentNode->tqparent->tag, tag)
)
{
- parentNode = parentNode->parent;
+ tqparentNode = tqparentNode->tqparent;
}
} else
if (qTag && tag->type != Tag::XmlTagEnd)
{
- //handle the case when a tag is a stopping tag for parent, and grandparent and so on.
- Node *n = parentNode;
+ //handle the case when a tag is a stopping tag for tqparent, and grandtqparent and so on.
+ Node *n = tqparentNode;
TQString searchFor = (m_dtd->caseSensitive)?tag->name:tag->name.upper();
while (qTag && n)
{
qTag = QuantaCommon::tagFromDTD(m_dtd, n->tag->name);
if ( qTag )
{
- if ( qTag->stoppingTags.contains(searchFor) )
+ if ( qTag->stoppingTags.tqcontains(searchFor) )
{
- n->tag->closingMissing = true; //parent is single...
- if (n->parent)
- parentNode = n;
- n = n->parent;
+ n->tag->closingMissing = true; //tqparent is single...
+ if (n->tqparent)
+ tqparentNode = n;
+ n = n->tqparent;
} else
{
break;
@@ -384,29 +384,29 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
}
}
- node = new Node(parentNode->parent);
+ node = new Node(tqparentNode->tqparent);
nodeNum++;
- node->prev = parentNode;
- parentNode->next = node;
- parentNode = parentNode->parent;
+ node->prev = tqparentNode;
+ tqparentNode->next = node;
+ tqparentNode = tqparentNode->tqparent;
node->closesPrevious = true;
} else
{
- node = new Node(parentNode);
+ node = new Node(tqparentNode);
nodeNum++;
- if (currentNode && currentNode != parentNode)
+ if (currentNode && currentNode != tqparentNode)
{
currentNode->next = node;
node->prev = currentNode;
} else
{
- if (parentNode)
+ if (tqparentNode)
{
- if (!parentNode->child)
- parentNode->child = node;
+ if (!tqparentNode->child)
+ tqparentNode->child = node;
else
{
- Node *n = parentNode->child;
+ Node *n = tqparentNode->child;
while (n->next)
n = n->next;
n->next = node;
@@ -416,7 +416,7 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
}
}
if (!tag->single)
- parentNode = node;
+ tqparentNode = node;
node->tag = tag;
if (tag->type == Tag::NeedsParsing)
@@ -467,7 +467,7 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
#endif
cleanGroups();
m_saParser->setParsingEnabled(true);
- currentNode = m_saParser->parseArea(area, "", "", parentNode, true, true); //TODO: don't parse in detail here
+ currentNode = m_saParser->parseArea(area, "", "", tqparentNode, true, true); //TODO: don't parse in detail here
m_saParser->setParsingEnabled(false);
el = m_saParser->lastParsedLine();
ec = m_saParser->lastParsedColumn();
@@ -484,16 +484,16 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
el = endLine;
ec = endCol + 1;
}
- currentNode = ParserCommon::createTextNode(write, currentNode, el, ec, parentNode);
+ currentNode = ParserCommon::createTextNode(write, currentNode, el, ec, tqparentNode);
} else
if (el != endLine || ec != endCol)
{
if (currentNode && currentNode->tag->type == Tag::ScriptTag)
{
- parentNode = currentNode;
+ tqparentNode = currentNode;
currentNode = 0L;
}
- currentNode = ParserCommon::createTextNode(write, currentNode, endLine, endCol, parentNode);
+ currentNode = ParserCommon::createTextNode(write, currentNode, endLine, endCol, tqparentNode);
}
if (!rootNode)
rootNode = currentNode;
@@ -621,13 +621,13 @@ Node *Parser::nodeAt(int line, int col, bool findDeepest, bool exact)
node = node->child;
} else
{
- if (node->parent)
+ if (node->tqparent)
{
- int parentEl, parentEc;
- node->parent->tag->endPos(parentEl, parentEc);
- if (!exact && QuantaCommon::isBetween(line, col, bl, bc, parentEl, parentEc) == 0)
+ int tqparentEl, tqparentEc;
+ node->tqparent->tag->endPos(tqparentEl, tqparentEc);
+ if (!exact && QuantaCommon::isBetween(line, col, bl, bc, tqparentEl, tqparentEc) == 0)
{
- node = node->parent;
+ node = node->tqparent;
}
}
break; //we found the node
@@ -635,8 +635,8 @@ Node *Parser::nodeAt(int line, int col, bool findDeepest, bool exact)
} else
if (result == -1)
{
- if (node->parent)
- node = node->parent;
+ if (node->tqparent)
+ node = node->tqparent;
break; //we found the node
} else
{
@@ -653,9 +653,9 @@ Node *Parser::nodeAt(int line, int col, bool findDeepest, bool exact)
if (node && node->tag->type == Tag::Empty &&
(findDeepest || (bl == el && ec < bc)) )
{
- if (node->parent)
+ if (node->tqparent)
{
- node = node->parent;
+ node = node->tqparent;
} else
if (node->prev)
{
@@ -807,7 +807,7 @@ bool Parser::invalidArea(Document *w, AreaStruct &area, Node **firstNode, Node *
void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs)
{
- Node *nextNode, *child, *parent, *next, *prev;
+ Node *nextNode, *child, *tqparent, *next, *prev;
int i, j;
Node *node = firstNode;
bool closesPrevious = false;
@@ -819,7 +819,7 @@ void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs)
nextNode = node->nextSibling();
node->removeAll = false;
child = node->child;
- parent = node->parent;
+ tqparent = node->tqparent;
next = node->next;
prev = node->prev;
closesPrevious = node->closesPrevious;
@@ -827,9 +827,9 @@ void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs)
{
nextNode->prev = prev;
}
- if (nextNode && nextNode->parent == node)
+ if (nextNode && nextNode->tqparent == node)
{
- nextNode->parent = parent;
+ nextNode->tqparent = tqparent;
}
if (next)
next->prev = prev;
@@ -845,9 +845,9 @@ void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs)
modif->setLocation(kafkaCommon::getLocation(node));
if (prev && prev->next == node)
prev->next = 0L;
- if(parent && parent->child == node)
- parent->child = 0L;
- node->parent = 0L;
+ if(tqparent && tqparent->child == node)
+ tqparent->child = 0L;
+ node->tqparent = 0L;
node->next = 0L;
node->prev = 0L;
@@ -860,17 +860,17 @@ void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs)
j = 0;
if (!closesPrevious)
{
- //move the children up one level
+ //move the tqchildren up one level
Node *n = child;
Node *m = child;
while (n)
{
m = n;
- n->parent = parent;
+ n->tqparent = tqparent;
n = n->next;
i++;
}
- //connect the first child to the tree (after prev, or as the first child of the parent)
+ //connect the first child to the tree (after prev, or as the first child of the tqparent)
if (prev && child)
{
prev->next = child;
@@ -882,7 +882,7 @@ void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs)
}
} else
{
- if (!child) //when there is no child, connect the next as the first child of the parent
+ if (!child) //when there is no child, connect the next as the first child of the tqparent
child = next;
else
if (next)
@@ -893,14 +893,14 @@ void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs)
n->next = next;
next->prev = n;
}
- if (parent && !parent->child)
+ if (tqparent && !tqparent->child)
{
- parent->child = child;
+ tqparent->child = child;
}
}
} else
{
- //change the parent of children, so the prev will be the new parent
+ //change the tqparent of tqchildren, so the prev will be the new tqparent
if (child)
{
Node *n = child;
@@ -908,7 +908,7 @@ void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs)
while (n)
{
m = n;
- n->parent = prev;
+ n->tqparent = prev;
n = n->next;
i++;
}
@@ -928,7 +928,7 @@ void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs)
prev->child = child;
}
}
- //move down the nodes starting with next one level and append to the list of children of prev
+ //move down the nodes starting with next one level and append to the list of tqchildren of prev
if (next)
{
if (prev->child) //if the previous node has a child, append the next node after the last child
@@ -953,7 +953,7 @@ void Parser::deleteNodes(Node *firstNode, Node *lastNode, NodeModifsSet *modifs)
Node *n = next;
while (n)
{
- n->parent = prev;
+ n->tqparent = prev;
n = n->next;
j++;
}
@@ -1020,7 +1020,7 @@ Node *Parser::rebuild(Document *w)
return n;
}
- kdDebug(24000) << TQString("Invalid area: %1,%2,%3,%4").arg(area.bLine).arg(area.bCol).arg(area.eLine).arg(area.eCol) << "\n";
+ kdDebug(24000) << TQString("Invalid area: %1,%2,%3,%4").tqarg(area.bLine).tqarg(area.bCol).tqarg(area.eLine).tqarg(area.eCol) << "\n";
// kdDebug(24000) << "lastNode1: " << lastNode << " " << lastNode->tag << endl;
deleteNodes(firstNode->nextSibling(), lastNode, modifs);
@@ -1053,8 +1053,8 @@ Node *Parser::rebuild(Document *w)
{
if (lastNode->prev )
lastNode->prev->next = 0L;
- if (lastNode->parent && lastNode->parent->child == lastNode)
- lastNode->parent->child = 0L;
+ if (lastNode->tqparent && lastNode->tqparent->child == lastNode)
+ lastNode->tqparent->child = 0L;
}
Node::deleteNode(lastNode);
nodeNum--;
@@ -1077,7 +1077,7 @@ Node *Parser::rebuild(Document *w)
lastNode->prev = lastInserted->prev;
if (lastInserted->prev)
lastInserted->prev->next = lastNode;
- lastNode->parent = lastInserted->parent;
+ lastNode->tqparent = lastInserted->tqparent;
lastInserted->tag->beginPos(area.bLine, area.bCol);
lastNode->tag->endPos(area.eLine, area.eCol);
Tag *_tag = new Tag(*(lastNode->tag));
@@ -1091,9 +1091,9 @@ Node *Parser::rebuild(Document *w)
{
lastNode->tag->type = Tag::Empty;
}
- if (lastInserted->parent && lastInserted->parent->child == lastInserted)
- //lastInserted->parent->child = lastInserted->next; lastInserted has no next!
- lastInserted->parent->child = lastNode;
+ if (lastInserted->tqparent && lastInserted->tqparent->child == lastInserted)
+ //lastInserted->tqparent->child = lastInserted->next; lastInserted has no next!
+ lastInserted->tqparent->child = lastNode;
//here, lastNode is at the pos of lastInserted.
modif = new NodeModif();
@@ -1102,11 +1102,11 @@ Node *Parser::rebuild(Document *w)
if(lastInserted->prev)
lastInserted->prev->next = 0L;
- if(lastInserted->parent && lastInserted->parent->child == lastInserted)
- lastInserted->parent->child = 0L;
+ if(lastInserted->tqparent && lastInserted->tqparent->child == lastInserted)
+ lastInserted->tqparent->child = 0L;
lastInserted->prev = 0L;
lastInserted->next = 0L;
- lastInserted->parent = 0L;
+ lastInserted->tqparent = 0L;
lastInserted->child = 0L;
// delete lastInserted;
@@ -1127,63 +1127,63 @@ Node *Parser::rebuild(Document *w)
node = lastInserted;
// kdDebug(24000) << "lastNode5: " << lastNode << " " << lastNode->tag << endl;
- QTag *qTag = 0L;
+ TQTag *qTag = 0L;
while (node && lastNode)
{
// kdDebug(24000) << "lastNode6: " << lastNode << " " << lastNode->tag << endl;
qTag = 0L;
- goUp = ( node->parent &&
- ( (lastNode->tag->type == Tag::XmlTagEnd && QuantaCommon::closesTag(node->parent->tag, lastNode->tag) ) ||
- node->parent->tag->single )
+ goUp = ( node->tqparent &&
+ ( (lastNode->tag->type == Tag::XmlTagEnd && QuantaCommon::closesTag(node->tqparent->tag, lastNode->tag) ) ||
+ node->tqparent->tag->single )
);
- if (node->parent && !goUp)
+ if (node->tqparent && !goUp)
{
- qTag = QuantaCommon::tagFromDTD(m_dtd, node->parent->tag->name);
+ qTag = QuantaCommon::tagFromDTD(m_dtd, node->tqparent->tag->name);
if ( qTag )
{
TQString searchFor = (m_dtd->caseSensitive)?lastNode->tag->name:lastNode->tag->name.upper();
searchFor.remove('/');
- if ( qTag->stoppingTags.contains( searchFor ) )
+ if ( qTag->stoppingTags.tqcontains( searchFor ) )
{
- node->parent->tag->closingMissing = true; //parent is single...
+ node->tqparent->tag->closingMissing = true; //tqparent is single...
goUp = true;
}
}
}
if (goUp &&
- ( (m_dtd->caseSensitive && node->tag->name == node->parent->tag->name) ||
- (!m_dtd->caseSensitive && node->tag->name.lower() == node->parent->tag->name.lower())) )
- goUp = false; //it can happen that the tag closes the previous and not the parent
+ ( (m_dtd->caseSensitive && node->tag->name == node->tqparent->tag->name) ||
+ (!m_dtd->caseSensitive && node->tag->name.lower() == node->tqparent->tag->name.lower())) )
+ goUp = false; //it can happen that the tag closes the previous and not the tqparent
- if (goUp) //lastnode closes the node->parent
+ if (goUp) //lastnode closes the node->tqparent
{
//handle cases like <ul><li></ul>
if (lastNode->tag->type == Tag::XmlTagEnd &&
- !QuantaCommon::closesTag(node->parent->tag, lastNode->tag))
+ !QuantaCommon::closesTag(node->tqparent->tag, lastNode->tag))
{
- while ( node->parent->parent &&
- QuantaCommon::closesTag(node->parent->parent->tag, lastNode->tag)
+ while ( node->tqparent->tqparent &&
+ QuantaCommon::closesTag(node->tqparent->tqparent->tag, lastNode->tag)
)
{
- node = node->parent;
+ node = node->tqparent;
}
} else
if (qTag && lastNode->tag->type != Tag::XmlTagEnd)
{
- //handle the case when a tag is a stopping tag for parent, and grandparent and so on. I'm not sure it's needed here, but anyway...
- Node *n = node->parent;
+ //handle the case when a tag is a stopping tag for tqparent, and grandtqparent and so on. I'm not sure it's needed here, but anyway...
+ Node *n = node->tqparent;
TQString searchFor = (m_dtd->caseSensitive) ? lastNode->tag->name : lastNode->tag->name.upper();
while (qTag && n)
{
qTag = QuantaCommon::tagFromDTD(m_dtd, n->tag->name);
if ( qTag )
{
- if ( qTag->stoppingTags.contains(searchFor) )
+ if ( qTag->stoppingTags.tqcontains(searchFor) )
{
- n->tag->closingMissing = true; //parent is single...
- if (n->parent)
+ n->tag->closingMissing = true; //tqparent is single...
+ if (n->tqparent)
node = n;
- n = n->parent;
+ n = n->tqparent;
} else
{
break;
@@ -1193,15 +1193,15 @@ Node *Parser::rebuild(Document *w)
}
if (lastNode->prev && lastNode->prev->next == lastNode)
lastNode->prev->next = 0L;
- if (lastNode->parent && lastNode->parent->child == lastNode)
- lastNode->parent->child = 0L;
- if (node->parent)
- node->parent->next = lastNode;
- lastNode->prev = node->parent;
- if (node->parent)
- lastNode->parent = node->parent->parent;
+ if (lastNode->tqparent && lastNode->tqparent->child == lastNode)
+ lastNode->tqparent->child = 0L;
+ if (node->tqparent)
+ node->tqparent->next = lastNode;
+ lastNode->prev = node->tqparent;
+ if (node->tqparent)
+ lastNode->tqparent = node->tqparent->tqparent;
else
- lastNode->parent = 0L;
+ lastNode->tqparent = 0L;
node->next = 0L;
lastNode->closesPrevious = true;
} else
@@ -1210,14 +1210,14 @@ Node *Parser::rebuild(Document *w)
lastNode->prev->next = 0L;
node->next = lastNode;
lastNode->prev = node;
- lastNode->parent = node->parent;
+ lastNode->tqparent = node->tqparent;
// kdDebug(24000) << "lastNode7: " << lastNode << " " << lastNode->tag << endl;
}
node = lastNode;
lastNode = lastNode->nextNotChild();
//For some reason this can happen, the lastNode can point to an invalid place.
//To avoid crashes, forget the rebuild and do a full parse instead.
- if (!nodes.contains(lastNode))
+ if (!nodes.tqcontains(lastNode))
{
kdDebug(24000) << "Lastnode is invalid, do a full reparse!" << endl;
logReparse(modifs, w);
@@ -1433,12 +1433,12 @@ void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd)
TQString specialEndStr;
while (areaPos != -1)
{
- areaPos = content.find(dtd->specialAreaStartRx, lastAreaPos);
+ areaPos = content.tqfind(dtd->specialAreaStartRx, lastAreaPos);
if (areaPos != -1)
{
foundStr = dtd->specialAreaStartRx.cap();
specialEndStr = dtd->specialAreas[foundStr];
- int areaPos2 = content.find(specialEndStr, areaPos);
+ int areaPos2 = content.tqfind(specialEndStr, areaPos);
if (areaPos2 == -1)
{
areaPos2 = content.length();
@@ -1456,7 +1456,7 @@ void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd)
int structPos = 0;
while (structPos !=-1)
{
- structPos = foundStr.find(dtd->structBeginStr, structPos);
+ structPos = foundStr.tqfind(dtd->structBeginStr, structPos);
if (structPos != -1)
{
structPositions.append(structPos);
@@ -1494,14 +1494,14 @@ void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd)
foundStr = foundStr.left(pos);
TQString spaces;
spaces.fill(' ', pos - structPos + 1);
- foundStr.replace(structPos, pos - structPos + 1, spaces);
+ foundStr.tqreplace(structPos, pos - structPos + 1, spaces);
//FIXME: This code replaces the content between ( ) with
//empty spaces. This is quite PHP (or functions) //specific, and it's done in order to not find variables
//declared as function arguments. A generic way is needed
//to exclude unwanted areas.
- int openBracketPos = foundStr.findRev(dtd->structKeywordsRx, structPos);
- openBracketPos = foundStr.find('(', openBracketPos);
+ int openBracketPos = foundStr.tqfindRev(dtd->structKeywordsRx, structPos);
+ openBracketPos = foundStr.tqfind('(', openBracketPos);
openNum = 1;
if (openBracketPos != -1)
{
@@ -1517,7 +1517,7 @@ void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd)
}
closeBracketPos--;
spaces.fill(' ', closeBracketPos - openBracketPos);
- foundStr.replace(openBracketPos, closeBracketPos - openBracketPos, spaces);
+ foundStr.tqreplace(openBracketPos, closeBracketPos - openBracketPos, spaces);
}
//now check which groups are present in this area
@@ -1548,29 +1548,29 @@ void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd)
}
TQString s = content.mid(areaPos + pos, l);
pos += l;
- if (!(*elements)[group.name].contains(s))
+ if (!(*elements)[group.name].tqcontains(s))
{
Tag *tag = new Tag();
tag->name = s;
tag->setDtd(dtd);
tag->setWrite(write);
TQString s2 = content.left(areaPos + pos);
- int newLineNum = s2.contains('\n');
- int tmpCol = s2.length() - s2.findRev('\n') - 1;
+ int newLineNum = s2.tqcontains('\n');
+ int tmpCol = s2.length() - s2.tqfindRev('\n') - 1;
tag->setTagPosition(newLineNum, tmpCol - s.length(), newLineNum, tmpCol);
Node *node = new Node(0L);
node->tag = tag;
node->fileName = fileName;
GroupElement *groupElement = new GroupElement;
groupElement->node = node;
- groupElement->parentNode = 0L;
+ groupElement->tqparentNode = 0L;
int minPos = areaPos + pos + 1;
for (TQValueList<GroupElementPosition>::Iterator gPosIt = gPositions.begin(); gPosIt != gPositions.end(); ++gPosIt)
{
GroupElementPosition gPos = (*gPosIt);
if ( (areaPos + pos > gPos.startPos) && (areaPos + pos < gPos.endPos) && (gPos.startPos < minPos))
{
- groupElement->parentNode = gPos.element->node;
+ groupElement->tqparentNode = gPos.element->node;
minPos = gPos.startPos;
}
}
@@ -1585,12 +1585,12 @@ void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd)
if (group.appendToTags)
{
- QTag *qTag = new QTag();
- qTag->setName(s.left(s.find('(')));
+ TQTag *qTag = new TQTag();
+ qTag->setName(s.left(s.tqfind('(')));
qTag->className = "";
- if (groupElement->parentNode)
- qTag->className = groupElement->parentNode->tag->name;
- write->userTagList.replace(s.lower(), qTag);
+ if (groupElement->tqparentNode)
+ qTag->className = groupElement->tqparentNode->tag->name;
+ write->userTagList.tqreplace(s.lower(), qTag);
}
}
}
@@ -1606,7 +1606,7 @@ void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd)
void Parser::slotIncludedFileChanged(const TQString& fileName)
{
- int pos = ParserCommon::includedFiles.findIndex(fileName);
+ int pos = ParserCommon::includedFiles.tqfindIndex(fileName);
if (pos != -1)
{
const DTDStruct *dtd = ParserCommon::includedFilesDTD.at(pos);
@@ -1635,7 +1635,7 @@ void Parser::slotIncludedFileChanged(const TQString& fileName)
void Parser::parseForXMLGroup(Node *node)
{
- xmlGroupIt = node->tag->dtd()->xmlStructTreeGroups.find(node->tag->name.lower());
+ xmlGroupIt = node->tag->dtd()->xmlStructTreeGroups.tqfind(node->tag->name.lower());
if (xmlGroupIt != node->tag->dtd()->xmlStructTreeGroups.end())
{
XMLStructGroup group = xmlGroupIt.data();
@@ -1658,7 +1658,7 @@ void Parser::parseForXMLGroup(Node *node)
groupElement->deleted = false;
groupElement->tag = newTag;
groupElement->node = node;
- groupElement->parentNode = 0L;
+ groupElement->tqparentNode = 0L;
groupElement->global = true;
groupElement->group = const_cast<XMLStructGroup*>(&(xmlGroupIt.data()));
node->m_groupElements.append(groupElement);
@@ -1690,17 +1690,17 @@ bool Parser::parseScriptInsideTag(Node *startNode)
while (pos != -1)
{
- pos = text.find(dtd->specialAreaStartRx, col);
+ pos = text.tqfind(dtd->specialAreaStartRx, col);
if (pos != -1)
{
foundText = dtd->specialAreaStartRx.cap();
//Calculate the beginning coordinates
s = text.left(pos);
- n = s.contains('\n');
+ n = s.tqcontains('\n');
bl = node_bl + n;
if (n > 0)
{
- bc = pos - s.findRev('\n') - 1;
+ bc = pos - s.tqfindRev('\n') - 1;
} else
{
bc = node_bc + pos;