diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-16 10:00:09 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-16 10:00:09 -0600 |
commit | 3b34e5cf56262c9f54a3bcf02ee5ad93ca0fb05b (patch) | |
tree | 4405f233f4b0eee7f4ad3d265a5584c9ce681011 /poxml/parser.cpp | |
parent | d6331f1b56eb6dca7a1950658b2932f208015da0 (diff) | |
download | tdesdk-3b34e5cf56262c9f54a3bcf02ee5ad93ca0fb05b.tar.gz tdesdk-3b34e5cf56262c9f54a3bcf02ee5ad93ca0fb05b.zip |
Revert "Rename a number of old tq methods that are no longer tq specific"
This reverts commit d6331f1b56eb6dca7a1950658b2932f208015da0.
Diffstat (limited to 'poxml/parser.cpp')
-rw-r--r-- | poxml/parser.cpp | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/poxml/parser.cpp b/poxml/parser.cpp index be06d80a..b4f0161b 100644 --- a/poxml/parser.cpp +++ b/poxml/parser.cpp @@ -44,7 +44,7 @@ static const char *cuttingtags[] = {"bridgehead", "trans_comment", "para", "titl "revdescription", "glossentry", "partinfo", "segmentedlist", "segtitle", "seg", "seglistitem", "screenco", 0}; -static const char *literaltags[] = {"literallayout", "synopsis", "screen", +static const char *literaltags[] = {"literaltqlayout", "synopsis", "screen", "programlisting", 0}; bool StructureParser::fatalError ( const TQXmlParseException &e ) @@ -99,7 +99,7 @@ bool StructureParser::isLiteralTag(const TQString &qName) bool StructureParser::skippedEntity ( const TQString & name ) { if (inside) - message += TQString("&%1;").arg(name); + message += TQString("&%1;").tqarg(name); return true; } @@ -126,10 +126,10 @@ bool StructureParser::startElement( const TQString& , const TQString& , { TQString tmp = "<" + tname; for (int i = 0; i < attr.length(); i++) { - tmp += TQString(" %1=\"%2\"").arg(attr.qName(i)).arg(attr.value(i)); + tmp += TQString(" %1=\"%2\"").tqarg(attr.qName(i)).tqarg(attr.value(i)); } - tmp += TQString(" poxml_line=\"%1\"").arg(locator->lineNumber()); - tmp += TQString(" poxml_col=\"%1\"").arg(locator->columnNumber()); + tmp += TQString(" poxml_line=\"%1\"").tqarg(locator->lineNumber()); + tmp += TQString(" poxml_col=\"%1\"").tqarg(locator->columnNumber()); if (isSingleTag(qName)) tmp += "/>"; @@ -180,8 +180,8 @@ bool StructureParser::closureTag(const TQString& message, const TQString &tag) uint index = 0; while (true) { - int nextclose = message.find(TQRegExp(TQString::fromLatin1("</%1[\\s>]").arg(tag)), index); - int nextstart = message.find(TQRegExp(TQString::fromLatin1("<%1[>\\s]").arg(tag)), index); + int nextclose = message.find(TQRegExp(TQString::tqfromLatin1("</%1[\\s>]").tqarg(tag)), index); + int nextstart = message.find(TQRegExp(TQString::tqfromLatin1("<%1[>\\s]").tqarg(tag)), index); // qDebug("finding %d %d %d %d", nextstart, nextclose, index, inside); if (nextclose == -1) { #ifdef POXML_DEBUG @@ -223,7 +223,7 @@ void StructureParser::descape(TQString &message) bool lastws = false; while (index < message.length()) { - switch (message.at(index).latin1()) { + switch (message.tqat(index).latin1()) { case '\n': case '\t': case '\r': @@ -278,7 +278,7 @@ bool StructureParser::formatMessage(MsgBlock &msg) const { int slen = strlen(singletags[index]); - if (msg.msgid.left(slen + 1) == TQString::fromLatin1("<%1").arg(singletags[index]) && + if (msg.msgid.left(slen + 1) == TQString::tqfromLatin1("<%1").tqarg(singletags[index]) && !msg.msgid.at( slen + 1 ).isLetterOrNumber() ) { #ifdef POXML_DEBUG @@ -418,9 +418,9 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb) #endif // the exception for poxml_* attributes is made in the closing tag - int closing_index = message.find(TQRegExp(TQString::fromLatin1("</%1[\\s>]").arg(tag)), + int closing_index = message.find(TQRegExp(TQString::tqfromLatin1("</%1[\\s>]").tqarg(tag)), strindex); - int starting_index = message.find(TQRegExp(TQString::fromLatin1("<%1[\\s>]").arg(tag)), + int starting_index = message.find(TQRegExp(TQString::tqfromLatin1("<%1[\\s>]").tqarg(tag)), strindex); #ifdef POXML_DEBUG @@ -529,9 +529,9 @@ MsgList StructureParser::splitMessage(const MsgBlock &mb) qDebug("inside %s %d", message.mid(strindex, 35).latin1(), inside); #endif - int closing_index = message.findRev(TQRegExp(TQString::fromLatin1("</%1[\\s>]").arg(tag)), + int closing_index = message.findRev(TQRegExp(TQString::tqfromLatin1("</%1[\\s>]").tqarg(tag)), strindex - 1); - int starting_index = message.findRev(TQRegExp(TQString::fromLatin1("<%1[\\s>]").arg(tag)), + int starting_index = message.findRev(TQRegExp(TQString::tqfromLatin1("<%1[\\s>]").tqarg(tag)), strindex - 1); #ifdef POXML_DEBUG @@ -601,9 +601,9 @@ bool StructureParser::endElement( const TQString& , const TQString&, const TQStr if (inside) { if (!isSingleTag(qName)) { - message += TQString("</%1").arg(tname); - message += TQString(" poxml_line=\"%1\"").arg(locator->lineNumber()); - message += TQString(" poxml_col=\"%1\"").arg(locator->columnNumber()); + message += TQString("</%1").tqarg(tname); + message += TQString(" poxml_line=\"%1\"").tqarg(locator->lineNumber()); + message += TQString(" poxml_col=\"%1\"").tqarg(locator->columnNumber()); message += ">"; } } @@ -713,8 +713,8 @@ void StructureParser::cleanupTags( TQString &contents ) contents.replace(TQRegExp("&"), "!POXML_AMP!"); for (int index = 0; literaltags[index]; index++) { - TQRegExp start(TQString("<%1[\\s>]").arg(literaltags[index])); - TQRegExp end(TQString("</%1[\\s>]").arg(literaltags[index])); + TQRegExp start(TQString("<%1[\\s>]").tqarg(literaltags[index])); + TQRegExp end(TQString("</%1[\\s>]").tqarg(literaltags[index])); int strindex = 0; while (true) { strindex = contents.find(start, strindex); @@ -739,7 +739,7 @@ void StructureParser::cleanupTags( TQString &contents ) if (index < 0) break; TQString tag = unclosed.cap(1); - contents.replace(index, unclosed.matchedLength(), TQString("</%1>").arg(tag)); + contents.replace(index, unclosed.matchedLength(), TQString("</%1>").tqarg(tag)); } TQRegExp start("<((\\s*[^<>\\s])*)\\s\\s*(/*)>"); @@ -753,7 +753,7 @@ void StructureParser::cleanupTags( TQString &contents ) TQString tag = start.cap(1); TQString cut = start.capturedTexts().last(); // qDebug("UNCLO %s %d -%s- -%s-", start.cap(0).latin1(), index, tag.latin1(), cut.latin1()); - contents.replace(index, start.matchedLength(), TQString("<%1%2>").arg(tag).arg(cut)); + contents.replace(index, start.matchedLength(), TQString("<%1%2>").tqarg(tag).tqarg(cut)); } TQRegExp singletag("<(\\w*)\\s([^><]*)/>"); @@ -764,7 +764,7 @@ void StructureParser::cleanupTags( TQString &contents ) break; TQString tag = singletag.cap(1); if (!StructureParser::isSingleTag(tag)) { - contents.replace(index, singletag.matchedLength(), TQString("<%1 %2></%3>").arg(tag).arg(singletag.cap(2)).arg(tag)); + contents.replace(index, singletag.matchedLength(), TQString("<%1 %2></%3>").tqarg(tag).tqarg(singletag.cap(2)).tqarg(tag)); } } @@ -775,7 +775,7 @@ void StructureParser::cleanupTags( TQString &contents ) if (index < 0) break; TQString msgid = trans_comment.cap(1); - contents.replace(index, trans_comment.matchedLength(), TQString("<trans_comment>%1</trans_comment>").arg(msgid)); + contents.replace(index, trans_comment.matchedLength(), TQString("<trans_comment>%1</trans_comment>").tqarg(msgid)); } #ifdef POXML_DEBUG @@ -788,7 +788,7 @@ static bool removeEmptyTag( TQString &contents, const TQString & tag) { // qDebug("cont %s %s", contents.latin1(), tag.latin1()); - TQRegExp empty(TQString("<%1[^>]*>[\\s\n][\\s\n]*</%2\\s*>").arg(tag).arg(tag)); + TQRegExp empty(TQString("<%1[^>]*>[\\s\n][\\s\n]*</%2\\s*>").tqarg(tag).tqarg(tag)); int strindex = 0; while (true) { strindex = contents.find(empty, strindex); @@ -938,7 +938,7 @@ MsgList parseXML(const char *filename) TQString replacement = ""; while (contents.at(endindex) != '>' || inside) { - switch (contents.at(endindex).latin1()) { + switch (contents.tqat(endindex).latin1()) { case '<': inside++; break; case '>': @@ -977,8 +977,8 @@ MsgList parseXML(const char *filename) { TQMap<TQString,TQString>::Iterator found = msgids.find((*it).msgid); if ((*it).msgid.length() < 4) { - (*it).msgid = TQString("<%1>").arg((*it).tag) + (*it).msgid + - TQString("</%1>").arg((*it).tag); + (*it).msgid = TQString("<%1>").tqarg((*it).tag) + (*it).msgid + + TQString("</%1>").tqarg((*it).tag); changed = true; break; } @@ -993,7 +993,7 @@ MsgList parseXML(const char *filename) it2 != english.end(); it2++) { if ((*it2).msgid == msgid) - (*it2).msgid = TQString("<%1>").arg((*it2).tag) + msgid + TQString("</%1>").arg((*it2).tag); + (*it2).msgid = TQString("<%1>").tqarg((*it2).tag) + msgid + TQString("</%1>").tqarg((*it2).tag); } break; } |