From 66c866aec945b0c74939d1c1a317407e9c0bff11 Mon Sep 17 00:00:00 2001 From: Marc Zinnschlag Date: Tue, 31 Mar 2015 13:02:12 +0200 Subject: [PATCH] fixed search result formatting --- apps/opencs/model/tools/search.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/opencs/model/tools/search.cpp b/apps/opencs/model/tools/search.cpp index 28d92f06a..db495be11 100644 --- a/apps/opencs/model/tools/search.cpp +++ b/apps/opencs/model/tools/search.cpp @@ -81,15 +81,15 @@ QString CSMTools::Search::formatDescription (const QString& description, int pos { QString text (description); - // compensate for Windows nonsense - text.remove ('\r'); - // split 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)); QString after = flatten (text.mid (pos+length, mPaddingAfter)); + // compensate for Windows nonsense + text.remove ('\r'); + // join text = before + "" + highlight + "" + after;