Port qt_readEscapedFormatString() to qsizetype
More of the usual missing int -> qsizetype porting... Task-number: QTBUG-103531 Change-Id: I53faff5fe306c1d207741bc93a1e5c15d3eefa4f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 1aa00c993be4d7e27555bcd5c13f945766090b9c) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
parent
da2092aef1
commit
1540857174
@ -620,9 +620,9 @@ QLocaleId QLocaleId::fromName(QStringView name)
|
|||||||
return { langId, QLocalePrivate::codeToScript(script), QLocalePrivate::codeToTerritory(land) };
|
return { langId, QLocalePrivate::codeToScript(script), QLocalePrivate::codeToTerritory(land) };
|
||||||
}
|
}
|
||||||
|
|
||||||
QString qt_readEscapedFormatString(QStringView format, int *idx)
|
QString qt_readEscapedFormatString(QStringView format, qsizetype *idx)
|
||||||
{
|
{
|
||||||
int &i = *idx;
|
qsizetype &i = *idx;
|
||||||
|
|
||||||
Q_ASSERT(format.at(i) == u'\'');
|
Q_ASSERT(format.at(i) == u'\'');
|
||||||
++i;
|
++i;
|
||||||
@ -2101,7 +2101,7 @@ QString QLocale::toString(QDate date, FormatType format) const
|
|||||||
|
|
||||||
static bool timeFormatContainsAP(QStringView format)
|
static bool timeFormatContainsAP(QStringView format)
|
||||||
{
|
{
|
||||||
int i = 0;
|
qsizetype i = 0;
|
||||||
while (i < format.size()) {
|
while (i < format.size()) {
|
||||||
if (format.at(i).unicode() == '\'') {
|
if (format.at(i).unicode() == '\'') {
|
||||||
qt_readEscapedFormatString(format, &i);
|
qt_readEscapedFormatString(format, &i);
|
||||||
@ -3327,7 +3327,7 @@ QString QCalendarBackend::dateTimeToString(QStringView format, const QDateTime &
|
|||||||
day = parts.day;
|
day = parts.day;
|
||||||
}
|
}
|
||||||
|
|
||||||
int i = 0;
|
qsizetype i = 0;
|
||||||
while (i < format.size()) {
|
while (i < format.size()) {
|
||||||
if (format.at(i).unicode() == '\'') {
|
if (format.at(i).unicode() == '\'') {
|
||||||
result.append(qt_readEscapedFormatString(format, &i));
|
result.append(qt_readEscapedFormatString(format, &i));
|
||||||
|
@ -254,7 +254,7 @@ static QVariant macTimeToString(QTime time, bool short_format)
|
|||||||
static QVariant macToQtFormat(QStringView sys_fmt)
|
static QVariant macToQtFormat(QStringView sys_fmt)
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
int i = 0;
|
qsizetype i = 0;
|
||||||
|
|
||||||
while (i < sys_fmt.size()) {
|
while (i < sys_fmt.size()) {
|
||||||
if (sys_fmt.at(i).unicode() == '\'') {
|
if (sys_fmt.at(i).unicode() == '\'') {
|
||||||
|
@ -476,7 +476,7 @@ inline char QLocaleData::numericToCLocale(QStringView in) const
|
|||||||
|
|
||||||
// Also used to merely skip over an escape in a format string, advancint idx to
|
// Also used to merely skip over an escape in a format string, advancint idx to
|
||||||
// point after it (so not [[nodiscard]]):
|
// point after it (so not [[nodiscard]]):
|
||||||
QString qt_readEscapedFormatString(QStringView format, int *idx);
|
QString qt_readEscapedFormatString(QStringView format, qsizetype *idx);
|
||||||
[[nodiscard]] bool qt_splitLocaleName(QStringView name, QStringView *lang = nullptr,
|
[[nodiscard]] bool qt_splitLocaleName(QStringView name, QStringView *lang = nullptr,
|
||||||
QStringView *script = nullptr, QStringView *cntry = nullptr);
|
QStringView *script = nullptr, QStringView *cntry = nullptr);
|
||||||
[[nodiscard]] qsizetype qt_repeatCount(QStringView s);
|
[[nodiscard]] qsizetype qt_repeatCount(QStringView s);
|
||||||
|
@ -716,7 +716,7 @@ void QSystemLocalePrivate::update()
|
|||||||
QString QSystemLocalePrivate::winToQtFormat(QStringView sys_fmt)
|
QString QSystemLocalePrivate::winToQtFormat(QStringView sys_fmt)
|
||||||
{
|
{
|
||||||
QString result;
|
QString result;
|
||||||
int i = 0;
|
qsizetype i = 0;
|
||||||
|
|
||||||
while (i < sys_fmt.size()) {
|
while (i < sys_fmt.size()) {
|
||||||
if (sys_fmt.at(i).unicode() == u'\'') {
|
if (sys_fmt.at(i).unicode() == u'\'') {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user