diff options
author | Andy Shaw <qt-info@nokia.com> | 2010-09-10 07:09:16 (GMT) |
---|---|---|
committer | Andy Shaw <qt-info@nokia.com> | 2010-09-10 07:13:13 (GMT) |
commit | acb704241e752217bd2197a9884ade740db16d30 (patch) | |
tree | 05fef11f5fbd6d80806b959fadb8a137076e107f /src/activeqt/control | |
parent | 21a4c8f7f9ace18514f1d9fa9e203beaf6bd2844 (diff) | |
download | Qt-acb704241e752217bd2197a9884ade740db16d30.zip Qt-acb704241e752217bd2197a9884ade740db16d30.tar.gz Qt-acb704241e752217bd2197a9884ade740db16d30.tar.bz2 |
Read the data when the stream passed in is of type CArchiveStream
When the stream is of type CArchiveStream then Stat() is not implemented
and therefore it will not try to read the data. Therefore if this is
not implemented then we try to read the data in chunks instead until
there is no more to read or it fails.
Reviewed-by: Volker Hilsheimer
Diffstat (limited to 'src/activeqt/control')
-rw-r--r-- | src/activeqt/control/qaxserverbase.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index ca16b39..d8e7ea3 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -2730,6 +2730,19 @@ HRESULT WINAPI QAxServerBase::Load(IStream *pStm) qtarray.resize(stat.cbSize.LowPart); ULONG read; pStm->Read(qtarray.data(), stat.cbSize.LowPart, &read); + } else if (hres == E_NOTIMPL) { + ULONG read = 0; + while (hres != S_FALSE) { + QByteArray arrayRead; + arrayRead.resize(4098); + hres = pStm->Read(arrayRead.data(), arrayRead.size(), &read); + if (hres != S_OK && hres != S_FALSE) { + qtarray.resize(0); + break; + } else if (read == 0) + break; + qtarray.append(arrayRead); + } } const QMetaObject *mo = qt.object->metaObject(); |