diff options
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/dochdl/swdtflvr.cxx | 14 | ||||
-rw-r--r-- | sw/source/uibase/inc/swdtflvr.hxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/inc/uivwimp.hxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uiview/uivwimp.cxx | 7 |
4 files changed, 6 insertions, 21 deletions
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index d9a6db5c1bb5..43308154fcb1 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -4351,21 +4351,9 @@ void SwTransferable::ClearSelection( const SwWrtShell& rSh, } } -const Sequence< sal_Int8 >& SwTransferable::getUnoTunnelId() -{ - static const comphelper::UnoIdInit theSwTransferableUnoTunnelId; - return theSwTransferableUnoTunnelId.getSeq(); -} - -sal_Int64 SwTransferable::getSomething( const Sequence< sal_Int8 >& rId ) -{ - return comphelper::getSomethingImpl(rId, this, - comphelper::FallbackToGetSomethingOf<TransferableHelper>{}); -} - SwTransferable* SwTransferable::GetSwTransferable( const TransferableDataHelper& rData ) { - return comphelper::getFromUnoTunnel<SwTransferable>(rData.GetTransferable()); + return dynamic_cast<SwTransferable*>(rData.GetTransferable().get()); } SwTransferDdeLink::SwTransferDdeLink( SwTransferable& rTrans, SwWrtShell& rSh ) diff --git a/sw/source/uibase/inc/swdtflvr.hxx b/sw/source/uibase/inc/swdtflvr.hxx index df16e3a8bd56..375ca33a128d 100644 --- a/sw/source/uibase/inc/swdtflvr.hxx +++ b/sw/source/uibase/inc/swdtflvr.hxx @@ -237,9 +237,6 @@ public: // the related SwView is being closed and the SwTransferable is invalid now void Invalidate() {m_pWrtShell = nullptr;} - static const css::uno::Sequence< sal_Int8 >& getUnoTunnelId(); - - virtual sal_Int64 SAL_CALL getSomething( const css::uno::Sequence< sal_Int8 >& rId ) override; static void SelectPasteFormat(TransferableDataHelper& rData, sal_uInt8& nAction, SotClipboardFormatId& nFormat); diff --git a/sw/source/uibase/inc/uivwimp.hxx b/sw/source/uibase/inc/uivwimp.hxx index 1cb5fd6590ed..352469f33401 100644 --- a/sw/source/uibase/inc/uivwimp.hxx +++ b/sw/source/uibase/inc/uivwimp.hxx @@ -26,6 +26,7 @@ #include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp> #include <cppuhelper/implbase.hxx> #include <cppuhelper/weakref.hxx> +#include <unotools/weakref.hxx> class SwXTextView; class SfxRequest; @@ -86,7 +87,7 @@ class SwView_Impl { css::uno::Reference< css::frame::XDispatchProviderInterceptor > m_xDispatchProviderInterceptor; css::uno::Reference< css::view::XSelectionSupplier > mxXTextView; // UNO object - std::vector< css::uno::WeakReference< css::lang::XUnoTunnel > > mxTransferables; + std::vector< unotools::WeakReference< SwTransferable > > mxTransferables; // temporary document for printing text of selection / multi selection // in PDF export. diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx index cea09ed3b5ba..efe2a713d635 100644 --- a/sw/source/uibase/uiview/uivwimp.cxx +++ b/sw/source/uibase/uiview/uivwimp.cxx @@ -212,7 +212,7 @@ void SwView_Impl::Invalidate() GetUNOObject_Impl()->Invalidate(); for (const auto& xTransferable: mxTransferables) { - auto pTransferable = comphelper::getFromUnoTunnel<SwTransferable>(xTransferable.get()); + auto pTransferable = xTransferable.get().get(); if(pTransferable) pTransferable->Invalidate(); } @@ -225,9 +225,8 @@ void SwView_Impl::AddTransferable(SwTransferable& rTransferable) { // Remove previously added, but no longer existing weak references. mxTransferables.erase(std::remove_if(mxTransferables.begin(), mxTransferables.end(), - [](const css::uno::WeakReference<css::lang::XUnoTunnel>& rTunnel) { - uno::Reference<lang::XUnoTunnel> xTunnel(rTunnel.get(), uno::UNO_QUERY); - return !xTunnel.is(); + [](const unotools::WeakReference<SwTransferable>& rTunnel) { + return !rTunnel.get(); }), mxTransferables.end()); mxTransferables.emplace_back(&rTransferable); |