summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qxpmhandler.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gui/image/qxpmhandler.cpp b/src/gui/image/qxpmhandler.cpp
index 1a68a819c7..e9ac4a9cc2 100644
--- a/src/gui/image/qxpmhandler.cpp
+++ b/src/gui/image/qxpmhandler.cpp
@@ -1129,14 +1129,14 @@ static bool write_xpm_image(const QImage &sourceImage, QIODevice *device, const
while (c != colorMap.end()) {
QRgb color = c.key();
if (image.format() != QImage::Format_RGB32 && !qAlpha(color))
- line.sprintf("\"%s c None\"",
- xpm_color_name(cpp, *c));
+ line = QString::asprintf("\"%s c None\"",
+ xpm_color_name(cpp, *c));
else
- line.sprintf("\"%s c #%02x%02x%02x\"",
- xpm_color_name(cpp, *c),
- qRed(color),
- qGreen(color),
- qBlue(color));
+ line = QString::asprintf("\"%s c #%02x%02x%02x\"",
+ xpm_color_name(cpp, *c),
+ qRed(color),
+ qGreen(color),
+ qBlue(color));
++c;
s << ',' << endl << line;
}