summaryrefslogtreecommitdiffstats
path: root/src/field.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/field.cpp')
-rw-r--r--src/field.cpp34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/field.cpp b/src/field.cpp
index a5ab6a6..c260e9a 100644
--- a/src/field.cpp
+++ b/src/field.cpp
@@ -171,7 +171,7 @@ const TQString& Field::defaultValue() const {
}
void Field::setDefaultValue(const TQString& value_) {
- if(m_type != Choice || m_allowed.tqfindIndex(value_) > -1) {
+ if(m_type != Choice || m_allowed.findIndex(value_) > -1) {
setProperty(TQString::tqfromLatin1("default"), value_);
}
}
@@ -211,7 +211,7 @@ TQStringList Field::dependsOn() const {
TQRegExp rx(TQString::tqfromLatin1("%\\{(.+)\\}"));
rx.setMinimal(true);
// do NOT call recursively!
- for(int pos = m_desc.tqfind(rx); pos > -1; pos = m_desc.tqfind(rx, pos+3)) {
+ for(int pos = m_desc.find(rx); pos > -1; pos = m_desc.find(rx, pos+3)) {
list << rx.cap(1);
}
return list;
@@ -248,7 +248,7 @@ TQString Field::formatTitle(const TQString& title_) {
// special case for multi-column tables, assume user never has '::' in a value
const TQString colonColon = TQString::tqfromLatin1("::");
TQString tail;
- if(newTitle.tqfind(colonColon) > -1) {
+ if(newTitle.find(colonColon) > -1) {
tail = colonColon + newTitle.section(colonColon, 1);
newTitle = newTitle.section(colonColon, 0, 0);
}
@@ -268,7 +268,7 @@ TQString Field::formatTitle(const TQString& title_) {
TQRegExp regexp(TQChar('^') + TQRegExp::escape(*it) + TQString::tqfromLatin1("\\s*"), false);
// can't just use *it since it's in lower-case
TQString article = newTitle.left((*it).length());
- newTitle = newTitle.tqreplace(regexp, TQString())
+ newTitle = newTitle.replace(regexp, TQString())
.append(TQString::tqfromLatin1(", "))
.append(article);
break;
@@ -277,7 +277,7 @@ TQString Field::formatTitle(const TQString& title_) {
}
// also, arbitrarily impose rule that a space must follow every comma
- newTitle.tqreplace(comma_split, TQString::tqfromLatin1(", "));
+ newTitle.replace(comma_split, TQString::tqfromLatin1(", "));
return newTitle + tail;
}
@@ -303,11 +303,11 @@ TQString Field::formatName(const TQString& name_, bool multiple_/*=true*/) {
TQString name = *it;
// special case for 2-column tables, assume user never has '::' in a value
TQString tail;
- if(name.tqfind(colonColon) > -1) {
+ if(name.find(colonColon) > -1) {
tail = colonColon + name.section(colonColon, 1);
name = name.section(colonColon, 0, 0);
}
- name.tqreplace(periodSpace, TQString::tqfromLatin1(". "));
+ name.replace(periodSpace, TQString::tqfromLatin1(". "));
if(Config::autoCapitalization()) {
name = capitalize(name);
}
@@ -317,10 +317,10 @@ TQString Field::formatName(const TQString& name_, bool multiple_/*=true*/) {
lastWord.setPattern(TQChar('^') + TQRegExp::escape(words.last()) + TQChar('$'));
// if it contains a comma already and the last word is not a suffix, don't format it
- if(!Config::autoFormat() || (name.tqfind(',') > -1 && Config::nameSuffixList().grep(lastWord).isEmpty())) {
+ if(!Config::autoFormat() || (name.find(',') > -1 && Config::nameSuffixList().grep(lastWord).isEmpty())) {
// arbitrarily impose rule that no spaces before a comma and
// a single space after every comma
- name.tqreplace(comma_split, TQString::tqfromLatin1(", "));
+ name.replace(comma_split, TQString::tqfromLatin1(", "));
names << name + tail;
continue;
}
@@ -398,11 +398,11 @@ TQString Field::capitalize(TQString str_) {
return str_;
}
// first letter is always capitalized
- str_.tqreplace(0, 1, str_.tqat(0).upper());
+ str_.replace(0, 1, str_.tqat(0).upper());
// special case for french words like l'espace
- int pos = str_.tqfind(rx, 1);
+ int pos = str_.find(rx, 1);
int nextPos;
TQRegExp wordRx;
@@ -418,14 +418,14 @@ TQString Field::capitalize(TQString str_) {
for(TQStringList::ConstIterator it = s_articlesApos.begin(); it != s_articlesApos.end(); ++it) {
if(word.lower().startsWith(*it)) {
uint l = (*it).length();
- str_.tqreplace(l, 1, str_.tqat(l).upper());
+ str_.replace(l, 1, str_.tqat(l).upper());
break;
}
}
while(pos > -1) {
// also need to compare against list of non-capitalized words
- nextPos = str_.tqfind(rx, pos+1);
+ nextPos = str_.find(rx, pos+1);
if(nextPos == -1) {
nextPos = str_.length();
}
@@ -435,7 +435,7 @@ TQString Field::capitalize(TQString str_) {
for(TQStringList::ConstIterator it = s_articlesApos.begin(); it != s_articlesApos.end(); ++it) {
if(word.lower().startsWith(*it)) {
uint l = (*it).length();
- str_.tqreplace(pos+l+1, 1, str_.tqat(pos+l+1).upper());
+ str_.replace(pos+l+1, 1, str_.tqat(pos+l+1).upper());
aposMatch = true;
break;
}
@@ -444,11 +444,11 @@ TQString Field::capitalize(TQString str_) {
if(!aposMatch) {
wordRx.setPattern(TQChar('^') + TQRegExp::escape(word) + TQChar('$'));
if(notCap.grep(wordRx).isEmpty() && nextPos-pos > 1) {
- str_.tqreplace(pos+1, 1, str_.tqat(pos+1).upper());
+ str_.replace(pos+1, 1, str_.tqat(pos+1).upper());
}
}
- pos = str_.tqfind(rx, pos+1);
+ pos = str_.find(rx, pos+1);
}
return str_;
}
@@ -528,7 +528,7 @@ void Field::addAllowed(const TQString& value_) {
if(m_type != Choice) {
return;
}
- if(m_allowed.tqfindIndex(value_) == -1) {
+ if(m_allowed.findIndex(value_) == -1) {
m_allowed += value_;
}
}