summaryrefslogtreecommitdiff
path: root/noncore/net/mailit/textparser.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/mailit/textparser.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/mailit/textparser.cpp36
1 files changed, 23 insertions, 13 deletions
diff --git a/noncore/net/mailit/textparser.cpp b/noncore/net/mailit/textparser.cpp
index f082417..3fa5f6e 100644
--- a/noncore/net/mailit/textparser.cpp
+++ b/noncore/net/mailit/textparser.cpp
@@ -62,27 +62,37 @@ void TextParser::createSeparators()
/* Returns pos of given search criteria, -1 if not found */
int TextParser::find(QString target, QChar sep, int pos, bool upperCase)
{
+
+ t_splitElm parsstr;
+ QString pString;
+
int atLine = 0, atPosElm = 0;
- for (int x = 0; x < totalElmCount; x++) {
- if (x >= pos) {
- if (upperCase) {
- if ((splitDone[atLine].elm[atPosElm].str.upper() == target) &&
- (splitDone[atLine].elm[atPosElm].separator == sep))
- return x;
- } else {
- if ((splitDone[atLine].elm[atPosElm].str == target) &&
- (splitDone[atLine].elm[atPosElm].separator == sep))
- return x;
+ getLineReference(pos,&atLine,&atPosElm);
+
+ for (int x = pos; x < totalElmCount; x++)
+ {
+ parsstr=splitDone[atLine].elm[atPosElm++];
+
+ if (upperCase)
+ {
+ pString=parsstr.str.upper();
+ target=target.upper();
}
+ else
+ {
+ pString=parsstr.str;
}
- atPosElm++;
- if (atPosElm >= splitDone[atLine].elmCount) { //new Line
+ if ((pString == target) && (parsstr.separator == sep))
+ {
+ return x;
+ }
+ if (atPosElm >= splitDone[atLine].elmCount)
+ { //new Line
atLine++;
atPosElm = 0;
}
}
-
return -1;
}