aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/colorscheme.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-07-14 16:04:09 +0200
committerThorbjørn Lindeijer <thorbjorn.lindeijer@nokia.com>2009-07-14 16:05:42 +0200
commitccb1b6d3c51c73a5b75710d406175454fc542d56 (patch)
treed3de2ea702906b293362ee7971e7ba356719b4d3 /src/plugins/texteditor/colorscheme.cpp
parentc89e237d0080dc328fb0a77d7bed56e768794121 (diff)
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
Diffstat (limited to 'src/plugins/texteditor/colorscheme.cpp')
-rw-r--r--src/plugins/texteditor/colorscheme.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/texteditor/colorscheme.cpp b/src/plugins/texteditor/colorscheme.cpp
index 7a80f9b6ad1..6aa4116cf69 100644
--- a/src/plugins/texteditor/colorscheme.cpp
+++ b/src/plugins/texteditor/colorscheme.cpp
@@ -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());