diff options
author | Tor Lillqvist <tml@collabora.com> | 2018-06-07 09:47:51 +0300 |
---|---|---|
committer | Michael Meeks <michael.meeks@collabora.com> | 2018-06-07 15:06:26 +0200 |
commit | 9a809384f6210e15f90e131a15b88b105c912092 (patch) | |
tree | 6a43c5729497698263a95f82033ff56bee216876 /extensions | |
parent | e5a730e7f0c8b6244536b87f54757ebe15fe2213 (diff) |
Improve logging in CXEnumVariant
Change-Id: Ia0c3f9f1e95980b14415a030fc40268629ae06f3
Reviewed-on: https://gerrit.libreoffice.org/55408
Reviewed-by: Michael Meeks <michael.meeks@collabora.com>
Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/source/ole/unoobjw.cxx | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/extensions/source/ole/unoobjw.cxx b/extensions/source/ole/unoobjw.cxx index 4f0747259183..81c7a124df6b 100644 --- a/extensions/source/ole/unoobjw.cxx +++ b/extensions/source/ole/unoobjw.cxx @@ -2087,10 +2087,11 @@ public: virtual HRESULT STDMETHODCALLTYPE Clone(IEnumVARIANT **ppEnum) override { (void) ppEnum; + SAL_INFO("extensions.olebridge", this << "@CXEnumVariant::Clone: E_NOTIMPL"); return E_NOTIMPL; } - virtual HRESULT STDMETHODCALLTYPE Next(ULONG celt, + virtual HRESULT STDMETHODCALLTYPE Next(ULONG const celt, VARIANT *rgVar, ULONG *pCeltFetched) override { @@ -2100,19 +2101,29 @@ public: *pCeltFetched = 0; if (celt == 0) + { + SAL_INFO("extensions.olebridge", this << "@CXEnumVariant::Next(" << celt << "): E_INVALIDARG"); return E_INVALIDARG; + } if (rgVar == NULL || (celt != 1 && pCeltFetched == NULL)) + { + SAL_INFO("extensions.olebridge", this << "@CXEnumVariant::Next(" << celt << "): E_FAIL"); return E_FAIL; + } for (ULONG i = 0; i < celt; i++) VariantInit(&rgVar[i]); - while (celt > 0) + ULONG nLeft = celt; + ULONG nReturned = 0; + while (nLeft > 0) { if (mnIndex >= mxCollection->getCount()) + { + SAL_INFO("extensions.olebridge", this << "@CXEnumVariant::Next(" << celt << "): got " << nReturned << ": S_FALSE"); return S_FALSE; - + } Any aIndex; aIndex <<= mnIndex; Any aElement = mxCollection->Item(aIndex, Any()); @@ -2121,14 +2132,17 @@ public: if (pCeltFetched) (*pCeltFetched)++; rgVar++; + nReturned++; mnIndex++; - celt--; + nLeft--; } + SAL_INFO("extensions.olebridge", this << "@CXEnumVariant::Next(" << celt << "): S_OK"); return S_OK; } virtual HRESULT STDMETHODCALLTYPE Reset() override { + SAL_INFO("extensions.olebridge", this << "@CXEnumVariant::Reset: S_OK"); mnIndex = 1; return S_OK; } @@ -2137,13 +2151,18 @@ public: { comphelper::Automation::AutomationInvokedZone aAutomationActive; + ULONG nSkipped = 0; while (celt > 0) { if (mnIndex >= mxCollection->getCount()) + { + SAL_INFO("extensions.olebridge", this << "@CXEnumVariant::Skip(" << celt << "): skipped " << nSkipped << ": S_FALSE"); return S_FALSE; + } mnIndex++; celt--; } + SAL_INFO("extensions.olebridge", this << "@CXEnumVariant::Skip(" << celt << "): S_OK"); return S_OK; } @@ -2284,6 +2303,8 @@ Sink::Call( const OUString& Method, Sequence< Any >& Arguments ) SAL_INFO("extensions.olebridge", "Sink::Call(" << Method << "): Calling Invoke(" << nMemId << ")"); nResult = pDispatch->Invoke(nMemId, IID_NULL, LOCALE_USER_DEFAULT, DISPATCH_METHOD, &aDispParams, &aVarResult, NULL, &uArgErr); + SAL_INFO("extensions.olebridge", "Sink::Call(" << Method << "): Invoke() returned"); + SAL_WARN_IF(!SUCCEEDED(nResult), "extensions.olebridge", "Call to " << Method << " failed: " << WindowsErrorStringFromHRESULT(nResult)); // Undo VT_BYREF magic done above. Copy out parameters back to the Anys in Arguments @@ -2393,7 +2414,7 @@ public: if (pcFetched && cConnections != 1) { SAL_INFO("extensions.olebridge", this << "@CXEnumConnections::Next(" << cConnections << "): E_INVALIDARG"); - return E_POINTER; + return E_INVALIDARG; } ULONG nFetched = 0; |