mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
Filter on consecutive sequences of characters.
The filters for the layout combo and document class combo share a problem: If you type "beam", e.g, in the latter case, then we will show any document class that contains those letters, in that order, but not necessarily consecutively. This is extremely confusing and, as José put it, just weird. So let's fix it. I'd call this a bug so would be happy to see this in stable, too.
This commit is contained in:
parent
d6cc58f4a3
commit
938ef60258
@ -292,13 +292,13 @@ QString CCItemDelegate::underlineFilter(QString const & s) const
|
||||
|
||||
static QString charFilterRegExpCC(QString const & filter)
|
||||
{
|
||||
QString re;
|
||||
QString re = ".*";
|
||||
for (int i = 0; i < filter.length(); ++i) {
|
||||
QChar c = filter[i];
|
||||
if (c.isLower())
|
||||
re += ".*[" + QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
|
||||
re += "[" + QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
|
||||
else
|
||||
re += ".*" + QRegExp::escape(c);
|
||||
re += QRegExp::escape(c);
|
||||
}
|
||||
return re;
|
||||
}
|
||||
|
@ -341,13 +341,13 @@ QString LayoutItemDelegate::underlineFilter(QString const & s) const
|
||||
|
||||
static QString charFilterRegExp(QString const & filter)
|
||||
{
|
||||
QString re;
|
||||
QString re = ".*";
|
||||
for (int i = 0; i < filter.length(); ++i) {
|
||||
QChar c = filter[i];
|
||||
if (c.isLower())
|
||||
re += ".*[" + QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
|
||||
re += "["+ QRegExp::escape(c) + QRegExp::escape(c.toUpper()) + "]";
|
||||
else
|
||||
re += ".*" + QRegExp::escape(c);
|
||||
re += QRegExp::escape(c);
|
||||
}
|
||||
return re;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user