Kaydet (Commit) 9eb489da authored tarafından Mike Kaganski's avatar Mike Kaganski

Properly check HRESULT

Although the IEnumFORMATETC::Next documentation only mentions S_OK and
S_FALSE, there are error codes that also may be returned: e.g.,
0x800706BA RPC server unavailable (encountered locally in a unit test).
In that case, this used to loop infinitely.

We are only interested in S_OK result, so check for it.

Change-Id: I062e409e84efb68353321f7c48d922ec83191f73
Reviewed-on: https://gerrit.libreoffice.org/61621
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst fb0c1cf1
......@@ -281,7 +281,7 @@ void CDOTransferable::initFlavorList( )
pEnumFormatEtc->Reset( );
FORMATETC fetc;
while ( S_FALSE != pEnumFormatEtc->Next( 1, &fetc, nullptr ) )
while ( S_OK == pEnumFormatEtc->Next( 1, &fetc, nullptr ) )
{
// we use locales only to determine the
// charset if there is text on the cliboard
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment