diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-05-04 03:03:56 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-05-04 03:03:56 +0200 |
commit | 21a27816e66c8bea33b3ee28221df4b0c6ee9baf (patch) | |
tree | 3ef8d87833d30b1bdca80bd62e17b415cc3f9a0b | |
parent | 5c3a2a2de9bc8c7d76afbc042f94b388b53ce896 (diff) | |
parent | d3e7101032aa8c870fe4eda8ea5abe5bbfe4712e (diff) |
Merge remote-tracking branch 'origin/5.12' into 5.13
Change-Id: Ibfc5e4ce50bd3392567b6d3f3d00c1062a2d9149
-rw-r--r-- | src/activeqt/container/qaxbase.cpp | 6 | ||||
-rw-r--r-- | src/activeqt/control/qaxserverbase.cpp | 2 | ||||
-rw-r--r-- | tools/dumpcpp/main.cpp | 15 |
3 files changed, 21 insertions, 2 deletions
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp index bdd0c77..d87217f 100644 --- a/src/activeqt/container/qaxbase.cpp +++ b/src/activeqt/container/qaxbase.cpp @@ -60,6 +60,7 @@ #include <qhash.h> #include <qset.h> #include <qpair.h> +#include <qbitarray.h> #include <qmetaobject.h> #include <qsettings.h> #include <qdebug.h> @@ -3979,9 +3980,11 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> & disptype = DISPATCH_PROPERTYGET; } } + QBitArray outArgs; if (varc) { varc = qMin(varc, d->metaobj->numParameter(normFunction)); arg = varc <= QAX_NUM_PARAMS ? staticarg : new VARIANT[varc]; + outArgs = QBitArray(varc); for (int i = 0; i < varc; ++i) { QVariant var(vars.at(i)); VariantInit(arg + (varc - i - 1)); @@ -4004,6 +4007,7 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> & if (arg[varc - i - 1].vt == VT_EMPTY) QVariantToVARIANT(var, arg[varc - i - 1], paramType, out); + outArgs[i] = out; } } @@ -4036,7 +4040,7 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> & if (disptype == (DISPATCH_METHOD|DISPATCH_PROPERTYGET) && hres == S_OK && varc) { for (int i = 0; i < varc; ++i) - if (arg[varc-i-1].vt & VT_BYREF) // update out-parameters + if ((arg[varc-i-1].vt & VT_BYREF) || outArgs[i]) // update out-parameters vars[i] = VARIANTToQVariant(arg[varc-i-1], vars.at(i).typeName()); } diff --git a/src/activeqt/control/qaxserverbase.cpp b/src/activeqt/control/qaxserverbase.cpp index 4d277b6..e0ad0eb 100644 --- a/src/activeqt/control/qaxserverbase.cpp +++ b/src/activeqt/control/qaxserverbase.cpp @@ -702,6 +702,8 @@ public: } STDMETHOD(GetConnectionInterface)(IID *pIID) { + if (!pIID) + return E_POINTER; *pIID = iid; return S_OK; } diff --git a/tools/dumpcpp/main.cpp b/tools/dumpcpp/main.cpp index 4601aef..eb6f70a 100644 --- a/tools/dumpcpp/main.cpp +++ b/tools/dumpcpp/main.cpp @@ -935,6 +935,19 @@ static QByteArrayList vTableOnlyStubsFromTypeLib(ITypeLib *typelib, const QStrin return result; } +static void writeForwardDeclaration(QTextStream &declOut, const QByteArray &className) +{ + if (className.startsWith("enum ")) { + declOut << "#ifndef Q_CC_MINGW\n" + << " " << className << ';' << endl // Only MSVC accepts this + << "#else\n" + << " " << className << " {};" << endl + << "#endif\n"; + } else { + declOut << " " << className << ';' << endl; + } +} + bool generateTypeLibrary(QString typeLibFile, QString outname, const QString &nameSpace, ObjectCategories category) { @@ -1116,7 +1129,7 @@ bool generateTypeLibrary(QString typeLibFile, QString outname, for (int c = 0; c < classList.count(); ++c) { QByteArray className = classList.at(c); if (className.contains(' ')) { - declOut << " " << className << ';' << endl; + writeForwardDeclaration(declOut, className); namespaceForType.insert(className.mid(className.indexOf(' ') + 1), nspace); } else { declOut << " class " << className << ';' << endl; |