summaryrefslogtreecommitdiffstats
path: root/quanta/parsers/parser.cpp
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/parser.cpp
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/parser.cpp')
-rw-r--r--quanta/parsers/parser.cpp56
1 files changed, 28 insertions, 28 deletions
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;