mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Small cleanup to LayoutBox and CategorizedCombo
Coverity does not find it obvious that p is never negative. Normally it is the case (because the items have been filtered), but it is better to play safe.
This commit is contained in:
parent
c99e2f1fad
commit
0f220503ff
@ -271,10 +271,10 @@ QString CCItemDelegate::underlineFilter(QString const & s) const
|
||||
// step through data item and put "(x)" for every matching character
|
||||
QString r;
|
||||
int lastp = -1;
|
||||
cc_->filter();
|
||||
for (int i = 0; i < f.length(); ++i) {
|
||||
int p = s.indexOf(f[i], lastp + 1, Qt::CaseInsensitive);
|
||||
LASSERT(p != -1, /**/);
|
||||
if (p < 0)
|
||||
continue;
|
||||
if (lastp == p - 1 && lastp != -1) {
|
||||
// remove ")" and append "x)"
|
||||
r = r.left(r.length() - 4) + s[p] + "</u>";
|
||||
|
@ -320,10 +320,10 @@ QString LayoutItemDelegate::underlineFilter(QString const & s) const
|
||||
// step through data item and put "(x)" for every matching character
|
||||
QString r;
|
||||
int lastp = -1;
|
||||
layout_->filter();
|
||||
for (int i = 0; i < f.length(); ++i) {
|
||||
int p = s.indexOf(f[i], lastp + 1, Qt::CaseInsensitive);
|
||||
LASSERT(p != -1, continue);
|
||||
if (p < 0)
|
||||
continue;
|
||||
if (lastp == p - 1 && lastp != -1) {
|
||||
// remove ")" and append "x)"
|
||||
r = r.left(r.length() - 4) + s[p] + "</u>";
|
||||
|
Loading…
Reference in New Issue
Block a user