From 16271468daff14f8058c3366d6626ef2a186ff23 Mon Sep 17 00:00:00 2001 From: Michael Nutt Date: Fri, 12 Jan 2024 16:55:52 -0500 Subject: [PATCH] need size() to be compatible with QLatin1String --- Source/WTF/wtf/text/WTFString.h | 4 ++-- Source/WTF/wtf/text/qt/StringQt.cpp | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/Source/WTF/wtf/text/WTFString.h b/Source/WTF/wtf/text/WTFString.h index 9cc165c20ded7..509351b7351ad 100644 --- a/Source/WTF/wtf/text/WTFString.h +++ b/Source/WTF/wtf/text/WTFString.h @@ -39,7 +39,7 @@ QT_BEGIN_NAMESPACE class QString; class QStringView; -class QLatin1StringView; +class QLatin1String; class QByteArrayView; QT_END_NAMESPACE #endif @@ -263,7 +263,7 @@ class String final { #if PLATFORM(QT) WTF_EXPORT_PRIVATE String(const QString&); - WTF_EXPORT_PRIVATE String(QLatin1StringView); + WTF_EXPORT_PRIVATE String(QLatin1String); WTF_EXPORT_PRIVATE String(QStringView); WTF_EXPORT_PRIVATE String(QByteArrayView); WTF_EXPORT_PRIVATE operator QString() const; diff --git a/Source/WTF/wtf/text/qt/StringQt.cpp b/Source/WTF/wtf/text/qt/StringQt.cpp index a187b56c6a102..2b92aecd36972 100644 --- a/Source/WTF/wtf/text/qt/StringQt.cpp +++ b/Source/WTF/wtf/text/qt/StringQt.cpp @@ -28,12 +28,7 @@ #include #include #include -#if QT_VERSION >= QT_VERSION_CHECK(6, 4, 0) -#include -#else #include -using QLatin1StringView = QLatin1String; -#endif #include #include @@ -47,11 +42,11 @@ String::String(const QString& qstr) m_impl = StringImpl::create(reinterpret_cast_ptr(qstr.constData()), qstr.length()); } -String::String(QLatin1StringView view) +String::String(QLatin1String view) { if (view.isNull()) return; - m_impl = StringImpl::create(reinterpret_cast_ptr(view.data()), view.length()); + m_impl = StringImpl::create(reinterpret_cast_ptr(view.data()), view.size()); } String::String(QStringView view)