summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextdocument.cpp
diff options
context:
space:
mode:
authorQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-01-09 01:00:25 +0100
committerQt Forward Merge Bot <qt_forward_merge_bot@qt-project.org>2020-01-09 01:00:26 +0100
commit6074ebf728668288e082cf7dca15de215cc0f653 (patch)
treeddc25bb3fa460618353e873a8ac03db30f4950e2 /src/gui/text/qtextdocument.cpp
parent84bf4d90b7154940486d3c3969a81c259496e830 (diff)
parent5e66ea373a581d7e62b829d0ffa7f84d754c7f8f (diff)
Merge remote-tracking branch 'origin/5.15' into dev
Diffstat (limited to 'src/gui/text/qtextdocument.cpp')
-rw-r--r--src/gui/text/qtextdocument.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/text/qtextdocument.cpp b/src/gui/text/qtextdocument.cpp
index fb75954d9c..2d7f2bb844 100644
--- a/src/gui/text/qtextdocument.cpp
+++ b/src/gui/text/qtextdocument.cpp
@@ -2301,10 +2301,8 @@ static QStringList resolvedFontFamilies(const QTextCharFormat &format)
{
QStringList fontFamilies = format.fontFamilies().toStringList();
const QString mainFontFamily = format.fontFamily();
- if (!mainFontFamily.isEmpty() && !fontFamilies.startsWith(mainFontFamily)) {
- fontFamilies.removeAll(mainFontFamily);
- fontFamilies.prepend(mainFontFamily);
- }
+ if (!mainFontFamily.isEmpty() && !fontFamilies.contains(mainFontFamily))
+ fontFamilies.append(mainFontFamily);
return fontFamilies;
}