summaryrefslogtreecommitdiffstats
path: root/src/corelib/text/qcollator_macx.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-02-06 01:00:58 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2020-02-06 11:38:18 +0100
commitd37f58e75b7d484ea8fde64dbf13e901d83a078f (patch)
treebad5b491b96b92ae52c27e38bd30466b7d55423c /src/corelib/text/qcollator_macx.cpp
parent8c6c4df3e83776d821f357582a717dbfbeb1c3ff (diff)
parent8ce0ad805d59da7be377233874a2783303f381f8 (diff)
Merge "Merge remote-tracking branch 'origin/5.14' into 5.15"
Diffstat (limited to 'src/corelib/text/qcollator_macx.cpp')
-rw-r--r--src/corelib/text/qcollator_macx.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/corelib/text/qcollator_macx.cpp b/src/corelib/text/qcollator_macx.cpp
index 071d7c048f..cb8e073d4a 100644
--- a/src/corelib/text/qcollator_macx.cpp
+++ b/src/corelib/text/qcollator_macx.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2013 Aleix Pol Gonzalez <aleixpol@kde.org>
+** Copyright (C) 2020 Aleix Pol Gonzalez <aleixpol@kde.org>
** Contact: https://www.qt.io/licensing/
**
** This file is part of the QtCore module of the Qt Toolkit.
@@ -94,6 +94,11 @@ void QCollatorPrivate::cleanup()
int QCollator::compare(QStringView s1, QStringView s2) const
{
+ if (!s1.size())
+ return s2.size() ? -1 : 0;
+ if (!s2.size())
+ return +1;
+
if (d->dirty)
d->init();
if (!d->collator)