diff --git a/src/gui/text/qtextformat.cpp b/src/gui/text/qtextformat.cpp index 444850039bb..d47bbfc132d 100644 --- a/src/gui/text/qtextformat.cpp +++ b/src/gui/text/qtextformat.cpp @@ -455,6 +455,12 @@ Q_GUI_EXPORT QDataStream &operator<<(QDataStream &stream, const QTextFormat &fmt properties[QTextFormat::OldFontStretch] = it.value(); properties.erase(it); } + + it = properties.find(QTextFormat::TextUnderlineColor); + if (it != properties.end()) { + properties[QTextFormat::OldTextUnderlineColor] = it.value(); + properties.erase(it); + } } stream << fmt.format_type << properties; @@ -478,6 +484,8 @@ Q_GUI_EXPORT QDataStream &operator>>(QDataStream &stream, QTextFormat &fmt) key = QTextFormat::FontLetterSpacingType; else if (key == QTextFormat::OldFontStretch) key = QTextFormat::FontStretch; + else if (key == QTextFormat::OldTextUnderlineColor) + key = QTextFormat::TextUnderlineColor; fmt.d->insertProperty(key, it.value()); } diff --git a/src/gui/text/qtextformat.h b/src/gui/text/qtextformat.h index e1668f83629..87de1e7fbd3 100644 --- a/src/gui/text/qtextformat.h +++ b/src/gui/text/qtextformat.h @@ -222,6 +222,7 @@ public: // Should not be referenced in user code. OldFontLetterSpacingType = 0x2033, OldFontStretch = 0x2034, + OldTextUnderlineColor = 0x2010, ObjectType = 0x2f00,