summaryrefslogtreecommitdiffstats
path: root/bibletime/backend/bt_thmlhtml.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'bibletime/backend/bt_thmlhtml.cpp')
-rw-r--r--bibletime/backend/bt_thmlhtml.cpp68
1 files changed, 34 insertions, 34 deletions
diff --git a/bibletime/backend/bt_thmlhtml.cpp b/bibletime/backend/bt_thmlhtml.cpp
index 7a00bd4..3142d6b 100644
--- a/bibletime/backend/bt_thmlhtml.cpp
+++ b/bibletime/backend/bt_thmlhtml.cpp
@@ -29,8 +29,8 @@
#include "versekey.h"
//Qt includes
-#include <qstring.h>
-#include <qregexp.h>
+#include <tqstring.h>
+#include <tqregexp.h>
//System includes
#include <stdlib.h>
@@ -60,12 +60,12 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
return 1;
}
- QString result;
+ TQString result;
- QString t = QString::fromUtf8(buf.c_str());
- QRegExp tag("([.,;]?<sync[^>]+(type|value)=\"([^\"]+)\"[^>]+(type|value)=\"([^\"]+)\"([^<]*)>)+");
+ TQString t = TQString::fromUtf8(buf.c_str());
+ TQRegExp tag("([.,;]?<sync[^>]+(type|value)=\"([^\"]+)\"[^>]+(type|value)=\"([^\"]+)\"([^<]*)>)+");
- QStringList list;
+ TQStringList list;
int lastMatchEnd = 0;
int pos = tag.search(t,0);
@@ -84,12 +84,12 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
list.append(t.right(t.length() - lastMatchEnd));
}
- tag = QRegExp("<sync[^>]+(type|value|class)=\"([^\"]+)\"[^>]+(type|value|class)=\"([^\"]+)\"[^>]+((type|value|class)=\"([^\"]+)\")*([^<]*)>");
+ tag = TQRegExp("<sync[^>]+(type|value|class)=\"([^\"]+)\"[^>]+(type|value|class)=\"([^\"]+)\"[^>]+((type|value|class)=\"([^\"]+)\")*([^<]*)>");
- for (QStringList::iterator it = list.begin(); it != list.end(); ++it) {
- QString e( *it );
+ for (TQStringList::iterator it = list.begin(); it != list.end(); ++it) {
+ TQString e( *it );
- const bool textPresent = (e.stripWhiteSpace().remove(QRegExp("[.,;:]")).left(1) != "<");
+ const bool textPresent = (e.stripWhiteSpace().remove(TQRegExp("[.,;:]")).left(1) != "<");
if (!textPresent) {
continue;
@@ -101,14 +101,14 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
int pos = tag.search(e, 0);
bool insertedTag = false;
- QString value;
- QString valueClass;
+ TQString value;
+ TQString valueClass;
while (pos != -1) {
bool isMorph = false;
bool isStrongs = false;
- value = QString::null;
- valueClass = QString::null;
+ value = TQString::null;
+ valueClass = TQString::null;
// check 3 attribute/value pairs
@@ -143,10 +143,10 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
e.replace(pos, tag.matchedLength(), "</span>");
pos += 7;
- QString rep;
+ TQString rep;
rep.setLatin1("<span lemma=\"").append(value).append("\">");
int startPos = 0;
- QChar c = e[startPos];
+ TQChar c = e[startPos];
while ((startPos < pos) && (c.isSpace() || c.isPunct())) {
++startPos;
@@ -164,12 +164,12 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
if ((!isMorph && hasLemmaAttr) || (isMorph && hasMorphAttr)) { //we append another attribute value, e.g. 3000 gets 3000|5000
//search the existing attribute start
- QRegExp attrRegExp( isMorph ? "morph=\".+(?=\")" : "lemma=\".+(?=\")" );
+ TQRegExp attrRegExp( isMorph ? "morph=\".+(?=\")" : "lemma=\".+(?=\")" );
attrRegExp.setMinimal(true);
const int foundAttrPos = e.find(attrRegExp, pos);
if (foundAttrPos != -1) {
- e.insert(foundAttrPos + attrRegExp.matchedLength(), QString("|").append(value));
+ e.insert(foundAttrPos + attrRegExp.matchedLength(), TQString("|").append(value));
pos += value.length() + 1;
hasLemmaAttr = !isMorph;
@@ -177,10 +177,10 @@ char BT_ThMLHTML::processText(sword::SWBuf& buf, const sword::SWKey* key, const
}
}
else { //attribute was not yet inserted
- const int attrPos = e.find(QRegExp("morph=|lemma="), 0);
+ const int attrPos = e.find(TQRegExp("morph=|lemma="), 0);
if (attrPos >= 0) {
- QString attr;
+ TQString attr;
attr.append(isMorph ? "morph" : "lemma").append("=\"").append(value).append("\" ");
e.insert(attrPos, attr);
@@ -217,7 +217,7 @@ bool BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
if (tag.getAttribute("lang")) {
const char* abbrev = tag.getAttribute("lang");
- //const CLanguageMgr::Language* const language = CPointers::languageMgr()->languageForAbbrev( QString::fromLatin1(abbrev) );
+ //const CLanguageMgr::Language* const language = CPointers::languageMgr()->languageForAbbrev( TQString::fromLatin1(abbrev) );
buf.append("<span class=\"foreign\" lang=\"");
buf.append(abbrev);
@@ -241,7 +241,7 @@ bool BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
buf.append('/');
buf.append(myUserData->key->getShortText());
buf.append('/');
- buf.append( QString::number(myUserData->swordFootnote++).latin1() );
+ buf.append( TQString::number(myUserData->swordFootnote++).latin1() );
buf.append("\">*</span> ");
myUserData->suspendTextPassThru = true;
@@ -270,22 +270,22 @@ bool BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
Q_ASSERT(mod);
if (mod) {
CReferenceManager::ParseOptions options;
- options.refBase = QString::fromUtf8(myUserData->key->getText()); //current module key
- options.refDestinationModule = QString(mod->name());
- options.sourceLanguage = QString(myModule->Lang());
- options.destinationLanguage = QString("en");
+ options.refBase = TQString::fromUtf8(myUserData->key->getText()); //current module key
+ options.refDestinationModule = TQString(mod->name());
+ options.sourceLanguage = TQString(myModule->Lang());
+ options.destinationLanguage = TQString("en");
//it's ok to split the reference, because to descriptive text is given
bool insertSemicolon = false;
buf.append("<span class=\"crossreference\">");
- QStringList refs = QStringList::split(";", QString::fromUtf8(myUserData->lastTextNode.c_str()));
- QString oldRef; //the previous reference to use as a base for the next refs
- for (QStringList::iterator it(refs.begin()); it != refs.end(); ++it) {
+ TQStringList refs = TQStringList::split(";", TQString::fromUtf8(myUserData->lastTextNode.c_str()));
+ TQString oldRef; //the previous reference to use as a base for the next refs
+ for (TQStringList::iterator it(refs.begin()); it != refs.end(); ++it) {
if (! oldRef.isEmpty() ){
options.refBase = oldRef; //use the last ref as a base, e.g. Rom 1,2-3, when the next ref is only 3:3-10
}
- const QString completeRef( CReferenceManager::parseVerseReference((*it), options) );
+ const TQString completeRef( CReferenceManager::parseVerseReference((*it), options) );
oldRef = completeRef; //use the parsed result as the base for the next ref.
@@ -329,12 +329,12 @@ bool BT_ThMLHTML::handleToken(sword::SWBuf &buf, const char *token, sword::Basic
Q_ASSERT(mod);
CReferenceManager::ParseOptions options;
- options.refBase = QString::fromUtf8(myUserData->key->getText());
- options.refDestinationModule = QString(mod->name());
+ options.refBase = TQString::fromUtf8(myUserData->key->getText());
+ options.refDestinationModule = TQString(mod->name());
options.sourceLanguage = myModule->Lang();
- options.destinationLanguage = QString("en");
+ options.destinationLanguage = TQString("en");
- const QString completeRef = CReferenceManager::parseVerseReference(QString::fromUtf8(ref), options);
+ const TQString completeRef = CReferenceManager::parseVerseReference(TQString::fromUtf8(ref), options);
if (mod) {
buf.append("<span class=\"crossreference\">");