mirror of
https://github.com/OpenMW/openmw.git
synced 2025-03-27 05:10:26 +00:00
fixed search result formatting
This commit is contained in:
parent
cb6caf5e39
commit
66c866aec9
1 changed files with 4 additions and 4 deletions
|
@ -81,15 +81,15 @@ QString CSMTools::Search::formatDescription (const QString& description, int pos
|
||||||
{
|
{
|
||||||
QString text (description);
|
QString text (description);
|
||||||
|
|
||||||
// compensate for Windows nonsense
|
|
||||||
text.remove ('\r');
|
|
||||||
|
|
||||||
// split
|
// split
|
||||||
QString highlight = flatten (text.mid (pos, length));
|
QString highlight = flatten (text.mid (pos, length));
|
||||||
QString before = flatten (mPaddingBefore<=pos ?
|
QString before = flatten (mPaddingBefore>=pos ?
|
||||||
text.mid (0, pos) : text.mid (pos-mPaddingBefore, mPaddingBefore));
|
text.mid (0, pos) : text.mid (pos-mPaddingBefore, mPaddingBefore));
|
||||||
QString after = flatten (text.mid (pos+length, mPaddingAfter));
|
QString after = flatten (text.mid (pos+length, mPaddingAfter));
|
||||||
|
|
||||||
|
// compensate for Windows nonsense
|
||||||
|
text.remove ('\r');
|
||||||
|
|
||||||
// join
|
// join
|
||||||
text = before + "<b>" + highlight + "</b>" + after;
|
text = before + "<b>" + highlight + "</b>" + after;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue