diff options
author | Andras Timar <andras.timar@collabora.com> | 2017-03-01 16:11:53 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-03-01 16:11:53 +0100 |
commit | 0759c5973cf7be07789f21204540f62594224b86 (patch) | |
tree | ee33d8a0ce9fd79202fdc34b0a010734cd1b2d18 /dtrans | |
parent | 04f75cd35e5e2657fcb8033fc88dc8abce9cd90e (diff) |
Revert "tdf#103852 avoid clipboard deadlock"
This reverts commit 56b7eb743e82c1e12bc91d73f526e705f2c70b39.
Diffstat (limited to 'dtrans')
-rw-r--r-- | dtrans/source/win32/dtobj/XTDataObject.cxx | 38 | ||||
-rw-r--r-- | dtrans/source/win32/dtobj/XTDataObject.hxx | 3 |
2 files changed, 1 insertions, 40 deletions
diff --git a/dtrans/source/win32/dtobj/XTDataObject.cxx b/dtrans/source/win32/dtobj/XTDataObject.cxx index d36328ad0a58..3c8a93731945 100644 --- a/dtrans/source/win32/dtobj/XTDataObject.cxx +++ b/dtrans/source/win32/dtobj/XTDataObject.cxx @@ -25,11 +25,8 @@ #include "DTransHelper.hxx" #include "TxtCnvtHlp.hxx" #include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp> -#include "com/sun/star/awt/AsyncCallback.hpp" -#include "com/sun/star/awt/XCallback.hpp" #include "FmtFilter.hxx" #include <comphelper/processfactory.hxx> -#include <cppuhelper/implbase.hxx> #if defined _MSC_VER #pragma warning(push,1) @@ -55,33 +52,6 @@ using namespace com::sun::star::datatransfer::clipboard; using namespace com::sun::star::uno; using namespace com::sun::star::lang; -namespace -{ - -/** - We need to destroy XTransferable in the main thread to avoid dead lock - when locking in the clipboard thread. So we transfer the ownership of the - XTransferable reference to this object and release it when the callback - is executed in main thread. -*/ -class AsyncDereference : public cppu::WeakImplHelper<css::awt::XCallback> -{ - Reference<XTransferable> maTransferable; - -public: - AsyncDereference(css::uno::Reference<css::datatransfer::XTransferable> const & rTransferable) - : maTransferable(rTransferable) - {} - - virtual void SAL_CALL notify(css::uno::Any const &) - throw (css::uno::RuntimeException, std::exception) override - { - maTransferable.set(nullptr); - } -}; - -} - // a helper class that will be thrown by the function validateFormatEtc class CInvalidFormatEtcException @@ -97,20 +67,12 @@ CXTDataObject::CXTDataObject( const Reference< XComponentContext >& rxContext, const Reference< XTransferable >& aXTransferable ) : m_nRefCnt( 0 ) , m_XTransferable( aXTransferable ) - , m_XComponentContext( rxContext ) , m_bFormatEtcContainerInitialized( sal_False ) , m_DataFormatTranslator( rxContext ) , m_FormatRegistrar( rxContext, m_DataFormatTranslator ) { } -CXTDataObject::~CXTDataObject() -{ - css::awt::AsyncCallback::create(m_XComponentContext)->addCallback( - new AsyncDereference(m_XTransferable), - css::uno::Any()); -} - // IUnknown->QueryInterface STDMETHODIMP CXTDataObject::QueryInterface( REFIID iid, LPVOID* ppvObject ) diff --git a/dtrans/source/win32/dtobj/XTDataObject.hxx b/dtrans/source/win32/dtobj/XTDataObject.hxx index f9e98e86ebd7..3d8d71c2c24a 100644 --- a/dtrans/source/win32/dtobj/XTDataObject.hxx +++ b/dtrans/source/win32/dtobj/XTDataObject.hxx @@ -64,7 +64,7 @@ class CXTDataObject : public IDataObject public: CXTDataObject( const css::uno::Reference< css::uno::XComponentContext >& rxContext, const css::uno::Reference< css::datatransfer::XTransferable >& aXTransferable ); - virtual ~CXTDataObject(); + virtual ~CXTDataObject() {} // ole interface implementation @@ -118,7 +118,6 @@ private: private: LONG m_nRefCnt; css::uno::Reference< css::datatransfer::XTransferable > m_XTransferable; - css::uno::Reference< css::uno::XComponentContext> m_XComponentContext; CFormatEtcContainer m_FormatEtcContainer; sal_Bool m_bFormatEtcContainerInitialized; CDataFormatTranslator m_DataFormatTranslator; |