diff options
-rw-r--r-- | vcl/source/app/dndhelp.cxx | 18 | ||||
-rw-r--r-- | vcl/source/window/mouse.cxx | 14 |
2 files changed, 20 insertions, 12 deletions
diff --git a/vcl/source/app/dndhelp.cxx b/vcl/source/app/dndhelp.cxx index d4d6ea059f06..bf0e897dfc7f 100644 --- a/vcl/source/app/dndhelp.cxx +++ b/vcl/source/app/dndhelp.cxx @@ -143,25 +143,25 @@ void vcl::unohelper::DragAndDropWrapper::dropActionChanged( const css::datatrans } css::uno::Reference<css::uno::XInterface> -vcl::OleDnDHelper(const css::uno::Reference<css::lang::XInitialization>& pDnD, const sal_IntPtr pWin, DragOrDrop eDoD) +vcl::OleDnDHelper(const css::uno::Reference<css::lang::XInitialization>& xDnD, const sal_IntPtr pWin, DragOrDrop eDoD) { - if (pWin && pDnD) + if (pWin && xDnD) { if (eDoD == vcl::DragOrDrop::Drag) - pDnD->initialize({ uno::Any(), uno::Any(static_cast<sal_uInt64>(pWin)) }); + xDnD->initialize({ uno::Any(), uno::Any(static_cast<sal_uInt64>(pWin)) }); else - pDnD->initialize({ uno::Any(static_cast<sal_uInt64>(pWin)), uno::Any() }); + xDnD->initialize({ uno::Any(static_cast<sal_uInt64>(pWin)), uno::Any() }); } - return css::uno::Reference<css::uno::XInterface>(pDnD); + return xDnD; } css::uno::Reference<css::uno::XInterface> -vcl::X11DnDHelper(const css::uno::Reference<css::lang::XInitialization>& pDnD, const sal_IntPtr pWin) +vcl::X11DnDHelper(const css::uno::Reference<css::lang::XInitialization>& xDnD, const sal_IntPtr pWin) { - if (pWin && pDnD) - pDnD->initialize({ uno::Any(Application::GetDisplayConnection()), + if (pWin && xDnD) + xDnD->initialize({ uno::Any(Application::GetDisplayConnection()), uno::Any(static_cast<sal_uInt64>(pWin)) }); - return css::uno::Reference<css::uno::XInterface>(pDnD); + return xDnD; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx index a25e226ed9fb..02f6c8a484b1 100644 --- a/vcl/source/window/mouse.cxx +++ b/vcl/source/window/mouse.cxx @@ -732,9 +732,17 @@ Reference< css::datatransfer::dnd::XDragSource > Window::GetDragSource() if (mpWindowImpl->mpFrameData->mxDragSource.is()) return mpWindowImpl->mpFrameData->mxDragSource; - SalInstance* pInst = ImplGetSVData()->mpDefInst; - mpWindowImpl->mpFrameData->mxDragSource.set(pInst->CreateDragSource(pEnvData), UNO_QUERY); - mpWindowImpl->mpFrameData->mxDropTarget.set(pInst->CreateDropTarget(pEnvData), UNO_QUERY); + try + { + SalInstance* pInst = ImplGetSVData()->mpDefInst; + mpWindowImpl->mpFrameData->mxDragSource.set(pInst->CreateDragSource(pEnvData), UNO_QUERY); + mpWindowImpl->mpFrameData->mxDropTarget.set(pInst->CreateDropTarget(pEnvData), UNO_QUERY); + } + catch (const Exception&) + { + mpWindowImpl->mpFrameData->mxDropTarget.clear(); + mpWindowImpl->mpFrameData->mxDragSource.clear(); + } return mpWindowImpl->mpFrameData->mxDragSource; #else return Reference< css::datatransfer::dnd::XDragSource > (); |