Skip to content
Snippets Groups Projects
Commit ccb1b6d3 authored by Thorbjørn Lindeijer's avatar Thorbjørn Lindeijer
Browse files

Fixed the issue where colors same as text color turn black

This was because they are not stored and thus loaded as invalid colors,
which is fine, but on saving the invalid colors would then turn into
black.

Reviewed-by: Roberto Raggi
parent c89e237d
No related branches found
No related tags found
No related merge requests found
......@@ -151,7 +151,8 @@ bool ColorScheme::save(const QString &fileName)
const Format &format = i.next().value();
w.writeStartElement(QLatin1String("style"));
w.writeAttribute(QLatin1String("name"), i.key());
if (i.key() == QLatin1String(Constants::C_TEXT) || format.foreground() != textFormat.foreground())
if (format.foreground().isValid() &&
(i.key() == QLatin1String(Constants::C_TEXT) || format.foreground() != textFormat.foreground()))
w.writeAttribute(QLatin1String("foreground"), format.foreground().name().toLower());
if (format.background().isValid())
w.writeAttribute(QLatin1String("background"), format.background().name().toLower());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment