[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    [calligra] libs/pigment/resources: Fix loading patterns
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2012-03-29 19:23:42
Message-ID: 20120329192342.209B7A60A9 () git ! kde ! org
[Download RAW message or body]

Git commit 394f57534a9a4c17552fe18e7ebf9a532cc90a17 by Boudewijn Rempt.
Committed on 26/03/2012 at 21:10.
Pushed by rempt into branch 'master'.

Fix loading patterns

We put the final 0 byte in the QString as well, and then everyone
gets really confused.

This fixes loading and saving patterns for textures brushes.

M  +2    -1    libs/pigment/resources/KoPattern.cpp

http://commits.kde.org/calligra/394f57534a9a4c17552fe18e7ebf9a532cc90a17

diff --git a/libs/pigment/resources/KoPattern.cpp b/libs/pigment/resources/KoPattern.cpp
index 9aa5c37..f357520 100644
--- a/libs/pigment/resources/KoPattern.cpp
+++ b/libs/pigment/resources/KoPattern.cpp
@@ -173,7 +173,8 @@ bool KoPattern::init(QByteArray& bytes)
         return false;
     }
 
-    setName(QString::fromAscii(name, size));
+    // size -1 so we don't add the end 0 to the QString...
+    setName(QString::fromAscii(name, size -1));
     delete[] name;
 
     if (bh.width == 0 || bh.height == 0) {

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic