diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-01-21 08:45:20 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2020-01-30 11:01:27 +0100 |
commit | 974bead30f32a832180126944973c82f5bc6f6e2 (patch) | |
tree | 1166fc9403bb9c2b93cf0c601396a8d214776d4a | |
parent | 8ac97535de5f4ba9e62fad5b7dd4e3cb3d587da9 (diff) |
Workaround for Application.WordBasic.DisableAutoMacros not working
Invoke() only works for this method when pVarResult is 0.
Fix as contributed on report.
Fixes: QTBUG-81543
Change-Id: I8163bccc9c69ef9c5bffb5270d2779e94e587c7e
Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
-rw-r--r-- | src/activeqt/container/qaxbase.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/activeqt/container/qaxbase.cpp b/src/activeqt/container/qaxbase.cpp index 1262944..cdaef30 100644 --- a/src/activeqt/container/qaxbase.cpp +++ b/src/activeqt/container/qaxbase.cpp @@ -4021,6 +4021,12 @@ bool QAxBase::dynamicCallHelper(const char *name, void *inout, QList<QVariant> & UINT argerr = 0; HRESULT hres = Invoke(disp, dispid, IID_NULL, LOCALE_USER_DEFAULT, disptype, ¶ms, res, &excepinfo, &argerr); + if (hres == DISP_E_MEMBERNOTFOUND && (disptype & DISPATCH_METHOD) != 0) { + // Retry with pVarResult = 0, workaround for "Word.Application.WordBasic.DisableAutoMacros(bool)" + memset(&excepinfo, 0, sizeof(excepinfo)); + argerr = 0; + hres = Invoke(disp, dispid, IID_NULL, LOCALE_USER_DEFAULT, disptype, ¶ms, nullptr, &excepinfo, &argerr); + } if (disptype == (DISPATCH_METHOD|DISPATCH_PROPERTYGET) && hres == S_OK && varc) { for (int i = 0; i < varc; ++i) |