* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
- * (at your option) any later version. *
+ * (at your option) version 3. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
fmtList.append(None);
QTextLayout::FormatRange curFmtRng;
curFmtRng.format = format(None);
+ curFmtRng.start = 0;
result.formats.append(curFmtRng);
int pos = 0; int length;
int fgCol = -1, bgCol = -1; // marks current mIRC color
fmtList.clear(); fmtList.append(None);
curFmtRng.format = format(None);
fgCol = bgCol = -1;
- length = 1;
+ length = 2;
} else if(s[pos+1] == 'R') { // reverse
// TODO: implement reverse formatting
- length = 1;
+ length = 2;
} else { // all others are toggles
QString code = QString("%") + s[pos+1];
if(s[pos+1] == 'D') code += s[pos+2];
FormatType ftype = formatType(code);
- Q_ASSERT(ftype != Invalid);
+ if(ftype == Invalid) {
+ qWarning(qPrintable(QString("Invalid format code in string: %1").arg(s)));
+ continue;
+ }
+ //Q_ASSERT(ftype != Invalid);
length = code.length();
if(!fmtList.contains(ftype)) {
// toggle it on