summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorQt Continuous Integration System <qt-info@nokia.com>2010-05-07 07:02:24 (GMT)
committerQt Continuous Integration System <qt-info@nokia.com>2010-05-07 07:02:24 (GMT)
commit19db30f5b0a8a9a068a9acf9a20f08c86165393e (patch)
tree851b9df2d5892eb0e94433771626576a659235b7 /src/plugins
parentd6cb7c903069e1dfde3ffc69649354c97d160b68 (diff)
parent153f9f34008c0205cbbb88d03e7991aba932c913 (diff)
downloadQt-19db30f5b0a8a9a068a9acf9a20f08c86165393e.zip
Qt-19db30f5b0a8a9a068a9acf9a20f08c86165393e.tar.gz
Qt-19db30f5b0a8a9a068a9acf9a20f08c86165393e.tar.bz2
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2 into 4.7-integration
* '4.7' of scm.dev.nokia.troll.no:qt/oslo-staging-2: Fix auto-test failure on Mac/Linux/QWS. Some EGL implementations does not return a EGLNativeDisplayType Fixed the sizing of the dock area with fixed size dock widgets QSortFilterProxyModel: Warning or assert failure Performance issue with QGraphicsItem::ItemClipsChildrenToShape. Fixes crash in QGraphicsItem::mouseMove for untransformable items. Pack Graphics View booleans in quint32 bit fields. Fixes regression: SVG image loading would fail from QBuffer with pos!=0 Fix a bug in QGraphicsItem::scroll. Fixed the position of the dock widget when undocked
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/imageformats/svg/qsvgiohandler.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/plugins/imageformats/svg/qsvgiohandler.cpp b/src/plugins/imageformats/svg/qsvgiohandler.cpp
index 8155569..7b8463d 100644
--- a/src/plugins/imageformats/svg/qsvgiohandler.cpp
+++ b/src/plugins/imageformats/svg/qsvgiohandler.cpp
@@ -82,15 +82,19 @@ bool QSvgIOHandlerPrivate::load(QIODevice *device)
if (q->format().isEmpty())
q->canRead();
+ // # The SVG renderer doesn't handle trailing, unrelated data, so we must
+ // assume that all available data in the device is to be read.
bool res = false;
QBuffer *buf = qobject_cast<QBuffer *>(device);
if (buf) {
- res = r.load(buf->data());
+ const QByteArray &ba = buf->data();
+ res = r.load(QByteArray::fromRawData(ba.constData() + buf->pos(), ba.size() - buf->pos()));
+ buf->seek(ba.size());
} else if (q->format() == "svgz") {
- res = r.load(device->readAll()); // ### can't stream svgz
+ res = r.load(device->readAll());
} else {
xmlReader.setDevice(device);
- res = r.load(&xmlReader); //### doesn't leave pos() correctly
+ res = r.load(&xmlReader);
}
if (res) {