[Libreoffice-commits] core.git: Branch 'distro/vector/vector-7.0' - dtrans/source

Mike Kaganski (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 25 08:07:38 UTC 2021


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

New commits:
commit 2bf5a0a2184343f2f5f48e3dd071fd696430123a
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Wed Mar 24 11:29:22 2021 +0300
Commit:     Miklos Vajna <vmiklos at collabora.com>
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 <mike.kaganski at collabora.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Reviewed-by: Miklos Vajna <vmiklos at collabora.com>

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( );


More information about the Libreoffice-commits mailing list