dtrans/source/win32/dtobj/DOTransferable.cxx |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

New commits:
commit 2bf5a0a2184343f2f5f48e3dd071fd696430123a
Author:     Mike Kaganski <[email protected]>
AuthorDate: Wed Mar 24 11:29:22 2021 +0300
Commit:     Miklos Vajna <[email protected]>
CommitDate: Thu Mar 25 09:06:55 2021 +0100

    Also retry when calling IDataObject::EnumFormatEtc
    
    This is a workaround for the problem that was properly resolved in
    master in commit 7b6c0e63e64eb2ad1e83bd744a0d20f78c7a6b84. Backporting
    that would depend on other commits with unclear stability, so just
    use the same approach as in cf1c835e8016f8f1eefea6d625a913c0ac343a63,
    and make sure the clipboard access for enumeration succeeds.
    
    Change-Id: I69e68f2f9b9b3253b28e738bc36ddce8c28c58ef
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/113017
    Tested-by: Mike Kaganski <[email protected]>
    Reviewed-by: Mike Kaganski <[email protected]>
    Reviewed-by: Miklos Vajna <[email protected]>

diff --git a/dtrans/source/win32/dtobj/DOTransferable.cxx 
b/dtrans/source/win32/dtobj/DOTransferable.cxx
index 8f27e7124e0a..b244d03310f8 100644
--- a/dtrans/source/win32/dtobj/DOTransferable.cxx
+++ b/dtrans/source/win32/dtobj/DOTransferable.cxx
@@ -21,6 +21,7 @@
 #include <rtl/process.h>
 #include <osl/diagnose.h>
 #include <sal/log.hxx>
+#include <systools/win32/retry_if_failed.hxx>
 
 #include "DOTransferable.hxx"
 #include "../misc/ImplHelper.hxx"
@@ -313,7 +314,8 @@ sal_Bool SAL_CALL CDOTransferable::isDataFlavorSupported( 
const DataFlavor& aFla
 void CDOTransferable::initFlavorList( )
 {
     sal::systools::COMReference<IEnumFORMATETC> pEnumFormatEtc;
-    HRESULT hr = m_rDataObject->EnumFormatEtc( DATADIR_GET, &pEnumFormatEtc );
+    HRESULT hr = sal::systools::RetryIfFailed(
+        10, 100, [&]() { return m_rDataObject->EnumFormatEtc(DATADIR_GET, 
&pEnumFormatEtc); });
     if ( SUCCEEDED( hr ) )
     {
         pEnumFormatEtc->Reset( );
_______________________________________________
Libreoffice-commits mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to