diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 14:52:24 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-23 09:01:46 +0200 |
commit | 2684aefcf5d2804351bda01a2d2fe7bbbd351451 (patch) | |
tree | 5c19a705883a068a4945d7e49376296e341cb191 /sd | |
parent | 1fde962b71860d77fb10e9b16c9d5b6c124d9b61 (diff) |
new loplugin unnecessarycatchthrow
Change-Id: Iabab71ee076227bc38447ec109afaea1e53a86a6
Reviewed-on: https://gerrit.libreoffice.org/42643
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd')
-rw-r--r-- | sd/source/ui/presenter/PresenterTextView.cxx | 15 | ||||
-rw-r--r-- | sd/source/ui/slidesorter/shell/SlideSorterService.cxx | 48 |
2 files changed, 24 insertions, 39 deletions
diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index 275718e1edcd..87679f849c11 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -119,18 +119,11 @@ void SAL_CALL PresenterTextView::initialize (const Sequence<Any>& rArguments) if (rArguments.getLength() == 1) { - try + Reference<rendering::XCanvas> xCanvas (rArguments[0], UNO_QUERY_THROW); + if (xCanvas.is()) { - Reference<rendering::XCanvas> xCanvas (rArguments[0], UNO_QUERY_THROW); - if (xCanvas.is()) - { - mpImplementation->SetCanvas( - cppcanvas::VCLFactory::createCanvas(xCanvas)); - } - } - catch (RuntimeException&) - { - throw; + mpImplementation->SetCanvas( + cppcanvas::VCLFactory::createCanvas(xCanvas)); } } else diff --git a/sd/source/ui/slidesorter/shell/SlideSorterService.cxx b/sd/source/ui/slidesorter/shell/SlideSorterService.cxx index b6ce91cc7ba2..ae14673c0afa 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterService.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterService.cxx @@ -74,40 +74,32 @@ void SAL_CALL SlideSorterService::initialize (const Sequence<Any>& rArguments) static_cast<drawing::XDrawView*>(this)); } - try - { - mxViewId.set(rArguments[0], UNO_QUERY_THROW); - - // Get the XController. - Reference<frame::XController> xController (rArguments[1], UNO_QUERY_THROW); + mxViewId.set(rArguments[0], UNO_QUERY_THROW); - // Tunnel through the controller to obtain a ViewShellBase. - ViewShellBase* pBase = nullptr; - Reference<lang::XUnoTunnel> xTunnel (xController, UNO_QUERY_THROW); - ::sd::DrawController* pController = reinterpret_cast<sd::DrawController*>( - xTunnel->getSomething(sd::DrawController::getUnoTunnelId())); - if (pController != nullptr) - pBase = pController->GetViewShellBase(); + // Get the XController. + Reference<frame::XController> xController (rArguments[1], UNO_QUERY_THROW); - // Get the parent window. - mxParentWindow.set(rArguments[2], UNO_QUERY_THROW); - VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(mxParentWindow); + // Tunnel through the controller to obtain a ViewShellBase. + ViewShellBase* pBase = nullptr; + Reference<lang::XUnoTunnel> xTunnel (xController, UNO_QUERY_THROW); + ::sd::DrawController* pController = reinterpret_cast<sd::DrawController*>( + xTunnel->getSomething(sd::DrawController::getUnoTunnelId())); + if (pController != nullptr) + pBase = pController->GetViewShellBase(); - mxParentWindow->addWindowListener(this); + // Get the parent window. + mxParentWindow.set(rArguments[2], UNO_QUERY_THROW); + VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(mxParentWindow); - if (pBase != nullptr && pParentWindow) - mpSlideSorter = SlideSorter::CreateSlideSorter( - *pBase, - nullptr, - *pParentWindow); + mxParentWindow->addWindowListener(this); - Resize(); - } - catch (RuntimeException&) - { - throw; - } + if (pBase != nullptr && pParentWindow) + mpSlideSorter = SlideSorter::CreateSlideSorter( + *pBase, + nullptr, + *pParentWindow); + Resize(); } //----- XView ----------------------------------------------------------------- |