-rw-r--r-- | noncore/graphics/drawpad/drawpad.pro | 3 | ||||
-rw-r--r-- | noncore/graphics/drawpad/drawpadcanvas.cpp | 21 |
2 files changed, 2 insertions, 22 deletions
diff --git a/noncore/graphics/drawpad/drawpad.pro b/noncore/graphics/drawpad/drawpad.pro index 6bea193..8f70cc6 100644 --- a/noncore/graphics/drawpad/drawpad.pro +++ b/noncore/graphics/drawpad/drawpad.pro | |||
@@ -41,4 +41,3 @@ SOURCES = drawpad.cpp \ | |||
41 | tool.cpp | 41 | tool.cpp |
42 | INCLUDEPATH+= $(OPIEDIR)/include \ | 42 | INCLUDEPATH+= $(OPIEDIR)/include |
43 | $(QTDIR)/src/3rdparty/zlib | ||
44 | DEPENDPATH+= $(OPIEDIR)/include | 43 | DEPENDPATH+= $(OPIEDIR)/include |
diff --git a/noncore/graphics/drawpad/drawpadcanvas.cpp b/noncore/graphics/drawpad/drawpadcanvas.cpp index ae1b554..5437068 100644 --- a/noncore/graphics/drawpad/drawpadcanvas.cpp +++ b/noncore/graphics/drawpad/drawpadcanvas.cpp | |||
@@ -30,4 +30,2 @@ | |||
30 | 30 | ||
31 | #include <zlib.h> | ||
32 | |||
33 | const int PAGE_BACKUPS = 99; | 31 | const int PAGE_BACKUPS = 99; |
@@ -95,6 +93,2 @@ bool DrawPadCanvasXmlHandler::startElement(const QString& namespaceURI, const QS | |||
95 | m_dataFormat = atts.value("format"); | 93 | m_dataFormat = atts.value("format"); |
96 | |||
97 | if (m_dataFormat.isEmpty()) { | ||
98 | m_dataFormat = "XPM"; | ||
99 | } | ||
100 | } | 94 | } |
@@ -152,17 +146,4 @@ bool DrawPadCanvasXmlHandler::characters(const QString& ch) | |||
152 | 146 | ||
153 | |||
154 | QImage image; | 147 | QImage image; |
155 | 148 | image.loadFromData((const uchar*)byteArray.data(), m_dataLenght, m_dataFormat); | |
156 | if (m_dataFormat == "XPM") { | ||
157 | if (m_dataLenght < ch.length() * 5) { | ||
158 | m_dataLenght = ch.length() * 5; | ||
159 | } | ||
160 | |||
161 | QByteArray byteArrayUnzipped(m_dataLenght); | ||
162 | ::uncompress((uchar*)byteArrayUnzipped.data(), &m_dataLenght, (uchar*)byteArray.data(), byteArray.size()); | ||
163 | |||
164 | image.loadFromData((const uchar*)byteArrayUnzipped.data(), m_dataLenght, m_dataFormat); | ||
165 | } else { | ||
166 | image.loadFromData((const uchar*)byteArray.data(), m_dataLenght, m_dataFormat); | ||
167 | } | ||
168 | 149 | ||