QTextHtmlParser::lookupElement: port to QSV
Change-Id: I7d45d1a8985b57457eaa8226332929b6a1817108 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
This commit is contained in:
parent
b24630ce02
commit
bb5e3b56db
@ -413,17 +413,17 @@ static const QTextHtmlElement elements[Html_NumElements]= {
|
||||
{ "var", Html_var, QTextHtmlElement::DisplayInline },
|
||||
};
|
||||
|
||||
static bool operator<(const QString &str, const QTextHtmlElement &e)
|
||||
static bool operator<(QStringView str, const QTextHtmlElement &e)
|
||||
{
|
||||
return str < QLatin1StringView(e.name);
|
||||
}
|
||||
|
||||
static bool operator<(const QTextHtmlElement &e, const QString &str)
|
||||
static bool operator<(const QTextHtmlElement &e, QStringView str)
|
||||
{
|
||||
return QLatin1StringView(e.name) < str;
|
||||
}
|
||||
|
||||
static const QTextHtmlElement *lookupElementHelper(const QString &element)
|
||||
static const QTextHtmlElement *lookupElementHelper(QStringView element)
|
||||
{
|
||||
const QTextHtmlElement *start = &elements[0];
|
||||
const QTextHtmlElement *end = &elements[Html_NumElements];
|
||||
@ -433,7 +433,7 @@ static const QTextHtmlElement *lookupElementHelper(const QString &element)
|
||||
return e;
|
||||
}
|
||||
|
||||
int QTextHtmlParser::lookupElement(const QString &element)
|
||||
int QTextHtmlParser::lookupElement(QStringView element)
|
||||
{
|
||||
const QTextHtmlElement *e = lookupElementHelper(element);
|
||||
if (!e)
|
||||
|
@ -276,7 +276,7 @@ public:
|
||||
|
||||
void parse(const QString &text, const QTextDocument *resourceProvider);
|
||||
|
||||
static int lookupElement(const QString &element);
|
||||
static int lookupElement(QStringView element);
|
||||
|
||||
Q_GUI_EXPORT static QString parseEntity(QStringView entity);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user