diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 10:53:31 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-09-22 13:06:24 +0200 |
commit | b9de047454c2603e2f5a5108254cd3f967e8a88b (patch) | |
tree | 589c20e48bfed9c3cfe6696c24c67d49f568c6bd /sd/source/ui/slidesorter/shell | |
parent | 448e9da1b440561441602e3a0956218b2702767e (diff) |
loplugin:flatten in scaddins..sd
Change-Id: I190323ce910224f883c4370b2c752644a5a35edd
Reviewed-on: https://gerrit.libreoffice.org/42626
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sd/source/ui/slidesorter/shell')
-rw-r--r-- | sd/source/ui/slidesorter/shell/SlideSorterService.cxx | 73 |
1 files changed, 36 insertions, 37 deletions
diff --git a/sd/source/ui/slidesorter/shell/SlideSorterService.cxx b/sd/source/ui/slidesorter/shell/SlideSorterService.cxx index 78517c6086f0..b6ce91cc7ba2 100644 --- a/sd/source/ui/slidesorter/shell/SlideSorterService.cxx +++ b/sd/source/ui/slidesorter/shell/SlideSorterService.cxx @@ -68,47 +68,46 @@ void SAL_CALL SlideSorterService::initialize (const Sequence<Any>& rArguments) { ThrowIfDisposed(); - if (rArguments.getLength() == 3) - { - try - { - mxViewId.set(rArguments[0], UNO_QUERY_THROW); - - // Get the XController. - Reference<frame::XController> xController (rArguments[1], 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 parent window. - mxParentWindow.set(rArguments[2], UNO_QUERY_THROW); - VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(mxParentWindow); - - mxParentWindow->addWindowListener(this); - - if (pBase != nullptr && pParentWindow) - mpSlideSorter = SlideSorter::CreateSlideSorter( - *pBase, - nullptr, - *pParentWindow); - - Resize(); - } - catch (RuntimeException&) - { - throw; - } - } - else + if (rArguments.getLength() != 3) { throw RuntimeException("SlideSorterService: invalid number of arguments", 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); + + // 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 parent window. + mxParentWindow.set(rArguments[2], UNO_QUERY_THROW); + VclPtr<vcl::Window> pParentWindow = VCLUnoHelper::GetWindow(mxParentWindow); + + mxParentWindow->addWindowListener(this); + + if (pBase != nullptr && pParentWindow) + mpSlideSorter = SlideSorter::CreateSlideSorter( + *pBase, + nullptr, + *pParentWindow); + + Resize(); + } + catch (RuntimeException&) + { + throw; + } + } //----- XView ----------------------------------------------------------------- |