X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fuisupport%2Fuistyle.cpp;h=0420a7c83c60baf7bc865742d6f7b56195d22e38;hp=017fee24689efd5e6953fe4587bafd7d5d1c4b57;hb=38090a4af09e05763abf43bf95cd7d4696381a09;hpb=76a276c472cb99032e2407d8e4bc2f2d693e8e67 diff --git a/src/uisupport/uistyle.cpp b/src/uisupport/uistyle.cpp index 017fee24..0420a7c8 100644 --- a/src/uisupport/uistyle.cpp +++ b/src/uisupport/uistyle.cpp @@ -130,6 +130,13 @@ QString UiStyle::formatCode(FormatType ftype) const { } UiStyle::StyledText UiStyle::styleString(QString s) { + // FIXME + // The following two lines fix garbled fonts for me. I have no effing clue how or why. + // Without comparing s to something (anything), invalid formats with negative lengths are created... + // This smells like a gcc/Qt error or something, but maybe it's my fault somehow. + bool flg = (s == "foo"); + Q_UNUSED(flg); + StyledText result; QList fmtList; fmtList.append(None); @@ -137,7 +144,7 @@ UiStyle::StyledText UiStyle::styleString(QString s) { curFmtRng.format = format(None); curFmtRng.start = 0; result.formats.append(curFmtRng); - int pos = 0; int length; + int pos = 0; int length = 0; int fgCol = -1, bgCol = -1; // marks current mIRC color for(;;) { pos = s.indexOf('%', pos);