[Libreoffice-commits] core.git: dtrans/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Oct 10 18:14:20 UTC 2018


 dtrans/source/win32/dtobj/DOTransferable.cxx |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 9eb489da4682a89ab96b0d6a8ba13418aac4ca9d
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Wed Oct 10 16:37:15 2018 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Wed Oct 10 20:13:56 2018 +0200

    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: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx b/dtrans/source/win32/dtobj/DOTransferable.cxx
index 2b3f5ff2e890..db70196e18a3 100644
--- a/dtrans/source/win32/dtobj/DOTransferable.cxx
+++ b/dtrans/source/win32/dtobj/DOTransferable.cxx
@@ -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


More information about the Libreoffice-commits mailing list