diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-16 19:02:47 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-16 19:02:47 +0000 |
commit | e985f7e545f4739493965aad69bbecb136dc9346 (patch) | |
tree | 54afd409d8acd6202dd8ab611d24e78c28e4c0a0 /quanta/parsers/node.cpp | |
parent | f7670c198945adc3b95ad69a959fe5f8ae55b493 (diff) | |
download | tdewebdev-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/node.cpp')
-rw-r--r-- | quanta/parsers/node.cpp | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/quanta/parsers/node.cpp b/quanta/parsers/node.cpp index 219716e9..ef7599b8 100644 --- a/quanta/parsers/node.cpp +++ b/quanta/parsers/node.cpp @@ -33,9 +33,9 @@ int NN = 0; //for debugging purposes: count the Node objects GroupElementMapList globalGroupMap; -Node::Node(Node *parent) +Node::Node(Node *tqparent) { - this->parent = parent; + this->tqparent = tqparent; prev = next = child = 0L; tag = 0L; mainListItem = 0L; @@ -48,7 +48,7 @@ Node::Node(Node *parent) m_leafNode = 0L; m_groupElements.clear(); NN++; -// if (nodes.contains(this) == 0) +// if (nodes.tqcontains(this) == 0) nodes[this] = 1; // else // { @@ -60,7 +60,7 @@ bool Node::deleteNode(Node *node) { if (!node) return true; - if (!nodes.contains(node)) + if (!nodes.tqcontains(node)) { kdDebug(24000) << "Trying to delete a node with address " << node << " that was not allocated!" << endl; return false; @@ -71,7 +71,7 @@ bool Node::deleteNode(Node *node) Node::~Node() { -// if (!nodes.contains(this)) +// if (!nodes.tqcontains(this)) // { // kdError(24000) << "No node with this address " << this << " was allocated!" << endl; // return; @@ -89,8 +89,8 @@ Node::~Node() nodes.erase(this); if (prev && prev->next == this) prev->next = 0L; - if (parent && parent->child == this) - parent->child = 0L; + if (tqparent && tqparent->child == this) + tqparent->child = 0L; if (removeAll) { deleteNode(child); @@ -101,8 +101,8 @@ Node::~Node() { if (next && next->prev == this) next->prev = 0L; - if (child && child->parent == this) - child->parent = 0L; + if (child && child->tqparent == this) + child->tqparent = 0L; } delete tag; @@ -148,7 +148,7 @@ void Node::save(TQDomElement& element) const element.setAttribute("removeAll", removeAll); // bool element.setAttribute("insideSpecial", insideSpecial); // bool element.setAttribute("specialInsideXml", specialInsideXml); // bool - element.setAttribute("fileName", fileName); // QString + element.setAttribute("fileName", fileName); // TQString /* TQString s_element; TQTextStream stream(&s_element, IO_WriteOnly); @@ -174,13 +174,13 @@ bool Node::load(TQDomElement const& element) { next = new Node(0); next->prev = this; - next->parent = this->parent; + next->tqparent = this->tqparent; next->load(e); } else if(e.tagName() == "nodeChild") { child = new Node(0); - child->parent = this; + child->tqparent = this; child->load(e); } else if(e.tagName() == "nodeClosing") @@ -201,7 +201,7 @@ bool Node::load(TQDomElement const& element) removeAll = TQString(element.attribute("removeAll")).toInt(); // bool insideSpecial = TQString(element.attribute("insideSpecial")).toInt(); // bool specialInsideXml = TQString(element.attribute("specialInsideXml")).toInt(); // bool - fileName = element.attribute("fileName"); // QString + fileName = element.attribute("fileName"); // TQString //kafkaCommon::coutTree(this, 3); @@ -225,14 +225,14 @@ Node *Node::nextSibling() Node *n = this; while (n) { - if (n->parent && n->parent->next) + if (n->tqparent && n->tqparent->next) { - result = n->parent->next; + result = n->tqparent->next; break; } else { - n = n->parent; + n = n->tqparent; } } } @@ -257,7 +257,7 @@ Node *Node::previousSibling() } else { - result = parent; + result = tqparent; } return result; @@ -272,14 +272,14 @@ Node *Node::nextNotChild() Node *n = this; while (n) { - if (n->parent && n->parent->next) + if (n->tqparent && n->tqparent->next) { - n = n->parent->next; + n = n->tqparent->next; break; } else { - n = n->parent; + n = n->tqparent; } } @@ -291,14 +291,14 @@ TQString Node::nodeName() { if(tag) return tag->name; - return TQString::null; + return TQString(); } TQString Node::nodeValue() { if(tag) return tag->tagStr(); - return TQString::null; + return TQString(); } void Node::setNodeValue(const TQString &value) @@ -358,15 +358,15 @@ Node *Node::SPrev() Node *node = prev; int bCol, bLine, eCol, eLine, col, line; - if(parent) + if(tqparent) { - parent->tag->beginPos(bLine, bCol); - parent->tag->endPos(eLine, eCol); + tqparent->tag->beginPos(bLine, bCol); + tqparent->tag->endPos(eLine, eCol); } while(node && node->tag->type != Tag::XmlTag && node->tag->type != Tag::Text) { - if (parent && node->tag->type == Tag::ScriptTag) + if (tqparent && node->tag->type == Tag::ScriptTag) { //Check if it is an embedded ScriptTag. If it is, continue. node->tag->beginPos(line, col); @@ -384,7 +384,7 @@ Node *Node::SNext() Node *node = next; int bCol, bLine, eCol, eLine, col, line; - if(parent) + if(tqparent) { tag->beginPos(bLine, bCol); tag->endPos(eLine, eCol); @@ -392,7 +392,7 @@ Node *Node::SNext() while(node && node->tag->type != Tag::XmlTag && node->tag->type != Tag::Text) { - if (parent && node->tag->type == Tag::ScriptTag) + if (tqparent && node->tag->type == Tag::ScriptTag) { //Check if it is an embedded ScriptTag. If it is, continue. node->tag->beginPos(line, col); @@ -509,7 +509,7 @@ void Node::operator =(Node* node) (*this) = (*node); prev = 0L; next = 0L; - parent = 0L; + tqparent = 0L; child = 0L; mainListItem = 0L; m_groupElements.clear(); @@ -520,7 +520,7 @@ void Node::operator =(Node* node) void Node::detachNode() { - if (nodes.contains(this) == 0) + if (nodes.tqcontains(this) == 0) { kdError(24000) << "No node with this address " << this << " was allocated!" << endl; return; |