From 2684aefcf5d2804351bda01a2d2fe7bbbd351451 Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 22 Sep 2017 14:52:24 +0200 Subject: new loplugin unnecessarycatchthrow Change-Id: Iabab71ee076227bc38447ec109afaea1e53a86a6 Reviewed-on: https://gerrit.libreoffice.org/42643 Tested-by: Jenkins Reviewed-by: Noel Grandin --- sd/source/ui/presenter/PresenterTextView.cxx | 15 ++----- .../ui/slidesorter/shell/SlideSorterService.cxx | 48 +++++++++------------- 2 files changed, 24 insertions(+), 39 deletions(-) (limited to 'sd') 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& rArguments) if (rArguments.getLength() == 1) { - try + Reference xCanvas (rArguments[0], UNO_QUERY_THROW); + if (xCanvas.is()) { - Reference 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& rArguments) static_cast(this)); } - try - { - mxViewId.set(rArguments[0], UNO_QUERY_THROW); - - // Get the XController. - Reference 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 xTunnel (xController, UNO_QUERY_THROW); - ::sd::DrawController* pController = reinterpret_cast( - xTunnel->getSomething(sd::DrawController::getUnoTunnelId())); - if (pController != nullptr) - pBase = pController->GetViewShellBase(); + // Get the XController. + Reference xController (rArguments[1], UNO_QUERY_THROW); - // Get the parent window. - mxParentWindow.set(rArguments[2], UNO_QUERY_THROW); - VclPtr pParentWindow = VCLUnoHelper::GetWindow(mxParentWindow); + // Tunnel through the controller to obtain a ViewShellBase. + ViewShellBase* pBase = nullptr; + Reference xTunnel (xController, UNO_QUERY_THROW); + ::sd::DrawController* pController = reinterpret_cast( + 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 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 ----------------------------------------------------------------- -- cgit