summaryrefslogtreecommitdiffstats
path: root/quanta/parsers
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-08-10 06:08:18 +0000
commit36c36b53a129509d56fdaa0a7c9fcbcacd0c5826 (patch)
tree629d3942958745660e36c30b0d6139af9459c0f8 /quanta/parsers
parent929d7ae4f69d62b8f1f6d3506adf75f017753935 (diff)
downloadtdewebdev-36c36b53a129509d56fdaa0a7c9fcbcacd0c5826.tar.gz
tdewebdev-36c36b53a129509d56fdaa0a7c9fcbcacd0c5826.zip
rename the following methods:
tqfind find tqreplace replace tqcontains contains git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdewebdev@1246075 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'quanta/parsers')
-rw-r--r--quanta/parsers/dtd/dtd.cpp60
-rw-r--r--quanta/parsers/dtd/dtdparser.cpp4
-rw-r--r--quanta/parsers/node.cpp8
-rw-r--r--quanta/parsers/parser.cpp56
-rw-r--r--quanta/parsers/parsercommon.cpp6
-rw-r--r--quanta/parsers/qtag.cpp14
-rw-r--r--quanta/parsers/sagroupparser.cpp30
-rw-r--r--quanta/parsers/saparser.cpp24
-rw-r--r--quanta/parsers/tag.cpp18
9 files changed, 110 insertions, 110 deletions
diff --git a/quanta/parsers/dtd/dtd.cpp b/quanta/parsers/dtd/dtd.cpp
index 2783acca..5008dcff 100644
--- a/quanta/parsers/dtd/dtd.cpp
+++ b/quanta/parsers/dtd/dtd.cpp
@@ -51,7 +51,7 @@ TQStringList DTD::getTags()
AttributeList* DTD::getTagAttributes(TQString tag)
{
- return tagAttributes.tqfind(tag);
+ return tagAttributes.find(tag);
}
@@ -195,14 +195,14 @@ void DTD::parseDTDEntity(TQString line) {
TQString name;
TQString *value;
- line.tqreplace("\\end", " ");
+ line.replace("\\end", " ");
name = line.mid(11);
- int firstSpace = name.tqfind(' ');
+ int firstSpace = name.find(' ');
name = name.remove(firstSpace, name.length()-firstSpace);
value = new TQString(line.mid(11+firstSpace));
- value->remove(0, value->tqfind("\"")+1);
- value->remove(value->tqfindRev("\""), value->length());
+ value->remove(0, value->find("\"")+1);
+ value->remove(value->findRev("\""), value->length());
parseDTDReplace(value);
stripSpaces(value);
@@ -217,14 +217,14 @@ void DTD::parseDTDElement(const TQString &l) {
TQString *value;
TQString line = l;
- line.tqreplace("\\end", " ");
+ line.replace("\\end", " ");
name = line.mid(10);
- int firstSpace = name.tqfind(' ');
+ int firstSpace = name.find(' ');
name.remove(firstSpace, name.length()-firstSpace);
value = new TQString(line.mid(10+firstSpace));
- //value->remove(0, value->tqfind("\"")+1);
- value->remove(value->tqfind(">"), 10000);
+ //value->remove(0, value->find("\"")+1);
+ value->remove(value->find(">"), 10000);
parseDTDReplace(&name);
parseDTDReplace(value);
@@ -254,14 +254,14 @@ void DTD::parseDTDAttlist(const TQString &l) {
TQString *value;
TQString line = l;
- line.tqreplace("\\end", " ");
+ line.replace("\\end", " ");
name = line.mid(10);
- int firstSpace = name.tqfind(' ');
+ int firstSpace = name.find(' ');
name.remove(firstSpace, name.length()-firstSpace);
value = new TQString(line.mid(10+firstSpace));
- //value->remove(0, value->tqfind("\"")+1);
- value->remove(value->tqfind(">"), 10000);
+ //value->remove(0, value->find("\"")+1);
+ value->remove(value->find(">"), 10000);
parseDTDReplace(&name);
parseDTDReplace(value);
@@ -362,51 +362,51 @@ void DTD::parseTagAttributeValues(const TQString &name, TQString *value) {
void DTD::parseDTDReplace(TQString *value) {
int begin, end;
- begin = value->tqfind("%");
- end = value->tqfind(";");
+ begin = value->find("%");
+ end = value->find(";");
while (begin != -1 && end != -1) {
TQString replaceText = value->mid(begin+1, end-begin-1);
- TQString *replaceValue = entities.tqfind(replaceText);
+ TQString *replaceValue = entities.find(replaceText);
if (replaceValue != 0L) {
- value->tqreplace(begin, end-begin+1, *replaceValue);
+ value->replace(begin, end-begin+1, *replaceValue);
} else {
kdDebug(24000) << "Can not find entity: " << replaceText << endl;
return;
}
- begin = value->tqfind("%");
- end = value->tqfind(";");
+ begin = value->find("%");
+ end = value->find(";");
}
}
void DTD::stripSpaces(TQString *value) {
int index=-1;
- while ( (index=value->tqfind(' ',++index)) != -1 ) {
- if ( value->tqfindRev('(',index) != -1 && value->tqfind(')',index) != -1)
+ while ( (index=value->find(' ',++index)) != -1 ) {
+ if ( value->findRev('(',index) != -1 && value->find(')',index) != -1)
value->remove(index,1);
}
}
void DTD::removeComments(TQString &value) {
int begin, end;
- begin = value.tqfind("<!--");
- end = value.tqfind("-->",begin+2);
+ begin = value.find("<!--");
+ end = value.find("-->",begin+2);
while (begin != -1 && end != -1) {
value.remove(begin, end-begin+3);
- begin = value.tqfind("<!--");
- end = value.tqfind("-->",begin+2);
+ begin = value.find("<!--");
+ end = value.find("-->",begin+2);
}
- begin = value.tqfind("--");
- end = value.tqfind("--",begin+2);
+ begin = value.find("--");
+ end = value.find("--",begin+2);
while (begin != -1 && end != -1) {
value.remove(begin, end-begin+2);
- begin = value.tqfind("--");
- end = value.tqfind("--",begin+2);
+ begin = value.find("--");
+ end = value.find("--",begin+2);
}
- value.tqreplace(TQRegExp("<!>"), "");
+ value.replace(TQRegExp("<!>"), "");
}
bool DTD::parseDTD()
diff --git a/quanta/parsers/dtd/dtdparser.cpp b/quanta/parsers/dtd/dtdparser.cpp
index 8b4ec503..72e7ea18 100644
--- a/quanta/parsers/dtd/dtdparser.cpp
+++ b/quanta/parsers/dtd/dtdparser.cpp
@@ -123,8 +123,8 @@ bool DTDParser::parse(const TQString &targetDir, bool entitiesOnly)
m_name = w.dtdName->text();
m_nickName = w.nickName->text();
m_doctype = w.doctype->text();
- m_doctype.tqreplace(TQRegExp("<!doctype", false), "");
- m_doctype = m_doctype.left(m_doctype.tqfindRev(">"));
+ m_doctype.replace(TQRegExp("<!doctype", false), "");
+ m_doctype = m_doctype.left(m_doctype.findRev(">"));
m_dtdURLLine = w.dtdURL->text();
m_defaultExtension = w.defaultExtension->text();
m_caseSensitive = w.caseSensitive->isChecked();
diff --git a/quanta/parsers/node.cpp b/quanta/parsers/node.cpp
index ef7599b8..591b557e 100644
--- a/quanta/parsers/node.cpp
+++ b/quanta/parsers/node.cpp
@@ -48,7 +48,7 @@ Node::Node(Node *tqparent)
m_leafNode = 0L;
m_groupElements.clear();
NN++;
-// if (nodes.tqcontains(this) == 0)
+// if (nodes.contains(this) == 0)
nodes[this] = 1;
// else
// {
@@ -60,7 +60,7 @@ bool Node::deleteNode(Node *node)
{
if (!node)
return true;
- if (!nodes.tqcontains(node))
+ if (!nodes.contains(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.tqcontains(this))
+// if (!nodes.contains(this))
// {
// kdError(24000) << "No node with this address " << this << " was allocated!" << endl;
// return;
@@ -520,7 +520,7 @@ void Node::operator =(Node* node)
void Node::detachNode()
{
- if (nodes.tqcontains(this) == 0)
+ if (nodes.contains(this) == 0)
{
kdError(24000) << "No node with this address " << this << " was allocated!" << endl;
return;
diff --git a/quanta/parsers/parser.cpp b/quanta/parsers/parser.cpp
index c795f11e..b8e5e619 100644
--- a/quanta/parsers/parser.cpp
+++ b/quanta/parsers/parser.cpp
@@ -137,8 +137,8 @@ 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.tqfind('<', col);
- specialStartPos = specialAreaCount ? textLine.tqfind(m_dtd->specialAreaStartRx, col): -1;
+ tagStartPos = textLine.find('<', col);
+ specialStartPos = specialAreaCount ? textLine.find(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 &&
@@ -263,7 +263,7 @@ 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.tqcontains(tag->name.lower()) && !tag->single)
+ if (m_dtd->specialTags.contains(tag->name.lower()) && !tag->single)
{
//TODO: handle goUp here
Node *node = new Node(parentNode);
@@ -283,17 +283,17 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
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.tqfind('[');
+ int defPos = tmpStr.find('[');
TQString defValue;
if (defPos != 0)
{
- defValue = tmpStr.mid(defPos+1, tmpStr.tqfindRev(']')-defPos-1).stripWhiteSpace();
+ defValue = tmpStr.mid(defPos+1, tmpStr.findRev(']')-defPos-1).stripWhiteSpace();
tmpStr = tmpStr.left(defPos);
}
TQString s = tag->attributeValue(tmpStr);
if (s.isEmpty())
s = defValue;
- const DTDStruct *dtd = DTDs::ref()->tqfind(s);
+ const DTDStruct *dtd = DTDs::ref()->find(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!
@@ -327,7 +327,7 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
{
TQString searchFor = (m_dtd->caseSensitive)?tag->name:tag->name.upper();
searchFor.remove('/');
- if ( qTag->stoppingTags.tqcontains(searchFor))
+ if ( qTag->stoppingTags.contains(searchFor))
{
parentNode->tag->closingMissing = true; //tqparent is single...
goUp = true;
@@ -370,7 +370,7 @@ Node *Parser::parseArea(int startLine, int startCol, int endLine, int endCol, No
qTag = QuantaCommon::tagFromDTD(m_dtd, n->tag->name);
if ( qTag )
{
- if ( qTag->stoppingTags.tqcontains(searchFor) )
+ if ( qTag->stoppingTags.contains(searchFor) )
{
n->tag->closingMissing = true; //tqparent is single...
if (n->tqparent)
@@ -1143,7 +1143,7 @@ Node *Parser::rebuild(Document *w)
{
TQString searchFor = (m_dtd->caseSensitive)?lastNode->tag->name:lastNode->tag->name.upper();
searchFor.remove('/');
- if ( qTag->stoppingTags.tqcontains( searchFor ) )
+ if ( qTag->stoppingTags.contains( searchFor ) )
{
node->tqparent->tag->closingMissing = true; //tqparent is single...
goUp = true;
@@ -1178,7 +1178,7 @@ Node *Parser::rebuild(Document *w)
qTag = QuantaCommon::tagFromDTD(m_dtd, n->tag->name);
if ( qTag )
{
- if ( qTag->stoppingTags.tqcontains(searchFor) )
+ if ( qTag->stoppingTags.contains(searchFor) )
{
n->tag->closingMissing = true; //tqparent is single...
if (n->tqparent)
@@ -1217,7 +1217,7 @@ Node *Parser::rebuild(Document *w)
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.tqcontains(lastNode))
+ if (!nodes.contains(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.tqfind(dtd->specialAreaStartRx, lastAreaPos);
+ areaPos = content.find(dtd->specialAreaStartRx, lastAreaPos);
if (areaPos != -1)
{
foundStr = dtd->specialAreaStartRx.cap();
specialEndStr = dtd->specialAreas[foundStr];
- int areaPos2 = content.tqfind(specialEndStr, areaPos);
+ int areaPos2 = content.find(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.tqfind(dtd->structBeginStr, structPos);
+ structPos = foundStr.find(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.tqreplace(structPos, pos - structPos + 1, spaces);
+ foundStr.replace(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.tqfindRev(dtd->structKeywordsRx, structPos);
- openBracketPos = foundStr.tqfind('(', openBracketPos);
+ int openBracketPos = foundStr.findRev(dtd->structKeywordsRx, structPos);
+ openBracketPos = foundStr.find('(', 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.tqreplace(openBracketPos, closeBracketPos - openBracketPos, spaces);
+ foundStr.replace(openBracketPos, closeBracketPos - openBracketPos, spaces);
}
//now check which groups are present in this area
@@ -1548,15 +1548,15 @@ void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd)
}
TQString s = content.mid(areaPos + pos, l);
pos += l;
- if (!(*elements)[group.name].tqcontains(s))
+ if (!(*elements)[group.name].contains(s))
{
Tag *tag = new Tag();
tag->name = s;
tag->setDtd(dtd);
tag->setWrite(write);
TQString s2 = content.left(areaPos + pos);
- int newLineNum = s2.tqcontains('\n');
- int tmpCol = s2.length() - s2.tqfindRev('\n') - 1;
+ int newLineNum = s2.contains('\n');
+ int tmpCol = s2.length() - s2.findRev('\n') - 1;
tag->setTagPosition(newLineNum, tmpCol - s.length(), newLineNum, tmpCol);
Node *node = new Node(0L);
node->tag = tag;
@@ -1586,11 +1586,11 @@ void Parser::parseIncludedFile(const TQString& fileName, const DTDStruct *dtd)
if (group.appendToTags)
{
TQTag *qTag = new TQTag();
- qTag->setName(s.left(s.tqfind('(')));
+ qTag->setName(s.left(s.find('(')));
qTag->className = "";
if (groupElement->parentNode)
qTag->className = groupElement->parentNode->tag->name;
- write->userTagList.tqreplace(s.lower(), qTag);
+ write->userTagList.replace(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.tqfindIndex(fileName);
+ int pos = ParserCommon::includedFiles.findIndex(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.tqfind(node->tag->name.lower());
+ xmlGroupIt = node->tag->dtd()->xmlStructTreeGroups.find(node->tag->name.lower());
if (xmlGroupIt != node->tag->dtd()->xmlStructTreeGroups.end())
{
XMLStructGroup group = xmlGroupIt.data();
@@ -1690,17 +1690,17 @@ bool Parser::parseScriptInsideTag(Node *startNode)
while (pos != -1)
{
- pos = text.tqfind(dtd->specialAreaStartRx, col);
+ pos = text.find(dtd->specialAreaStartRx, col);
if (pos != -1)
{
foundText = dtd->specialAreaStartRx.cap();
//Calculate the beginning coordinates
s = text.left(pos);
- n = s.tqcontains('\n');
+ n = s.contains('\n');
bl = node_bl + n;
if (n > 0)
{
- bc = pos - s.tqfindRev('\n') - 1;
+ bc = pos - s.findRev('\n') - 1;
} else
{
bc = node_bc + pos;
diff --git a/quanta/parsers/parsercommon.cpp b/quanta/parsers/parsercommon.cpp
index 469bedd6..860b46e0 100644
--- a/quanta/parsers/parsercommon.cpp
+++ b/quanta/parsers/parsercommon.cpp
@@ -169,7 +169,7 @@ Node* createScriptTagNode(Document *write, const AreaStruct &area, const TQStrin
tag->setTagPosition(area);
tag->setStr(areaName);
tag->setWrite(write);
- const DTDStruct *d = DTDs::ref()->tqfind(dtd->specialAreaNames[areaName]);
+ const DTDStruct *d = DTDs::ref()->find(dtd->specialAreaNames[areaName]);
if (d)
tag->setDtd(d);
else
@@ -216,9 +216,9 @@ void coutTree(Node *node, int indent)
node->tag->beginPos(bLine, bCol);
node->tag->endPos(eLine, eCol);
if (node->tag->type != Tag::Text)
- output += node->tag->name.tqreplace('\n'," ");
+ output += node->tag->name.replace('\n'," ");
else
- output+= node->tag->tagStr().tqreplace('\n'," ");
+ output+= node->tag->tagStr().replace('\n'," ");
kdDebug(24000) << output <<" (" << node->tag->type << ") at pos " <<
bLine << ":" << bCol << " - " << eLine << ":" << eCol << " This: "<< node << " Parent: " << node->tqparent << " Prev: " << node->prev << " Next: " << node->next << " Child: " << node->child << " Tag:" << node->tag << endl;
/* for(j = 0; j < node->tag->attrCount(); j++)
diff --git a/quanta/parsers/qtag.cpp b/quanta/parsers/qtag.cpp
index 6a98c3b1..ae61152e 100644
--- a/quanta/parsers/qtag.cpp
+++ b/quanta/parsers/qtag.cpp
@@ -105,7 +105,7 @@ bool TQTag::isAttribute(const TQString &attrName)
//Check in the common attributes
for(i = 0; i < (signed)commonGroups.count(); i++)
{
- groupAttrs = parentDTD->commonAttrs->tqfind(commonGroups[i]);
+ groupAttrs = parentDTD->commonAttrs->find(commonGroups[i]);
if(groupAttrs)
{
for(a = groupAttrs->first(); a; a = groupAttrs->next())
@@ -206,9 +206,9 @@ bool TQTag::isChild(const TQString& tag, bool trueIfNoChildsDefined)
TQString tagName = tag;
tagName = parentDTD->caseSensitive ? tagName : tagName.upper();
if(trueIfNoChildsDefined)
- return (childTags.isEmpty() || childTags.tqcontains(tagName));
+ return (childTags.isEmpty() || childTags.contains(tagName));
else
- return (!childTags.isEmpty() && childTags.tqcontains(tagName));
+ return (!childTags.isEmpty() && childTags.contains(tagName));
}
bool TQTag::isChild(Node *node, bool trueIfNoChildsDefined, bool treatEmptyNodesAsText)
@@ -220,18 +220,18 @@ bool TQTag::isChild(Node *node, bool trueIfNoChildsDefined, bool treatEmptyNodes
else if(node->tag->type == Tag::Text)
{
if(trueIfNoChildsDefined)
- return(childTags.isEmpty() || childTags.tqcontains("#text") || childTags.tqcontains("#TEXT"));
+ return(childTags.isEmpty() || childTags.contains("#text") || childTags.contains("#TEXT"));
else
- return(!childTags.isEmpty() && (childTags.tqcontains("#text") || childTags.tqcontains("#TEXT")));
+ return(!childTags.isEmpty() && (childTags.contains("#text") || childTags.contains("#TEXT")));
}
else if(node->tag->type == Tag::Empty && !treatEmptyNodesAsText)
return true;
else if(node->tag->type == Tag::Empty && treatEmptyNodesAsText)
{
if(trueIfNoChildsDefined)
- return(childTags.isEmpty() || childTags.tqcontains("#text") || childTags.tqcontains("#TEXT"));
+ return(childTags.isEmpty() || childTags.contains("#text") || childTags.contains("#TEXT"));
else
- return(!childTags.isEmpty() && (childTags.tqcontains("#text") || childTags.tqcontains("#TEXT")));
+ return(!childTags.isEmpty() && (childTags.contains("#text") || childTags.contains("#TEXT")));
}
else if(node->tag->type == Tag::XmlTagEnd)
{
diff --git a/quanta/parsers/sagroupparser.cpp b/quanta/parsers/sagroupparser.cpp
index 49973c70..c6c6b57a 100644
--- a/quanta/parsers/sagroupparser.cpp
+++ b/quanta/parsers/sagroupparser.cpp
@@ -144,20 +144,20 @@ void SAGroupParser::parseForScriptGroup(Node *node)
title = tagStr.mid(pos, group.definitionRx.matchedLength());
node->tag->beginPos(bl, bc);
tmpStr = tagStr.left(pos);
- int newLines = tmpStr.tqcontains('\n');
+ int newLines = tmpStr.contains('\n');
bl += newLines;
- int l = tmpStr.tqfindRev('\n'); //the last EOL
+ int l = tmpStr.findRev('\n'); //the last EOL
bc = (l == -1) ? bc + pos : pos - l - 1;
- newLines = title.tqcontains('\n');
+ newLines = title.contains('\n');
l = title.length();
el = bl + newLines;
- ec = (newLines > 0) ? l - title.tqfindRev('\n') : bc + l - 1;
+ ec = (newLines > 0) ? l - title.findRev('\n') : bc + l - 1;
pos += l;
AreaStruct area(bl, bc, el, ec);
//get the list of elements which are present in this group and
//have the same title. For example get the list of all group
//element which are variable and the matched string was "$i"
- int cap1Pos = str.tqfind(group.definitionRx.cap(1));
+ int cap1Pos = str.find(group.definitionRx.cap(1));
TQString s = tagStr.mid(cap1Pos, group.definitionRx.cap(1).length());
groupElementList = & (globalGroupMap[group.name + "|" + s]);
//Create a new tag which point to the exact location of the matched string.
@@ -204,7 +204,7 @@ void SAGroupParser::parseForScriptGroup(Node *node)
{
TQTag *qTag = new TQTag();
// The location of the first open bracket '(', also the end of the tag name
- int nameEnd = s.tqfind('(');
+ int nameEnd = s.find('(');
qTag->setName(s.left(nameEnd));
qTag->className = "";
if (groupElement->parentNode)
@@ -225,18 +225,18 @@ void SAGroupParser::parseForScriptGroup(Node *node)
{
qTag->type="variable";
// If this tag is a class function argument, it should not belong to the class, so we need to remove it
- if(qTag->className.length() != 0 && tagStr.tqcontains('(') && tagStr.tqcontains(')'))
+ if(qTag->className.length() != 0 && tagStr.contains('(') && tagStr.contains(')'))
{
// First we want to determine the whole line the tag is on
TQString tagWholeLineStr = tagStr;
// Remove lines before target line
while(tagWholeLineStr.length() > 0) // this stops infinit looping in case something goes wrong!
{
- int firstNewline = tagWholeLineStr.tqfind('\n');
+ int firstNewline = tagWholeLineStr.find('\n');
if(firstNewline == -1) //no new lines so we must be on the last
break;
TQString checkLineStr = tagWholeLineStr.mid(firstNewline+1,tagWholeLineStr.length());
- if(checkLineStr.tqcontains(s))
+ if(checkLineStr.contains(s))
tagWholeLineStr = checkLineStr;
else
break;
@@ -244,23 +244,23 @@ void SAGroupParser::parseForScriptGroup(Node *node)
// Remove lines after target line - essentially same as above
while(tagWholeLineStr.length() > 0)
{
- int lastNewLine = tagWholeLineStr.tqfindRev('\n');
+ int lastNewLine = tagWholeLineStr.findRev('\n');
if(lastNewLine == -1)
break;
TQString checkLineStr = tagWholeLineStr.mid(0,lastNewLine);
- if(checkLineStr.tqcontains(s))
+ if(checkLineStr.contains(s))
tagWholeLineStr = checkLineStr;
else
break;
}
// Now we are left with the current line, lets check if the variable is inside parentheses
- int lineOpenParenth=tagWholeLineStr.tqfind('(');
+ int lineOpenParenth=tagWholeLineStr.find('(');
if(lineOpenParenth != -1)
{
- int lineCloseParenth=tagWholeLineStr.tqfind(')');
+ int lineCloseParenth=tagWholeLineStr.find(')');
if(lineCloseParenth != -1)
{
- int lineNameLocation=tagWholeLineStr.tqfind(s);
+ int lineNameLocation=tagWholeLineStr.find(s);
if(lineNameLocation > lineOpenParenth || lineNameLocation < lineCloseParenth) // Write the current tag to the list
isArgument=true;
}
@@ -272,7 +272,7 @@ void SAGroupParser::parseForScriptGroup(Node *node)
qTag->type="function";
}
if(!isArgument)
- m_write->userTagList.tqreplace(s.lower(), qTag);
+ m_write->userTagList.replace(s.lower(), qTag);
}
diff --git a/quanta/parsers/saparser.cpp b/quanta/parsers/saparser.cpp
index 9a30273c..aa9bbd55 100644
--- a/quanta/parsers/saparser.cpp
+++ b/quanta/parsers/saparser.cpp
@@ -86,29 +86,29 @@ bool SAParser::slotParseOneLine()
//search for different s_contexts
if (s_searchContent) //search for quoted strings, comments, groups only in non-comment special areas
{
- quotedStringPos = s_textLine.tqfind(m_quotesRx, s_col); //quoted strings
+ quotedStringPos = s_textLine.find(m_quotesRx, s_col); //quoted strings
s_searchedString = s_textLine.left(quotedStringPos);
- commentPos = s_searchedString.tqfind(s_dtd->commentsStartRx, s_col); //comments
+ commentPos = s_searchedString.find(s_dtd->commentsStartRx, s_col); //comments
s_searchedString = s_textLine.left(commentPos);
if (s_fullParse)
- groupKeywordPos = s_searchedString.tqfind(s_dtd->structRx, s_col); //groups, like { }
+ groupKeywordPos = s_searchedString.find(s_dtd->structRx, s_col); //groups, like { }
} else
s_searchedString = s_textLine;
int specialAreaPos = -1;
if (s_searchForSpecialAreas) //special area inside special area
{
s_searchedString = s_textLine.left(groupKeywordPos);
- specialAreaPos = s_searchedString.tqfind(s_dtd->specialAreaStartRx, s_col);
+ specialAreaPos = s_searchedString.find(s_dtd->specialAreaStartRx, s_col);
}
if (s_searchForAreaEnd) //the end of the special area
{
s_searchedString = s_textLine.left(specialAreaPos);
- areaEndPos = s_searchedString.tqfind(s_areaEndString, s_col);
+ areaEndPos = s_searchedString.find(s_areaEndString, s_col);
} else
if (s_searchForForcedAreaEnd) //the end of the special area if a forcing string was specified
{
s_searchedString = s_textLine.left(specialAreaPos);
- areaEndPos = s_searchedString.tqfind(s_forcedAreaRx, s_col);
+ areaEndPos = s_searchedString.find(s_forcedAreaRx, s_col);
if (areaEndPos != -1)
s_areaEndString = s_forcedAreaRx.cap();
}
@@ -316,11 +316,11 @@ bool SAParser::slotParseOneLine()
} else //when we look only for the area end string
if (s_searchForAreaEnd)
{
- areaEndPos = s_textLine.tqfind(s_areaEndString, s_col);
+ areaEndPos = s_textLine.find(s_areaEndString, s_col);
} else
if (s_searchForForcedAreaEnd)
{
- areaEndPos = s_textLine.tqfind(s_forcedAreaRx, s_col);
+ areaEndPos = s_textLine.find(s_forcedAreaRx, s_col);
if (areaEndPos != -1)
s_areaEndString = s_forcedAreaRx.cap();
}
@@ -487,7 +487,7 @@ bool SAParser::slotParseOneLine()
int l = s_textLine.length();
while (p < l)
{
- p = s_textLine.tqfind(s_currentContext.startString, p);
+ p = s_textLine.find(s_currentContext.startString, p);
if (p != -1)
{
if (p >= 0)
@@ -544,10 +544,10 @@ bool SAParser::slotParseOneLine()
}
case Comment:
{
- int pos = s_textLine.tqfind(s_dtd->comments[s_currentContext.startString], s_col);
+ int pos = s_textLine.find(s_dtd->comments[s_currentContext.startString], s_col);
if (pos == -1 && s_dtd->comments[s_currentContext.startString] == "\n")
{
- int pos2 = s_textLine.tqfind(s_areaEndString, s_col);
+ int pos2 = s_textLine.find(s_areaEndString, s_col);
if (pos2 != -1)
{
pos = pos2 - 1;
@@ -659,7 +659,7 @@ Node* SAParser::parseArea(const AreaStruct &specialArea,
const DTDStruct *parentDTD = m_dtd;
if (s_parentNode->tqparent)
parentDTD = s_parentNode->tqparent->tag->dtd();
- s_dtd = DTDs::ref()->tqfind(parentDTD->specialAreaNames[areaStartString]);
+ s_dtd = DTDs::ref()->find(parentDTD->specialAreaNames[areaStartString]);
s_areaEndString = parentDTD->specialAreas[areaStartString];
s_searchForAreaEnd = true;
}
diff --git a/quanta/parsers/tag.cpp b/quanta/parsers/tag.cpp
index a2dbcf71..5eebae93 100644
--- a/quanta/parsers/tag.cpp
+++ b/quanta/parsers/tag.cpp
@@ -209,7 +209,7 @@ void Tag::parse(const TQString &p_tagStr, Document *p_write)
pos++;
}
name = m_tagStr.mid(1, pos - 1);
- int nameSpacePos = name.tqfind(':');
+ int nameSpacePos = name.find(':');
if (nameSpacePos != -1)
{
nameSpace = name.left(nameSpacePos);
@@ -237,7 +237,7 @@ void Tag::parse(const TQString &p_tagStr, Document *p_write)
attr.name = attr.name.left(attr.name.length() - 1).lower();
if (!attr.name.stripWhiteSpace().isEmpty())
{
- attr.nameLine = m_tagStr.left(sPos).tqcontains('\n') + m_area.bLine;
+ attr.nameLine = m_tagStr.left(sPos).contains('\n') + m_area.bLine;
if (attr.nameLine == m_area.bLine)
attr.nameCol = sPos + m_area.bCol;
else
@@ -252,7 +252,7 @@ void Tag::parse(const TQString &p_tagStr, Document *p_write)
}
if (m_dtd && !m_dtd->caseSensitive)
attr.name = attr.name.lower();
- attr.nameLine = m_tagStr.left(sPos).tqcontains('\n') + m_area.bLine;
+ attr.nameLine = m_tagStr.left(sPos).contains('\n') + m_area.bLine;
if (attr.nameLine == m_area.bLine)
attr.nameCol = sPos + m_area.bCol;
else
@@ -298,7 +298,7 @@ void Tag::parse(const TQString &p_tagStr, Document *p_write)
pos--;
attr.value = m_tagStr.mid(valueStartPos, pos - valueStartPos);
}
- attr.valueLine = m_tagStr.left(valueStartPos).tqcontains('\n') + m_area.bLine;
+ attr.valueLine = m_tagStr.left(valueStartPos).contains('\n') + m_area.bLine;
if (attr.valueLine == m_area.bLine)
attr.valueCol = valueStartPos + m_area.bCol;
else
@@ -322,7 +322,7 @@ void Tag::parse(const TQString &p_tagStr, Document *p_write)
if ( !QuantaCommon::isKnownTag(m_dtd->name, tagName) &&
name[0] != '/' )
{
- TQTag *newTag = m_write->userTagList.tqfind(tagName);
+ TQTag *newTag = m_write->userTagList.find(tagName);
bool insertNew = !newTag;
if (insertNew)
{
@@ -340,7 +340,7 @@ void Tag::parse(const TQString &p_tagStr, Document *p_write)
}
if (insertNew)
{
- m_write->userTagList.tqreplace(tagName, newTag);
+ m_write->userTagList.replace(tagName, newTag);
}
}
}
@@ -584,7 +584,7 @@ void Tag::modifyAttributes(TQDict<TQString> *attrDict)
}
for (uint i = 0 ; i < attrs.count(); i++)
{
- if ( !attrDict->tqfind(attrs[i].name) )
+ if ( !attrDict->find(attrs[i].name) )
{
attrs.remove(attrs.at(i));
}
@@ -660,10 +660,10 @@ bool Tag::isInsideScript(const TQString &str)
//This detects if the last char from str is inside a script area or not, to
//treat cases like <a href="<? echo "foo" ?>"> correctly
//TODO: speed up if you can...
- if (str.tqfind(m_dtd->specialAreaStartRx) != -1)
+ if (str.find(m_dtd->specialAreaStartRx) != -1)
{
TQString foundString = m_dtd->specialAreaStartRx.cap();
- if (str.tqfind(m_dtd->specialAreas[foundString]) == -1)
+ if (str.find(m_dtd->specialAreas[foundString]) == -1)
{
return true;
}