diff options
Diffstat (limited to 'quanta/parts/kafka/kafkacommon.cpp')
-rw-r--r-- | quanta/parts/kafka/kafkacommon.cpp | 414 |
1 files changed, 207 insertions, 207 deletions
diff --git a/quanta/parts/kafka/kafkacommon.cpp b/quanta/parts/kafka/kafkacommon.cpp index 5d4c5714..0d15ca02 100644 --- a/quanta/parts/kafka/kafkacommon.cpp +++ b/quanta/parts/kafka/kafkacommon.cpp @@ -52,9 +52,9 @@ Node *kafkaCommon::getNextNode(Node *node, bool &goUp, Node *endNode) } else { - if(node->parent == endNode) + if(node->tqparent == endNode) return 0L; - return getNextNode(node->parent, goUp); + return getNextNode(node->tqparent, goUp); } } else @@ -74,9 +74,9 @@ Node *kafkaCommon::getNextNode(Node *node, bool &goUp, Node *endNode) else { goUp = true; - if(node->parent == endNode) + if(node->tqparent == endNode) return 0L; - return getNextNode(node->parent, goUp); + return getNextNode(node->tqparent, goUp); } } } @@ -119,7 +119,7 @@ Node* kafkaCommon::getPrevNode(Node *node, Node *endNode) } else { - n = n->parent; + n = n->tqparent; if(n == endNode) return 0L; } @@ -171,13 +171,13 @@ Node* kafkaCommon::DTDGetCommonParent(Node* startNode, Node* endNode, if(commonParent && (commonParent->tag->type == Tag::Text || commonParent->tag->type == Tag::Empty)) { Node* oldCommonParent = commonParent; - commonParent = commonParent->parent; + commonParent = commonParent->tqparent; commonParentStartChild = oldCommonParent; commonParentEndChild = oldCommonParent; } //startNode or endNode can't be the commonParent. else if(commonParent && (itStart == startNodeLocation.end() || itEnd == endNodeLocation.end())) - commonParent = commonParent->parent; + commonParent = commonParent->tqparent; commonParentStartChildLocation = getLocation(commonParentStartChild); commonParentEndChildLocation = getLocation(commonParentEndChild); @@ -222,18 +222,18 @@ Node* kafkaCommon::DTDGetNonInlineCommonParent(Node* startNode, Node* endNode, commonParent->tag->type == Tag::Text || commonParent->tag->type == Tag::Empty)) { Node* oldCommonParent = commonParent; - commonParent = commonParent->parent; + commonParent = commonParent->tqparent; while(commonParent && isInline(commonParent->tag->name)) { oldCommonParent = commonParent; - commonParent = commonParent->parent; + commonParent = commonParent->tqparent; } commonParentStartChild = oldCommonParent; commonParentEndChild = oldCommonParent; } //startNode or endNode can't be the commonParent. else if(commonParent && (itStart == startNodeLocation.end() || itEnd == endNodeLocation.end())) - commonParent = commonParent->parent; + commonParent = commonParent->tqparent; commonParentStartChildLocation = getLocation(commonParentStartChild); commonParentEndChildLocation = getLocation(commonParentEndChild); @@ -365,7 +365,7 @@ void kafkaCommon::applyIndentation(Node *node, int nbOfSpaces, int nbOfTabs, Nod kdDebug(25001)<< "kafkaCommon::applyIndentation()" << endl; #endif - Node *parent, *nextNE, *prevNE, *realPrevNE, *realNextNE, *realPrev, *realNext, *prev, *next; + Node *tqparent, *nextNE, *prevNE, *realPrevNE, *realNextNE, *realPrev, *realNext, *prev, *next; int nonInlineDepth = 0, nonInlineDepth2 = 0, i; bool b = false; TQString indentation1, indentation2, text; @@ -383,12 +383,12 @@ void kafkaCommon::applyIndentation(Node *node, int nbOfSpaces, int nbOfTabs, Nod realNext = node->next; if(inlineNodeIndentation && - !node->prev && getNodeDisplay(node->parent, true) == kafkaCommon::blockDisplay) + !node->prev && getNodeDisplay(node->tqparent, true) == kafkaCommon::blockDisplay) { AreaStruct node_area = node->tag->area(); - AreaStruct parent_area = node->parent->tag->area(); + AreaStruct tqparent_area = node->tqparent->tag->area(); - if(node_area.bLine == parent_area.bLine) + if(node_area.bLine == tqparent_area.bLine) { node->tag->setIndentationDone(true); return; @@ -400,30 +400,30 @@ void kafkaCommon::applyIndentation(Node *node, int nbOfSpaces, int nbOfTabs, Nod setTagString(node, removeUnnecessaryWhitespaces(node->tag->tagStr()), modifs); //compute the "non-inline depth" of the Node and of the next NE (not Empty) Node - // i.e. we count how many non-inline parent they have. - parent = node->parent; - while(parent) + // i.e. we count how many non-inline tqparent they have. + tqparent = node->tqparent; + while(tqparent) { - if(getNodeDisplay(parent, true) == kafkaCommon::blockDisplay) + if(getNodeDisplay(tqparent, true) == kafkaCommon::blockDisplay) ++nonInlineDepth; - parent = parent->parent; + tqparent = tqparent->tqparent; } //compute the "non-inline depth" of the next non-empty Node. if (nextNE) - parent = nextNE->parent; + tqparent = nextNE->tqparent; else - parent = 0L; - while(parent) + tqparent = 0L; + while(tqparent) { - if(getNodeDisplay(parent, true) == kafkaCommon::blockDisplay) + if(getNodeDisplay(tqparent, true) == kafkaCommon::blockDisplay) ++nonInlineDepth2; - parent = parent->parent; + tqparent = tqparent->tqparent; } - parent = node->parent; + tqparent = node->tqparent; - if(!parent || getNodeDisplay(parent, true) == kafkaCommon::blockDisplay) + if(!tqparent || getNodeDisplay(tqparent, true) == kafkaCommon::blockDisplay) { //prepare the indentation indentation1 = "\n"; @@ -507,7 +507,7 @@ void kafkaCommon::applyIndentation(Node *node, int nbOfSpaces, int nbOfTabs, Nod } else { - //The parent is inline, so no indentation. + //The tqparent is inline, so no indentation. //Nothing to do. } node->tag->setIndentationDone(true); @@ -519,7 +519,7 @@ void kafkaCommon::fitIndentationNodes(Node *n1, Node *n2, NodeModifsSet *modifs) kdDebug(25001)<< "kafkaCommon::fitIndentationNodes()" << endl; #endif - Node *parent, *child, *node, *emptyNode = 0L, *emptyNode2 = 0L; + Node *tqparent, *child, *node, *emptyNode = 0L, *emptyNode2 = 0L; int nbEmptyNodes = 0, n1Depth, n2Depth; bool lastChild = false, firstChild = false; @@ -534,16 +534,16 @@ void kafkaCommon::fitIndentationNodes(Node *n1, Node *n2, NodeModifsSet *modifs) if(n1Depth > n2Depth) { child = n1; - parent = n2; + tqparent = n2; } else { child = n2; - parent = n1; + tqparent = n1; } - if(child->parent->firstChildNE() == child) + if(child->tqparent->firstChildNE() == child) firstChild = true; - if(child->parent->lastChildNE() == child) + if(child->tqparent->lastChildNE() == child) lastChild = true; //counting the Empty Nodes and deleting them to have only one empty node. @@ -591,11 +591,11 @@ void kafkaCommon::fitIndentationNodes(Node *n1, Node *n2, NodeModifsSet *modifs) //adding/deleting a empty node if necessary if(firstChild) { - if(getNodeDisplay(parent, true) == kafkaCommon::blockDisplay) + if(getNodeDisplay(tqparent, true) == kafkaCommon::blockDisplay) { if(child->tag->type != Tag::Text && !emptyNode) { - createAndInsertNode("", "", Tag::Empty, n2->tag->write(), child->parent, + createAndInsertNode("", "", Tag::Empty, n2->tag->write(), child->tqparent, child, child, modifs); } } @@ -610,11 +610,11 @@ void kafkaCommon::fitIndentationNodes(Node *n1, Node *n2, NodeModifsSet *modifs) if(lastChild) { - if(getNodeDisplay(parent, true) == kafkaCommon::blockDisplay) + if(getNodeDisplay(tqparent, true) == kafkaCommon::blockDisplay) { if(child->tag->type != Tag::Text && !emptyNode2) { - createAndInsertNode("", "", Tag::Empty, n2->tag->write(), child->parent, + createAndInsertNode("", "", Tag::Empty, n2->tag->write(), child->tqparent, 0L, 0L, modifs); } } @@ -654,8 +654,8 @@ void kafkaCommon::fitIndentationNodes(Node *n1, Node *n2, NodeModifsSet *modifs) } //adding/deleting a empty node if necessary - parent = n1->parent; - if(!parent || getNodeDisplay(parent, true) == kafkaCommon::blockDisplay) + tqparent = n1->tqparent; + if(!tqparent || getNodeDisplay(tqparent, true) == kafkaCommon::blockDisplay) { if(getNodeDisplay(n1, true) == kafkaCommon::blockDisplay && n1->tag->type != Tag::Text) @@ -672,7 +672,7 @@ void kafkaCommon::fitIndentationNodes(Node *n1, Node *n2, NodeModifsSet *modifs) } else { - createAndInsertNode("", "", Tag::Empty, n2->tag->write(), parent, n2, n2, modifs); + createAndInsertNode("", "", Tag::Empty, n2->tag->write(), tqparent, n2, n2, modifs); } } } @@ -694,7 +694,7 @@ void kafkaCommon::fitIndentationNodes(Node *n1, Node *n2, NodeModifsSet *modifs) } else { - createAndInsertNode("", "", Tag::Empty, n2->tag->write(), parent, n2, n2, modifs); + createAndInsertNode("", "", Tag::Empty, n2->tag->write(), tqparent, n2, n2, modifs); } } } @@ -770,7 +770,7 @@ int kafkaCommon::getNodeDisplay(Node *node, bool closingNodeToo) closingNodeToo)) { //If we areusing a non (X)HTML DTD, make everything blockDisplay by default - if(node->tag->dtd() && node->tag->dtd()->name.contains("HTML", false) == 0) + if(node->tag->dtd() && node->tag->dtd()->name.tqcontains("HTML", false) == 0) return kafkaCommon::blockDisplay; nodeName = node->tag->name.lower(); @@ -948,7 +948,7 @@ Node *kafkaCommon::createXmlDeclarationNode(Document *doc, const TQString &encod Node* kafkaCommon::createMandatoryNodeSubtree(Node *node, Document *doc) { - QTag *nodeQTag, *oldNodeQTag; + TQTag *nodeTQTag, *oldNodeTQTag; bool searchForMandatoryNode; Node *currentParent; TQMap<TQString, bool>::iterator it; @@ -956,28 +956,28 @@ Node* kafkaCommon::createMandatoryNodeSubtree(Node *node, Document *doc) if(!node) return 0L; - nodeQTag = QuantaCommon::tagFromDTD(node); - if(!nodeQTag) + nodeTQTag = QuantaCommon::tagFromDTD(node); + if(!nodeTQTag) return false; searchForMandatoryNode = true; currentParent = node; while(searchForMandatoryNode) { - oldNodeQTag = nodeQTag; - for(it = nodeQTag->childTags.begin(); it != nodeQTag->childTags.end(); ++it) + oldNodeTQTag = nodeTQTag; + for(it = nodeTQTag->childTags.begin(); it != nodeTQTag->childTags.end(); ++it) { if(it.data()) { - nodeQTag = QuantaCommon::tagFromDTD(nodeQTag->parentDTD, it.key()); - if(!nodeQTag) + nodeTQTag = QuantaCommon::tagFromDTD(nodeTQTag->tqparentDTD, it.key()); + if(!nodeTQTag) return node; - currentParent = createAndInsertNode(nodeQTag->name(), "", Tag::XmlTag, doc, + currentParent = createAndInsertNode(nodeTQTag->name(), "", Tag::XmlTag, doc, currentParent, 0L, 0L, (NodeModifsSet*)0L); break; } } - if(oldNodeQTag == nodeQTag) + if(oldNodeTQTag == nodeTQTag) searchForMandatoryNode = false; } @@ -998,7 +998,7 @@ Node* kafkaCommon::insertNode(Node *node, Node* parentNode, Node* nextSibling, if(!node) return 0L; - //Reset the listviews items pointers for node and its children + //Reset the listviews items pointers for node and its tqchildren n = node; b = false; while(n) @@ -1028,7 +1028,7 @@ Node* kafkaCommon::insertNode(Node *node, Node* parentNode, Node* nextSibling, nodeIsFirstChild = true; parentNode->child = node; } - node->parent = parentNode; + node->tqparent = parentNode; if(nextSibling && nextSibling->prev) { @@ -1099,7 +1099,7 @@ Node* kafkaCommon::insertNode(Node *node, Node* parentNode, Node* nextSibling, N if(!node) return 0L; - //Reset the listviews items pointers for node and its children + //Reset the listviews items pointers for node and its tqchildren n = node; b = false; while(n) @@ -1129,7 +1129,7 @@ Node* kafkaCommon::insertNode(Node *node, Node* parentNode, Node* nextSibling, N nodeIsFirstChild = true; parentNode->child = node; } - node->parent = parentNode; + node->tqparent = parentNode; if(nextSibling && nextSibling->prev) { @@ -1186,7 +1186,7 @@ Node* kafkaCommon::insertNode(Node *node, Node* parentNode, Node* nextSibling, N return node; } -Node *kafkaCommon::insertNode(Node *newNode, Node *parent, Node *nextSibling, Node *nextEndSibling, +Node *kafkaCommon::insertNode(Node *newNode, Node *tqparent, Node *nextSibling, Node *nextEndSibling, NodeModifsSet *modifs, bool merge) { #ifdef LIGHT_DEBUG @@ -1199,7 +1199,7 @@ Node *kafkaCommon::insertNode(Node *newNode, Node *parent, Node *nextSibling, No return 0L; //place the new Node. - newNode = insertNode(newNode, parent, nextSibling, modifs, merge); + newNode = insertNode(newNode, tqparent, nextSibling, modifs, merge); if(!newNode->tag->single && newNode->tag->type == Tag::XmlTag) { @@ -1208,7 +1208,7 @@ Node *kafkaCommon::insertNode(Node *newNode, Node *parent, Node *nextSibling, No nodeEnd->closesPrevious = true; //place the new closing Node. - nodeEnd = insertNode(nodeEnd, parent, nextEndSibling, modifs, merge); + nodeEnd = insertNode(nodeEnd, tqparent, nextEndSibling, modifs, merge); } //If nextSibling != nextEndSibling, move all Nodes between node and nodeEnd as child of node @@ -1222,7 +1222,7 @@ Node *kafkaCommon::insertNode(Node *newNode, Node *parent, Node *nextSibling, No return newNode; } -Node* kafkaCommon::insertNode(Node *newNode, Node *parent, Node *startNodeToSurround, +Node* kafkaCommon::insertNode(Node *newNode, Node *tqparent, Node *startNodeToSurround, Node *endNodeToSurround, int startOffset, int endOffset, NodeModifsSet *modifs) { #ifdef LIGHT_DEBUG @@ -1246,7 +1246,7 @@ Node* kafkaCommon::insertNode(Node *newNode, Node *parent, Node *startNodeToSurr endNodeToSurround = endNodeToSurround->next; //Then create and insert the new Node. - return insertNode(newNode, parent, startNodeToSurround, + return insertNode(newNode, tqparent, startNodeToSurround, endNodeToSurround, modifs); } @@ -1389,13 +1389,13 @@ Node* kafkaCommon::DTDInsertNodeSubtree(Node *newNode, NodeSelectionInd& selecti { *cursorNode = newNode; cursorOffset = newNode->tag->tagStr().length(); - return insertNodeSubtree(newNode, startNode->parent, endNode, modifs); + return insertNodeSubtree(newNode, startNode->tqparent, endNode, modifs); } //Then we "split" the lastValidStartParent - startNode subtree into two : the first part is untouched // and the second will be surrounded by the new Node. Same thing for endNode. Node* node = startNode; - Node* parentNode = startNode->parent; + Node* parentNode = startNode->tqparent; Node* newParentNode = 0, *child = 0, *next = 0; while(parentNode && commonParent && parentNode != commonParent) { @@ -1404,10 +1404,10 @@ Node* kafkaCommon::DTDInsertNodeSubtree(Node *newNode, NodeSelectionInd& selecti //node is not the first Child of parentNode, we have to duplicate parentNode, and put node and //all its next sibling as child of the new parentNode. /**newParentNode = insertNode(parentNode->tag->name, parentNode->tag->tagStr(), - parentNode->tag->type, parentNode->tag->write(), parentNode->parentNode(), + parentNode->tag->type, parentNode->tag->write(), parentNode->tqparentNode(), parentNode, parentNode, modifs);*/ newParentNode = duplicateNode(parentNode); - insertNode(newParentNode, parentNode->parentNode(), parentNode, parentNode, modifs); + insertNode(newParentNode, parentNode->tqparentNode(), parentNode, parentNode, modifs); child = parentNode->firstChild(); if(cursorOffset != 0) { @@ -1433,13 +1433,13 @@ Node* kafkaCommon::DTDInsertNodeSubtree(Node *newNode, NodeSelectionInd& selecti } //commonParentStartChild = parentNode; node = parentNode; - parentNode = parentNode->parent; + parentNode = parentNode->tqparent; } if(endNode) { node = endNode; - parentNode = endNode->parent; + parentNode = endNode->tqparent; while(parentNode && commonParent && parentNode != commonParent) { if(true/*node != parentNode->firstChild()*/) @@ -1447,10 +1447,10 @@ Node* kafkaCommon::DTDInsertNodeSubtree(Node *newNode, NodeSelectionInd& selecti //node is not the first Child of parentNode, we have to duplicate parentNode, and put node and //all its next sibling as child of the new parentNode. /**newParentNode = insertNode(parentNode->tag->name, parentNode->tag->tagStr(), - parentNode->tag->type, parentNode->tag->write(), parentNode->parentNode(), + parentNode->tag->type, parentNode->tag->write(), parentNode->tqparentNode(), parentNode, parentNode, modifs);*/ newParentNode = duplicateNode(parentNode); - insertNode(newParentNode, parentNode->parentNode(), parentNode, parentNode, modifs); + insertNode(newParentNode, parentNode->tqparentNode(), parentNode, parentNode, modifs); child = parentNode->firstChild(); while(child /*&& child == endNode*/ && (child == endNode || child->hasForChild(endNode)/* || @@ -1464,7 +1464,7 @@ Node* kafkaCommon::DTDInsertNodeSubtree(Node *newNode, NodeSelectionInd& selecti commonParentStartChild = newParentNode; node = parentNode; Node* aux = parentNode; - parentNode = parentNode->parent; + parentNode = parentNode->tqparent; // Remove node subtree if empty if(!aux->hasChildNodes()) extractAndDeleteNode(aux, modifs); @@ -1487,8 +1487,8 @@ Node* kafkaCommon::DTDInsertNodeSubtree(Node *newNode, NodeSelectionInd& selecti Node* kafkaCommon::DTDInsertNodeSubtree(Node* newNode, Node* parentNode, Node* nextSibling, NodeSelection& /*cursorHolder*/, NodeModifsSet *modifs) { - QTag* nodeQTag = QuantaCommon::tagFromDTD(parentNode); - if(!nodeQTag || !nodeQTag->isChild(newNode)) + TQTag* nodeTQTag = QuantaCommon::tagFromDTD(parentNode); + if(!nodeTQTag || !nodeTQTag->isChild(newNode)) return 0; else return insertNodeSubtree(newNode, parentNode, nextSibling, modifs); @@ -1506,7 +1506,7 @@ bool kafkaCommon::DTDinsertNode(Node *newNode, Node *startNode, int startOffset, Node *commonParent = 0L, *commonParentStartChild, *commonParentEndChild, *parentNode, *node; Node *lastValidStartParent = 0L, *lastValidEndParent = 0L, *newParentNode, *child, *next; Node *oldCommonParent, *lastNewNode, *oldParentNode; - QTag *parentNodeQTag = 0, *newNodeQTag, *lastNewNodeQTag; + TQTag *parentNodeTQTag = 0, *newNodeTQTag, *lastNewNodeTQTag; NodeModif modif; int locOffset = 1; bool newNodeIsInline, isAfter; @@ -1519,16 +1519,16 @@ bool kafkaCommon::DTDinsertNode(Node *newNode, Node *startNode, int startOffset, //FIrst get the mandatory Nodes if necessary, and get the qTag of the first and last Node. lastNewNode = createMandatoryNodeSubtree(newNode, doc); - lastNewNodeQTag = QuantaCommon::tagFromDTD(lastNewNode); - newNodeQTag = QuantaCommon::tagFromDTD(newNode); - if(!newNodeQTag || !lastNewNodeQTag) + lastNewNodeTQTag = QuantaCommon::tagFromDTD(lastNewNode); + newNodeTQTag = QuantaCommon::tagFromDTD(newNode); + if(!newNodeTQTag || !lastNewNodeTQTag) { Node::deleteNode(newNode); return false; } - //Then search for the common parent of startNode and endNode (commonParent) - //and for the childs of commonParent which are parent of startNode and endNode + //Then search for the common tqparent of startNode and endNode (commonParent) + //and for the childs of commonParent which are tqparent of startNode and endNode //(commonParentStartChild && commonParentEndChild) //CommonParent will be the limit (startNode -- commonNode) where Nodes can //be splitted in order to insert the newNode. @@ -1559,51 +1559,51 @@ bool kafkaCommon::DTDinsertNode(Node *newNode, Node *startNode, int startOffset, commonParent->tag->type == Tag::Text || commonParent->tag->type == Tag::Empty)) { oldCommonParent = commonParent; - commonParent = commonParent->parent; + commonParent = commonParent->tqparent; while(commonParent && isInline(commonParent->tag->name)) { oldCommonParent = commonParent; - commonParent = commonParent->parent; + commonParent = commonParent->tqparent; } commonParentStartChild = oldCommonParent; commonParentEndChild = oldCommonParent; } //startNode or endNode can't be the commonParent. else if(commonParent && (itStart == startNodeLocation.end() || itEnd == endNodeLocation.end())) - commonParent = commonParent->parent; + commonParent = commonParent->tqparent; - //Now look if at least one of the parent Nodes between startNode and commonParent + //Now look if at least one of the tqparent Nodes between startNode and commonParent //can have nodeName as child. If so for startNode and endNode, let's find the last - //parent Nodes which can have nodeName as child. - parentNode = startNode->parent; + //tqparent Nodes which can have nodeName as child. + parentNode = startNode->tqparent; oldParentNode = startNode; - while(parentNode && commonParent && parentNode != commonParent->parent) + while(parentNode && commonParent && parentNode != commonParent->tqparent) { - parentNodeQTag = QuantaCommon::tagFromDTD(parentNode); - if(parentNodeQTag && parentNodeQTag->isChild(newNode) && - lastNewNodeQTag->isChild(oldParentNode)) + parentNodeTQTag = QuantaCommon::tagFromDTD(parentNode); + if(parentNodeTQTag && parentNodeTQTag->isChild(newNode) && + lastNewNodeTQTag->isChild(oldParentNode)) lastValidStartParent = parentNode; else if(newNodeIsInline || !isInline(parentNode->tag->name)) break; //else if(!newNodeIsInline && isInline(parentNode)), we continue : BLOCK element can //cut some inline tag in order to be inserted. oldParentNode = parentNode; - parentNode = parentNode->parent; + parentNode = parentNode->tqparent; } - parentNode = endNode->parent; + parentNode = endNode->tqparent; oldParentNode = endNode; - while(parentNode && commonParent && parentNode != commonParent->parent) + while(parentNode && commonParent && parentNode != commonParent->tqparent) { - parentNodeQTag = QuantaCommon::tagFromDTD(parentNode); - if(parentNodeQTag && parentNodeQTag->isChild(newNode) && - lastNewNodeQTag->isChild(oldParentNode)) + parentNodeTQTag = QuantaCommon::tagFromDTD(parentNode); + if(parentNodeTQTag && parentNodeTQTag->isChild(newNode) && + lastNewNodeTQTag->isChild(oldParentNode)) lastValidEndParent = parentNode; else if(newNodeIsInline || !isInline(parentNode->tag->name)) break; //else if(!newNodeIsInline && isInline(parentNode)), we continue : BLOCK element can //cut some inline tag in order to be inserted. oldParentNode = parentNode; - parentNode = parentNode->parent; + parentNode = parentNode->tqparent; } /**if(!lastValidEndParent || !lastValidStartParent) @@ -1662,7 +1662,7 @@ bool kafkaCommon::DTDinsertNode(Node *newNode, Node *startNode, int startOffset, node = startNode; if (!startNode) //Andras: it can happen. return false; - parentNode = startNode->parent; + parentNode = startNode->tqparent; while(lastValidStartParent && parentNode && parentNode != lastValidStartParent) { if(node != parentNode->firstChild()) @@ -1670,10 +1670,10 @@ bool kafkaCommon::DTDinsertNode(Node *newNode, Node *startNode, int startOffset, //node is not the first Child of parentNode, we have to duplicate parentNode, and put node and //all its next sibling as child of the new parentNode. /**newParentNode = insertNode(parentNode->tag->name, parentNode->tag->tagStr(), - parentNode->tag->type, parentNode->tag->write(), parentNode->parentNode(), + parentNode->tag->type, parentNode->tag->write(), parentNode->tqparentNode(), parentNode, parentNode, modifs);*/ newParentNode = duplicateNode(parentNode); - insertNode(newParentNode, parentNode->parentNode(), parentNode, parentNode, modifs); + insertNode(newParentNode, parentNode->tqparentNode(), parentNode, parentNode, modifs); child = parentNode->firstChild(); while(child && child != startNode && !child->hasForChild(startNode)) { @@ -1683,10 +1683,10 @@ bool kafkaCommon::DTDinsertNode(Node *newNode, Node *startNode, int startOffset, } } node = parentNode; - parentNode = parentNode->parent; + parentNode = parentNode->tqparent; } node = endNode; - parentNode = endNode->parent; + parentNode = endNode->tqparent; while(lastValidEndParent && parentNode && parentNode != lastValidEndParent) { if(node != parentNode->lastChild()) @@ -1694,10 +1694,10 @@ bool kafkaCommon::DTDinsertNode(Node *newNode, Node *startNode, int startOffset, //node is not the last Child of parentNode, we have to duplicate parentNode, and put all //the next sibling of node as child of the new parentNode /**newParentNode = insertNode(parentNode->tag->name, parentNode->tag->tagStr(), - parentNode->tag->type, parentNode->tag->write(), parentNode->parentNode(), + parentNode->tag->type, parentNode->tag->write(), parentNode->tqparentNode(), parentNode, parentNode, modifs);*/ newParentNode = duplicateNode(parentNode); - insertNode(newParentNode, parentNode->parentNode(), parentNode, parentNode, modifs); + insertNode(newParentNode, parentNode->tqparentNode(), parentNode, parentNode, modifs); if(parentNode == commonParentStartChild) commonParentStartChild = newParentNode; if(parentNode == commonParentEndChild) @@ -1717,7 +1717,7 @@ bool kafkaCommon::DTDinsertNode(Node *newNode, Node *startNode, int startOffset, } } node = parentNode; - parentNode = parentNode->parent; + parentNode = parentNode->tqparent; } //Now if startNode is after endNode, this means that a selectionless insertion is being done. @@ -1728,19 +1728,19 @@ bool kafkaCommon::DTDinsertNode(Node *newNode, Node *startNode, int startOffset, (signed)startNode->tag->tagStr().length() == startOffset)) { if(isAfter) - parentNodeQTag = QuantaCommon::tagFromDTD(commonParent); + parentNodeTQTag = QuantaCommon::tagFromDTD(commonParent); else if((signed)startNode->tag->tagStr().length() == startOffset && startNode->tag->type == Tag::XmlTag) - parentNodeQTag = QuantaCommon::tagFromDTD(startNode); + parentNodeTQTag = QuantaCommon::tagFromDTD(startNode); else if((signed)startNode->tag->tagStr().length() == startOffset && startNode->tag->type == Tag::XmlTagEnd) - parentNodeQTag = QuantaCommon::tagFromDTD(startNode->parent); - if(!parentNodeQTag || (parentNodeQTag && parentNodeQTag->isChild(newNode))) + parentNodeTQTag = QuantaCommon::tagFromDTD(startNode->tqparent); + if(!parentNodeTQTag || (parentNodeTQTag && parentNodeTQTag->isChild(newNode))) { if(isAfter) insertNodeSubtree(newNode, commonParent, commonParentStartChild, modifs); else if((signed)startNode->tag->tagStr().length() == startOffset && startNode->tag->type == Tag::XmlTag) insertNodeSubtree(newNode, startNode, 0L, modifs); else if((signed)startNode->tag->tagStr().length() == startOffset && startNode->tag->type == Tag::XmlTagEnd) - insertNodeSubtree(newNode, startNode->parent, startNode->next, modifs); + insertNodeSubtree(newNode, startNode->tqparent, startNode->next, modifs); //<TEMPORARY> (*cursorNode) = lastNewNode; cursorOffset = 0; @@ -1798,7 +1798,7 @@ bool kafkaCommon::DTDinsertRemoveNode(Node *newNode, Node *startNode, int startO } Node *kafkaCommon::createAndInsertNode(const TQString &nodeName, const TQString &tagString, - int nodeType, Document *doc, Node* parent, Node* nextSibling, NodeModifsSet *modifs, + int nodeType, Document *doc, Node* tqparent, Node* nextSibling, NodeModifsSet *modifs, bool merge) { #ifdef LIGHT_DEBUG @@ -1812,13 +1812,13 @@ Node *kafkaCommon::createAndInsertNode(const TQString &nodeName, const TQString node = createNode(nodeName, tagString, nodeType, doc); //insert the new Node. - insertNode(node, parent, nextSibling, modifs, merge); + insertNode(node, tqparent, nextSibling, modifs, merge); return node; } Node *kafkaCommon::createAndInsertNode(const TQString &nodeName, const TQString &tagString, - int nodeType, Document *doc, Node *parent, Node *nextSibling, Node *nextEndSibling, + int nodeType, Document *doc, Node *tqparent, Node *nextSibling, Node *nextEndSibling, NodeModifsSet *modifs) { #ifdef LIGHT_DEBUG @@ -1832,13 +1832,13 @@ Node *kafkaCommon::createAndInsertNode(const TQString &nodeName, const TQString node = createNode(nodeName, tagString, nodeType, doc); //insert the new Node. - insertNode(node, parent, nextSibling, nextEndSibling, modifs); + insertNode(node, tqparent, nextSibling, nextEndSibling, modifs); return node; } Node *kafkaCommon::createAndInsertNode(const TQString &nodeName, const TQString &tagString, - int nodeType, Document *doc, Node *parent, Node *startNodeToSurround, + int nodeType, Document *doc, Node *tqparent, Node *startNodeToSurround, Node *endNodeToSurround, int startOffset, int endOffset, NodeModifsSet *modifs) { #ifdef LIGHT_DEBUG @@ -1855,7 +1855,7 @@ Node *kafkaCommon::createAndInsertNode(const TQString &nodeName, const TQString node = createNode(nodeName, tagString, nodeType, doc); //insert the new Node. - insertNode(node, parent, startNodeToSurround, endNodeToSurround, startOffset, endOffset, + insertNode(node, tqparent, startNodeToSurround, endNodeToSurround, startOffset, endOffset, modifs); return node; @@ -1891,18 +1891,18 @@ bool kafkaCommon::addNodeRecursively(Node *newNode, Node *leafNode, NodeModifsSet *modifs) { - QTag *leafNodeQTag, *currentNodeParentQTag; + TQTag *leafNodeTQTag, *currentNodeParentTQTag; Node *startSelection = 0L, *endSelection = 0L, *oldCurrentNode, *copyNewNode; bool selectionInProgress = false, validCurNodeParent = false; - leafNodeQTag = QuantaCommon::tagFromDTD(leafNode); - if(!leafNodeQTag) + leafNodeTQTag = QuantaCommon::tagFromDTD(leafNode); + if(!leafNodeTQTag) return false; - if(currentNode && currentNode->parent) + if(currentNode && currentNode->tqparent) { - currentNodeParentQTag = QuantaCommon::tagFromDTD(currentNode->parent); - if(currentNodeParentQTag && currentNodeParentQTag->isChild(newNode)) + currentNodeParentTQTag = QuantaCommon::tagFromDTD(currentNode->tqparent); + if(currentNodeParentTQTag && currentNodeParentTQTag->isChild(newNode)) validCurNodeParent = true; } @@ -1924,7 +1924,7 @@ bool kafkaCommon::addNodeRecursively(Node *newNode, Node *leafNode, //if the examination has started and currentNode doesn't have endExaminationNode as //child, let's start/extend the selection over this node. if((currentNode->tag->type == Tag::XmlTag || currentNode->tag->type == Tag::Text) && - leafNodeQTag->isChild(currentNode) && validCurNodeParent && examinationStarted && + leafNodeTQTag->isChild(currentNode) && validCurNodeParent && examinationStarted && !currentNode->hasForChild(endExaminationNode)) { #ifdef HEAVY_DEBUG @@ -1986,10 +1986,10 @@ bool kafkaCommon::addNodeRecursively(Node *newNode, Node *leafNode, if (startSelection && endSelection) { /**copyNewNode = duplicateNode(newNode); - insertNode(copyNewNode, startSelection->parentNode(), startSelection, + insertNode(copyNewNode, startSelection->tqparentNode(), startSelection, endSelection->next, modifs);*/ copyNewNode = duplicateNodeSubtree(newNode); - insertNodeSubtree(copyNewNode, startSelection->parentNode(), startSelection, + insertNodeSubtree(copyNewNode, startSelection->tqparentNode(), startSelection, endSelection->next, modifs); nodeInserted = true; } @@ -2067,10 +2067,10 @@ bool kafkaCommon::addNodeRecursively(Node *newNode, Node *leafNode, if (startSelection && endSelection) { /**copyNewNode = duplicateNode(newNode); - insertNode(copyNewNode, startSelection->parentNode(), startSelection, + insertNode(copyNewNode, startSelection->tqparentNode(), startSelection, endSelection->next, modifs);*/ copyNewNode = duplicateNodeSubtree(newNode); - insertNodeSubtree(copyNewNode, startSelection->parentNode(), startSelection, + insertNodeSubtree(copyNewNode, startSelection->tqparentNode(), startSelection, endSelection->next, modifs); nodeInserted = true; } @@ -2097,10 +2097,10 @@ bool kafkaCommon::addNodeRecursively(Node *newNode, Node *leafNode, while(endSelection && endSelection->tag->type == Tag::Empty) endSelection = endSelection->prev; /**copyNewNode = duplicateNode(newNode); - insertNode(copyNewNode, startSelection->parentNode(), startSelection, + insertNode(copyNewNode, startSelection->tqparentNode(), startSelection, endSelection->next, modifs);*/ copyNewNode = duplicateNodeSubtree(newNode); - insertNodeSubtree(copyNewNode, startSelection->parentNode(), startSelection, + insertNodeSubtree(copyNewNode, startSelection->tqparentNode(), startSelection, endSelection->next, modifs); nodeInserted = true; } @@ -2184,7 +2184,7 @@ Node *kafkaCommon::duplicateNodeSubtree(Node *node, bool childAndClosingTagOnly) newPrev = 0L; for(link = nodeLinkList.first(); link; link = nodeLinkList.next()) { - if(link->m_n1 == currentNode->parent) + if(link->m_n1 == currentNode->tqparent) newParent = link->m_n2; else if(link->m_n1 == currentNode->next) newNext = link->m_n2; @@ -2217,7 +2217,7 @@ Node* kafkaCommon::extractNode(Node *node, NodeModifsSet *modifs, bool extractCh { NodeModif *modif = 0, *modifChild; Node *lastChild, *curNode; - Node *parent, *next, *child, *n; + Node *tqparent, *next, *child, *n; //Node *prev; bool isSingle; int type; @@ -2231,7 +2231,7 @@ Node* kafkaCommon::extractNode(Node *node, NodeModifsSet *modifs, bool extractCh if(!node->child) extractChildren = true; - parent = node->parent; + tqparent = node->tqparent; next = node->next; //prev = node->prev; //Should this be used at all? child = node->child; @@ -2252,7 +2252,7 @@ Node* kafkaCommon::extractNode(Node *node, NodeModifsSet *modifs, bool extractCh modif->setType(NodeModif::NodeRemoved); modif->setLocation(getLocation(node)); - //log the children move if we don't extract the children + //log the tqchildren move if we don't extract the tqchildren if(!extractChildren) { location = getLocation(node); @@ -2284,18 +2284,18 @@ Node* kafkaCommon::extractNode(Node *node, NodeModifsSet *modifs, bool extractCh curNode = node->child; while(curNode) { - curNode->parent = node->parent; + curNode->tqparent = node->tqparent; curNode = curNode->next; } } - if(node->parent && node->parent->child == node) + if(node->tqparent && node->tqparent->child == node) { if(extractChildren) - node->parent->child = node->next; + node->tqparent->child = node->next; else - node->parent->child = node->child; + node->tqparent->child = node->child; } - node->parent = 0L; + node->tqparent = 0L; if(node->prev) { if(extractChildren) @@ -2643,7 +2643,7 @@ int kafkaCommon::DTDExtractNode(const TQString &nodeName, Document *doc, Node *s int startOffset, Node *endNode, int endOffset, Node **cursorNode, long &cursorOffset, NodeModifsSet *modifs) { - QTag *nodeNameQTag, *parentQTag; + TQTag *nodeNameTQTag, *tqparentTQTag; Node *node, *lastNodeNameStartNode, *lastNodeNameEndNode; Node *parentNode, *newParentNode, *child, *next; bool goUp, nodesRemoved = false, DTDError = false, result; @@ -2653,8 +2653,8 @@ int kafkaCommon::DTDExtractNode(const TQString &nodeName, Document *doc, Node *s return kafkaCommon::extractionBadParameters; //First check that nodeName is really inline and that an area is selected. - nodeNameQTag = QuantaCommon::tagFromDTD(doc->defaultDTD(), nodeName); - if(!nodeNameQTag) + nodeNameTQTag = QuantaCommon::tagFromDTD(doc->defaultDTD(), nodeName); + if(!nodeNameTQTag) return kafkaCommon::extractionBadParameters; if(!isInline(nodeName)) return kafkaCommon::extractionBadParameters; @@ -2671,8 +2671,8 @@ int kafkaCommon::DTDExtractNode(const TQString &nodeName, Document *doc, Node *s if(startNode == endNode && startOffset == endOffset) return kafkaCommon::extractionBadParameters; - //Then, process startNode and endNode : look if a nodeName parent is one of - //startNode/endNode's inline parents and if it is the case, split the necessary Nodes. + //Then, process startNode and endNode : look if a nodeName tqparent is one of + //startNode/endNode's inline tqparents and if it is the case, split the necessary Nodes. //The comparaison is made in lowercase, even in xml : it could be strange, for an user, to have //its nodes not removed because there are in the wrong case. node = startNode; @@ -2681,7 +2681,7 @@ int kafkaCommon::DTDExtractNode(const TQString &nodeName, Document *doc, Node *s { if(node->tag->name.lower() == nodeName.lower()) lastNodeNameStartNode = node; - node = node->parent; + node = node->tqparent; } node = endNode; lastNodeNameEndNode = 0L; @@ -2689,7 +2689,7 @@ int kafkaCommon::DTDExtractNode(const TQString &nodeName, Document *doc, Node *s { if(node->tag->name.lower() == nodeName.lower()) lastNodeNameEndNode = node; - node = node->parent; + node = node->tqparent; } if(startNode->tag->type == Tag::Text) @@ -2724,13 +2724,13 @@ int kafkaCommon::DTDExtractNode(const TQString &nodeName, Document *doc, Node *s if(lastNodeNameStartNode) { node = startNode; - parentNode = startNode->parent; - while(parentNode && parentNode != lastNodeNameStartNode->parent) + parentNode = startNode->tqparent; + while(parentNode && parentNode != lastNodeNameStartNode->tqparent) { if(node != parentNode->firstChild()) { newParentNode = duplicateNode(parentNode); - insertNode(newParentNode, parentNode->parentNode(), parentNode, parentNode, modifs); + insertNode(newParentNode, parentNode->tqparentNode(), parentNode, parentNode, modifs); child = parentNode->firstChild(); while(child && child != startNode && !child->hasForChild(startNode)) { @@ -2740,19 +2740,19 @@ int kafkaCommon::DTDExtractNode(const TQString &nodeName, Document *doc, Node *s } } node = parentNode; - parentNode = parentNode->parent; + parentNode = parentNode->tqparent; } } if(lastNodeNameEndNode) { node = endNode; - parentNode = endNode->parent; - while(parentNode && parentNode != lastNodeNameEndNode->parent) + parentNode = endNode->tqparent; + while(parentNode && parentNode != lastNodeNameEndNode->tqparent) { if(node != parentNode->SLastChild()) { newParentNode = duplicateNode(parentNode); - insertNode(newParentNode, parentNode->parentNode(), parentNode, parentNode, modifs); + insertNode(newParentNode, parentNode->tqparentNode(), parentNode, parentNode, modifs); if(parentNode == lastNodeNameStartNode) lastNodeNameStartNode = newParentNode; child = parentNode->firstChild(); @@ -2770,7 +2770,7 @@ int kafkaCommon::DTDExtractNode(const TQString &nodeName, Document *doc, Node *s } } node = parentNode; - parentNode = parentNode->parent; + parentNode = parentNode->tqparent; } } @@ -2782,13 +2782,13 @@ int kafkaCommon::DTDExtractNode(const TQString &nodeName, Document *doc, Node *s next = getNextNode(node, goUp); if(node->tag->type == Tag::XmlTag && node->tag->name.lower() == nodeName.lower()) { - parentQTag = QuantaCommon::tagFromDTD(node->parent); - if(parentQTag) + tqparentTQTag = QuantaCommon::tagFromDTD(node->tqparent); + if(tqparentTQTag) { child = node->firstChild(); while(child) { - if(!parentQTag->isChild(child)) + if(!tqparentTQTag->isChild(child)) DTDError = true; child = child->next; } @@ -2927,10 +2927,10 @@ bool kafkaCommon::splitNode(Node *n, int offset, NodeModifsSet *modifs) if(n->tag->type == Tag::Text) node = createAndInsertNode("#text", tagStr.right(tagStr.length() - offset), Tag::Text, n->tag->write(), - n->parent, n->next, modifs, false); + n->tqparent, n->next, modifs, false); else node = createAndInsertNode("", tagStr.right(tagStr.length() - offset), Tag::Empty, n->tag->write(), - n->parent, n->next, modifs, false); + n->tqparent, n->next, modifs, false); //Node's string is a part of n's clean string node->tag->setCleanStrBuilt(true); @@ -2944,14 +2944,14 @@ void kafkaCommon::splitStartNodeSubtree(Node* startNode, Node* commonParent, //Then we "split" the lastValidStartParent - startNode subtree into two : the first part is untouched // and the second will be surrounded by the new Node. Same thing for endNode. Node* node = startNode; - Node* parentNode = startNode->parent; + Node* parentNode = startNode->tqparent; Node* commonParentStartChild = 0; while(parentNode && commonParent && parentNode != commonParent) { if(node != parentNode->firstChild()) { Node* newParentNode = duplicateNode(parentNode); - insertNode(newParentNode, parentNode->parentNode(), parentNode, parentNode, modifs); + insertNode(newParentNode, parentNode->tqparentNode(), parentNode, parentNode, modifs); Node* child = parentNode->firstChild(); while(child && child != startNode && !child->hasForChild(startNode)) { @@ -2962,7 +2962,7 @@ void kafkaCommon::splitStartNodeSubtree(Node* startNode, Node* commonParent, } commonParentStartChild = parentNode; node = parentNode; - parentNode = parentNode->parent; + parentNode = parentNode->tqparent; } if(commonParentStartChild) @@ -2975,7 +2975,7 @@ void kafkaCommon::splitEndNodeSubtree(Node* endNode, Node* commonParent, bool subTree, NodeModifsSet* modifs) { Node* node = endNode; - Node* parentNode = endNode->parent; + Node* parentNode = endNode->tqparent; Node* aux = 0; if(subTree) @@ -2989,7 +2989,7 @@ void kafkaCommon::splitEndNodeSubtree(Node* endNode, Node* commonParent, if(node != parentNode->lastChild()) { Node* newParentNode = duplicateNode(parentNode); - insertNode(newParentNode, parentNode->parentNode(), parentNode, parentNode, modifs); + insertNode(newParentNode, parentNode->tqparentNode(), parentNode, parentNode, modifs); if(parentNode == commonParentStartChild) commonParentStartChild = newParentNode; if(parentNode == commonParentEndChild) @@ -3009,7 +3009,7 @@ void kafkaCommon::splitEndNodeSubtree(Node* endNode, Node* commonParent, } } node = parentNode; - parentNode = parentNode->parent; + parentNode = parentNode->tqparent; } commonParentStartChildLocation = getLocation(commonParentStartChild); commonParentEndChildLocation = getLocation(commonParentEndChild); @@ -3029,11 +3029,11 @@ void kafkaCommon::splitStartAndEndNodeSubtree(Node*& startNode, int startOffset, startNode = getCorrectStartNode(startNode, startOffset); endNode = getCorrectEndNode(endNode, endOffset); - // look for common parent + // look for common tqparent if(!commonParent) { if(extractInlineParentNodes) - // get the non inline common parent + // get the non inline common tqparent commonParent = DTDGetNonInlineCommonParent(startNode, endNode, commonParentStartChildLocation, commonParentEndChildLocation, subTree); else @@ -3075,7 +3075,7 @@ void kafkaCommon::splitStartAndEndNodeSubtree(Node*& startNode, int startOffset, } splitNode(endNode, endOffset, modifs); - // split start and end nodes subtree in function of common parent + // split start and end nodes subtree in function of common tqparent commonParentStartChildLocation = kafkaCommon::getLocation(commonParentStartChild); splitStartNodeSubtree(startNode, commonParent, commonParentStartChildLocation, modifs); @@ -3208,21 +3208,21 @@ bool kafkaCommon::mergeNodes(Node *n, Node *n2, NodeSelection& cursorHolder, Nod void kafkaCommon::mergeInlineNode(Node *startNode, Node *endNode, Node **cursorNode, long &cursorOffset, NodeModifsSet *modifs) { - Node *startNodeLastInlineParent, *parent, *node, *next; + Node *startNodeLastInlineParent, *tqparent, *node, *next; bool goUp, success, isCursorNode, isEndNode; int nodeLength; if(!startNode || !endNode) return; - //first search for the last inline parent of startNode, and then its last prev neighbour + //first search for the last inline tqparent of startNode, and then its last prev neighbour // which is also inline : the merge will start from this Node. startNodeLastInlineParent = startNode; - parent = startNode->parent; - while(parent && isInline(parent->tag->name)) + tqparent = startNode->tqparent; + while(tqparent && isInline(tqparent->tag->name)) { - startNodeLastInlineParent = parent; - parent = parent->parent; + startNodeLastInlineParent = tqparent; + tqparent = tqparent->tqparent; } if(startNodeLastInlineParent->prev) { @@ -3297,7 +3297,7 @@ void kafkaCommon::getEndPosition(const TQString &tagString, int bLine, int bCol, { /**int result, oldResult; - result = tagString.find("\n", 0); + result = tagString.tqfind("\n", 0); if(result == -1) { eLine = bLine; @@ -3310,7 +3310,7 @@ void kafkaCommon::getEndPosition(const TQString &tagString, int bLine, int bCol, { eLine++; oldResult = result; - result = tagString.find("\n", result + 1); + result = tagString.tqfind("\n", result + 1); } eCol = tagString.length() - oldResult - 2; }*/ @@ -3420,7 +3420,7 @@ TQValueList<int> kafkaCommon::getLocation(Node * node) node = node->prev; } loc.prepend(i); - node = node->parent; + node = node->tqparent; } return loc; } @@ -3634,11 +3634,11 @@ int kafkaCommon::nodeDepth(Node *node) if(!node) return -1; - node = node->parent; + node = node->tqparent; while(node) { depth++; - node = node->parent; + node = node->tqparent; } return depth; @@ -3646,12 +3646,12 @@ int kafkaCommon::nodeDepth(Node *node) Node* kafkaCommon::hasParent(Node *node, const TQString &name) { - node = node->parent; + node = node->tqparent; while(node) { if(node->tag->name.lower() == name.lower()) return node; - node = node->parent; + node = node->tqparent; } return 0L; @@ -3673,31 +3673,31 @@ Node* kafkaCommon::hasParent(Node* startNode, Node* endNode, const TQString &nam { if(node->tag->name.lower() == name.lower()) return node; - node = node->parent; + node = node->tqparent; } return 0; } -bool kafkaCommon::insertDomNode(DOM::Node node, DOM::Node parent, DOM::Node nextSibling, +bool kafkaCommon::insertDomNode(DOM::Node node, DOM::Node tqparent, DOM::Node nextSibling, DOM::Node rootNode) { if(node.isNull()) return false; - if(parent.isNull()) + if(tqparent.isNull()) { if(rootNode.isNull()) return false; - parent = rootNode; + tqparent = rootNode; } //Andras: avoid exceptions - if (!nextSibling.isNull() && nextSibling.parentNode() != parent) + if (!nextSibling.isNull() && nextSibling.parentNode() != tqparent) { kdDebug(25001)<< "kafkaCommon::insertDomNode() - invalid nextSibling!" << endl; return false; } - if (node.ownerDocument() != parent.ownerDocument()) + if (node.ownerDocument() != tqparent.ownerDocument()) { kdDebug(25001)<< "kafkaCommon::insertDomNode() - ownerDocument is different!" << endl; return false; @@ -3705,7 +3705,7 @@ bool kafkaCommon::insertDomNode(DOM::Node node, DOM::Node parent, DOM::Node next try { - parent.insertBefore(node, nextSibling); + tqparent.insertBefore(node, nextSibling); } catch(DOM::DOMException e) { @@ -3716,12 +3716,12 @@ bool kafkaCommon::insertDomNode(DOM::Node node, DOM::Node parent, DOM::Node next bool kafkaCommon::removeDomNode(DOM::Node node) { - DOM::Node parent = node.parentNode(); + DOM::Node tqparent = node.parentNode(); - if(parent.isNull()) + if(tqparent.isNull()) return false; - parent.removeChild(node); + tqparent.removeChild(node); return true; } @@ -3733,7 +3733,7 @@ DOM::Node kafkaCommon::createDomNode(const TQString &nodeName, const DTDStruct* //this will change with the futur multi-DTDs support //It does not use exceptions handling, so everything is checked via the DTEP definitions. DOM::Node dn; - QTag *qTag = 0L; + TQTag *qTag = 0L; qTag = QuantaCommon::tagFromDTD(dtd, nodeName); @@ -3766,7 +3766,7 @@ DOM::Node kafkaCommon::createDomNodeAttribute(const TQString &nodeName, const DT const TQString &attrName, const TQString &attrValue, DOM::Document rootNode) { DOM::Node attr; - QTag *qTag = 0L; + TQTag *qTag = 0L; qTag = QuantaCommon::tagFromDTD(dtd, nodeName); if(!qTag) @@ -3908,24 +3908,24 @@ bool kafkaCommon::isInline(DOM::Node domNode) return isInline(domNode.nodeName().string()); } -bool kafkaCommon::parentSupports(DOM::Node parent, DOM::Node startNode, DOM::Node endNode, +bool kafkaCommon::tqparentSupports(DOM::Node tqparent, DOM::Node startNode, DOM::Node endNode, const DTDStruct* dtd) { - QTag *parentQTag; + TQTag *tqparentTQTag; DOM::Node child; - if(!dtd || parent.isNull()) + if(!dtd || tqparent.isNull()) return false; - parentQTag = QuantaCommon::tagFromDTD(dtd, parent.nodeName().string()); + tqparentTQTag = QuantaCommon::tagFromDTD(dtd, tqparent.nodeName().string()); - if(!parentQTag) + if(!tqparentTQTag) return false; child = startNode; while(!child.isNull()) { - if(!parentQTag->isChild(child.nodeName().string())) + if(!tqparentTQTag->isChild(child.nodeName().string())) return false; if(child == endNode) return true; @@ -3974,17 +3974,17 @@ void kafkaCommon::coutDomTree(DOM::Node, int) dots.fill('_', indent); output = dots; if (node.nodeType() != DOM::Node::TEXT_NODE) - output += node.nodeName().string().replace('\n'," "); + output += node.nodeName().string().tqreplace('\n'," "); else { output += "\""; - output+= node.nodeValue().string().replace('\n'," "); + output+= node.nodeValue().string().tqreplace('\n'," "); output += "\""; } kdDebug(25001) << output <<" (" << node.nodeType() << ") "<< node.handle() << endl; kdDebug(25001)<< dots << " +++ prev " << node.previousSibling().handle() << " next " << - node.nextSibling().handle() << " parent " << + node.nextSibling().handle() << " tqparent " << node.parentNode().handle() << " child " << node.firstChild().handle() << endl; for(j = 0; j < (int)node.attributes().length(); ++j) { @@ -4016,18 +4016,18 @@ void kafkaCommon::coutTree(Node *node, int indent) node->tag->endPos(eLine, eCol); if (node->tag->type == Tag::XmlTag || node->tag->type == Tag::XmlTagEnd || node->tag->type == Tag::ScriptTag) - output += node->tag->name.replace('\n',"<return>"); + output += node->tag->name.tqreplace('\n',"<return>"); else { output += "\""; - output+= node->tag->tagStr().replace('\n',"<return>"); + output+= node->tag->tagStr().tqreplace('\n',"<return>"); output += "\""; } kdDebug(25001) << output <<" (" << node->tag->type << ", " << node->tag->cleanStrBuilt() << ", " << node->tag->indentationDone() << ") "<< node << " at pos " << bLine << ":" << bCol << " - " << eLine << ":" << eCol << endl; - kdDebug(25001)<< dots << " +++ prev " << node->prev << " next " << node->next << " parent " << - node->parent << " child " << node->child << endl; + kdDebug(25001)<< dots << " +++ prev " << node->prev << " next " << node->next << " tqparent " << + node->tqparent << " child " << node->child << endl; for(j = 0; j < node->tag->attrCount(); ++j) { kdDebug(25001)<< dots << " *** attr" << j << " " << @@ -4069,13 +4069,13 @@ int kafkaCommon::isInsideTag(Node* start_node, Node* end_node, TQString const& t tag_start = hasParent(start_node, tag_name); if(tag_start) - return 0; // only start_node has tag_name as parent + return 0; // only start_node has tag_name as tqparent tag_start = hasParent(end_node, tag_name); if(tag_start) - return 0; // only end_node has tag_name as parent + return 0; // only end_node has tag_name as tqparent - return -1; // neither the nodes have tag_name as parent + return -1; // neither the nodes have tag_name as tqparent } int kafkaCommon::isInsideTag(Node* start_node, Node* end_node, TQString const& tag_name, @@ -4092,13 +4092,13 @@ int kafkaCommon::isInsideTag(Node* start_node, Node* end_node, TQString const& t tag_start = hasParent(start_node, tag_name); if(tag_start && tag_start->tag->hasAttribute(attribute_name) && tag_start->tag->attributeValue(attribute_name, true) == attribute_value) - return 0; // only start_node has tag_name as parent + return 0; // only start_node has tag_name as tqparent tag_start = hasParent(end_node, tag_name); if(tag_start && tag_start->tag->hasAttribute(attribute_name) && tag_start->tag->attributeValue(attribute_name, true) == attribute_value) - return 0; // only end_node has tag_name as parent + return 0; // only end_node has tag_name as tqparent - return -1; // neither the nodes have tag_name as parent + return -1; // neither the nodes have tag_name as tqparent } bool kafkaCommon::isBetweenWords(Node* node, int offset) |