summaryrefslogtreecommitdiffstats
path: root/quanta/parsers/tag.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'quanta/parsers/tag.cpp')
-rw-r--r--quanta/parsers/tag.cpp114
1 files changed, 57 insertions, 57 deletions
diff --git a/quanta/parsers/tag.cpp b/quanta/parsers/tag.cpp
index 8a1921db..54779d57 100644
--- a/quanta/parsers/tag.cpp
+++ b/quanta/parsers/tag.cpp
@@ -15,10 +15,10 @@
#include <ctype.h>
-#include <qdict.h>
-#include <qstring.h>
-#include <qcstring.h>
-#include <qdom.h>
+#include <tqdict.h>
+#include <tqstring.h>
+#include <tqcstring.h>
+#include <tqdom.h>
#include <kdebug.h>
@@ -31,7 +31,7 @@
#include "node.h"
-void TagAttr::save(QDomElement& element) const
+void TagAttr::save(TQDomElement& element) const
{
element.setAttribute("name", name); // QString
element.setAttribute("value", value); // QString
@@ -43,16 +43,16 @@ void TagAttr::save(QDomElement& element) const
element.setAttribute("special", special); // bool
}
-bool TagAttr::load(QDomElement const& element)
+bool TagAttr::load(TQDomElement const& element)
{
name = element.attribute("name");
value = element.attribute("value");
- nameLine = QString(element.attribute("nameLine")).toInt();
- nameCol = QString(element.attribute("nameCol")).toInt();
- valueLine = QString(element.attribute("valueLine")).toInt();
- valueCol = QString(element.attribute("valueCol")).toInt();
- quoted = QString(element.attribute("quoted")).toInt();
- special = QString(element.attribute("special")).toInt();
+ nameLine = TQString(element.attribute("nameLine")).toInt();
+ nameCol = TQString(element.attribute("nameCol")).toInt();
+ valueLine = TQString(element.attribute("valueLine")).toInt();
+ valueCol = TQString(element.attribute("valueCol")).toInt();
+ quoted = TQString(element.attribute("quoted")).toInt();
+ special = TQString(element.attribute("special")).toInt();
return true;
}
@@ -66,7 +66,7 @@ Tag::Tag()
Tag::Tag(const AreaStruct &area, Document *write, const DTDStruct *dtd, bool doParse)
{
init();
- QString s = write->text(area);
+ TQString s = write->text(area);
m_area = area;
m_dtd = dtd;
if (doParse)
@@ -125,7 +125,7 @@ void Tag::init()
m_notInTree = false;
}
-void Tag::save(QDomElement& element) const
+void Tag::save(TQDomElement& element) const
{
element.setAttribute("name", name); // QString
element.setAttribute("nameSpace", nameSpace); // QString
@@ -141,10 +141,10 @@ void Tag::save(QDomElement& element) const
element.setAttribute("nameLine", m_nameLine); // int
element.setAttribute("nameCol", m_nameCol); // int
- QValueList<TagAttr>::const_iterator it;
+ TQValueList<TagAttr>::const_iterator it;
for (it = attrs.begin(); it != attrs.end(); ++it)
{
- QDomElement child_element = element.ownerDocument().createElement("tagAttr");
+ TQDomElement child_element = element.ownerDocument().createElement("tagAttr");
element.appendChild(child_element);
(*it).save(child_element);
}
@@ -152,28 +152,28 @@ void Tag::save(QDomElement& element) const
element.setAttribute("tagStr", m_tagStr); // QString
}
-bool Tag::load(QDomElement const& element)
+bool Tag::load(TQDomElement const& element)
{
name = element.attribute("name"); // QString
nameSpace = element.attribute("nameSpace"); // QString
cleanStr = element.attribute("cleanStr"); // QString
- type = QString(element.attribute("type")).toInt(); // int
- single = QString(element.attribute("single")).toInt(); // bool
- closingMissing = QString(element.attribute("closingMissing")).toInt(); // bool
+ type = TQString(element.attribute("type")).toInt(); // int
+ single = TQString(element.attribute("single")).toInt(); // bool
+ closingMissing = TQString(element.attribute("closingMissing")).toInt(); // bool
structBeginStr = element.attribute("structBeginStr"); // QString
- validXMLTag = QString(element.attribute("validXMLTag")).toInt(); // bool
- m_cleanStrBuilt = QString(element.attribute("cleanStrBuilt")).toInt(); // bool
- m_indentationDone = QString(element.attribute("indentationDone")).toInt(); // bool
- m_notInTree = QString(element.attribute("notInTree")).toInt(); // bool
- m_nameLine = QString(element.attribute("nameLine")).toInt(); // int
- m_nameCol = QString(element.attribute("nameCol")).toInt(); // int
-
- QDomNodeList list = element.childNodes();
+ validXMLTag = TQString(element.attribute("validXMLTag")).toInt(); // bool
+ m_cleanStrBuilt = TQString(element.attribute("cleanStrBuilt")).toInt(); // bool
+ m_indentationDone = TQString(element.attribute("indentationDone")).toInt(); // bool
+ m_notInTree = TQString(element.attribute("notInTree")).toInt(); // bool
+ m_nameLine = TQString(element.attribute("nameLine")).toInt(); // int
+ m_nameCol = TQString(element.attribute("nameCol")).toInt(); // int
+
+ TQDomNodeList list = element.childNodes();
for (unsigned int i = 0; i != list.count(); ++i)
{
if (list.item(i).isElement())
{
- QDomElement e = list.item(i).toElement();
+ TQDomElement e = list.item(i).toElement();
if (e.tagName() == "tagAttr")
{
TagAttr tag_attr;
@@ -188,7 +188,7 @@ bool Tag::load(QDomElement const& element)
return true;
}
-void Tag::parse(const QString &p_tagStr, Document *p_write)
+void Tag::parse(const TQString &p_tagStr, Document *p_write)
{
attrs.clear();
m_tagStr = p_tagStr;
@@ -216,7 +216,7 @@ void Tag::parse(const QString &p_tagStr, Document *p_write)
name = name.mid(++nameSpacePos);
m_nameCol += nameSpacePos;
}
- QString attrStr;
+ TQString attrStr;
TagAttr attr;
attr.special = false; //by default non of the attributes are special
while (pos < strLength && m_tagStr[pos].isSpace())
@@ -242,7 +242,7 @@ void Tag::parse(const QString &p_tagStr, Document *p_write)
attr.nameCol = sPos + m_area.bCol;
else
attr.nameCol = m_tagStr.left(sPos).section('\n',-1).length();
- attr.value = (m_dtd != 0) ? m_dtd->booleanTrue : QString("checked");
+ attr.value = (m_dtd != 0) ? m_dtd->booleanTrue : TQString("checked");
attr.valueCol = attr.nameCol;
attr.valueLine = attr.nameLine;
attr.quoted = false;
@@ -264,7 +264,7 @@ void Tag::parse(const QString &p_tagStr, Document *p_write)
//treate it as a "true" boolean
if (m_tagStr[pos] != '=' || pos == strLength)
{
- attr.value = (m_dtd != 0) ? m_dtd->booleanTrue : QString("checked");
+ attr.value = (m_dtd != 0) ? m_dtd->booleanTrue : TQString("checked");
attr.valueCol = attr.nameCol;
attr.valueLine = attr.nameLine;
attr.quoted = false;
@@ -278,7 +278,7 @@ void Tag::parse(const QString &p_tagStr, Document *p_write)
{
attr.quoted = true;
valueStartPos = pos + 1;
- QChar quotation = m_tagStr[pos];
+ TQChar quotation = m_tagStr[pos];
pos += 1;
while (pos < strLength &&
(m_tagStr[pos] != quotation ||
@@ -316,8 +316,8 @@ void Tag::parse(const QString &p_tagStr, Document *p_write)
//add the tag to the document usertag list if it's not present in the dtd
if (m_tagStr.startsWith("<") && m_tagStr.endsWith(">") && m_dtd)
{
- //QString tagName = (m_parsingDTD->caseSensitive) ? name : name.upper();
- QString tagName = name.lower();
+ //TQString tagName = (m_parsingDTD->caseSensitive) ? name : name.upper();
+ TQString tagName = name.lower();
//add the new xml tags to the userTagList
if ( !QuantaCommon::isKnownTag(m_dtd->name, tagName) &&
name[0] != '/' )
@@ -347,9 +347,9 @@ void Tag::parse(const QString &p_tagStr, Document *p_write)
}
-QString Tag::attribute(int index)
+TQString Tag::attribute(int index)
{
- QString attr="";
+ TQString attr="";
if ( index != -1 && index < (int)attrs.count() )
{
attr = attrs[index].name;
@@ -357,9 +357,9 @@ QString Tag::attribute(int index)
return attr;
}
-QString Tag::attributeValue(int index)
+TQString Tag::attributeValue(int index)
{
- QString val = "";
+ TQString val = "";
if ( index != -1 && index < (int)attrs.count() )
{
val = attrs[index].value;
@@ -367,9 +367,9 @@ QString Tag::attributeValue(int index)
return val;
}
-QString Tag::attributeValue(const QString &attr, bool ignoreCase)
+TQString Tag::attributeValue(const TQString &attr, bool ignoreCase)
{
- QString val = "";
+ TQString val = "";
for (uint i = 0 ; i < attrs.count(); i++)
{
@@ -384,7 +384,7 @@ QString Tag::attributeValue(const QString &attr, bool ignoreCase)
}
/** Check if this tag has the attr attribute defined */
-bool Tag::hasAttribute(const QString &attr, bool ignoreCase)
+bool Tag::hasAttribute(const TQString &attr, bool ignoreCase)
{
for (uint i = 0; i < attrs.count(); i++)
{
@@ -424,7 +424,7 @@ void Tag::setTagPosition(const AreaStruct &area)
}
/** Return the index of attr. */
-int Tag::attributeIndex(const QString &attr)
+int Tag::attributeIndex(const TQString &attr)
{
int index = -1;
uint i = 0;
@@ -483,7 +483,7 @@ void Tag::namePos(int &line, int &col)
col = m_nameCol;
}
-void Tag::setStr(const QString &p_tagStr)
+void Tag::setStr(const TQString &p_tagStr)
{
m_tagStr = p_tagStr; cleanStr = m_tagStr;
}
@@ -520,7 +520,7 @@ void Tag::attributeValuePos(int index, int &line, int &col)
}
}
-bool Tag::editAttribute(const QString& attrName, const QString& attrValue)
+bool Tag::editAttribute(const TQString& attrName, const TQString& attrValue)
{
TagAttr attr;
@@ -552,7 +552,7 @@ bool Tag::editAttribute(const QString& attrName, const QString& attrValue)
return false;
}
-void Tag::deleteAttribute(const QString& attrName)
+void Tag::deleteAttribute(const TQString& attrName)
{
for (uint i = 0 ; i < attrs.count(); i++)
{
@@ -564,12 +564,12 @@ void Tag::deleteAttribute(const QString& attrName)
}
}
-void Tag::modifyAttributes(QDict<QString> *attrDict)
+void Tag::modifyAttributes(TQDict<TQString> *attrDict)
{
QTag *qTag = QuantaCommon::tagFromDTD(m_dtd, name);
- QDictIterator<QString> it(*attrDict);
- QString attribute;
- QString value;
+ TQDictIterator<TQString> it(*attrDict);
+ TQString attribute;
+ TQString value;
while ( it.current() )
{
attribute = it.currentKey();
@@ -591,13 +591,13 @@ void Tag::modifyAttributes(QDict<QString> *attrDict)
}
}
-QString Tag::toString()
+TQString Tag::toString()
{
QTag *qTag = QuantaCommon::tagFromDTD(m_dtd, name);
- QValueList<TagAttr>::Iterator it;
+ TQValueList<TagAttr>::Iterator it;
TagAttr attr;
- QString attrString;
- QString tagString;
+ TQString attrString;
+ TQString tagString;
for (it = attrs.begin(); it != attrs.end(); ++it)
{
attr = *it;
@@ -652,7 +652,7 @@ void Tag::setDtd(const DTDStruct *dtd)
m_dtd = dtd;
}
-bool Tag::isInsideScript(const QString &str)
+bool Tag::isInsideScript(const TQString &str)
{
if (!m_dtd)
return false; //happens when the DTD is not known yet, e.g in Document::findDTDName
@@ -662,7 +662,7 @@ bool Tag::isInsideScript(const QString &str)
//TODO: speed up if you can...
if (str.find(m_dtd->specialAreaStartRx) != -1)
{
- QString foundString = m_dtd->specialAreaStartRx.cap();
+ TQString foundString = m_dtd->specialAreaStartRx.cap();
if (str.find(m_dtd->specialAreas[foundString]) == -1)
{
return true;