summaryrefslogtreecommitdiff
path: root/sd/source/ui/framework/factories/BasicViewFactory.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-22 10:53:31 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-22 13:06:24 +0200
commitb9de047454c2603e2f5a5108254cd3f967e8a88b (patch)
tree589c20e48bfed9c3cfe6696c24c67d49f568c6bd /sd/source/ui/framework/factories/BasicViewFactory.cxx
parent448e9da1b440561441602e3a0956218b2702767e (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/framework/factories/BasicViewFactory.cxx')
-rw-r--r--sd/source/ui/framework/factories/BasicViewFactory.cxx54
1 files changed, 26 insertions, 28 deletions
diff --git a/sd/source/ui/framework/factories/BasicViewFactory.cxx b/sd/source/ui/framework/factories/BasicViewFactory.cxx
index 4c8cb0203a16..f1ed3d6e8d40 100644
--- a/sd/source/ui/framework/factories/BasicViewFactory.cxx
+++ b/sd/source/ui/framework/factories/BasicViewFactory.cxx
@@ -195,41 +195,39 @@ void SAL_CALL BasicViewFactory::releaseResource (const Reference<XResource>& rxV
[&] (std::shared_ptr<ViewDescriptor> const& pVD) {
return ViewDescriptor::CompareView(pVD, rxView);
} ));
- if (iViewShell != mpViewShellContainer->end())
+ if (iViewShell == mpViewShellContainer->end())
{
- std::shared_ptr<ViewShell> pViewShell ((*iViewShell)->mpViewShell);
+ throw lang::IllegalArgumentException();
+ }
+
+ std::shared_ptr<ViewShell> pViewShell ((*iViewShell)->mpViewShell);
- if ((*iViewShell)->mxViewId->isBoundToURL(
- FrameworkHelper::msCenterPaneURL, AnchorBindingMode_DIRECT))
+ if ((*iViewShell)->mxViewId->isBoundToURL(
+ FrameworkHelper::msCenterPaneURL, AnchorBindingMode_DIRECT))
+ {
+ // Obtain a pointer to and connect to the frame view of the
+ // view. The next view, that is created, will be
+ // initialized with this frame view.
+ if (mpFrameView == nullptr)
{
- // Obtain a pointer to and connect to the frame view of the
- // view. The next view, that is created, will be
- // initialized with this frame view.
- if (mpFrameView == nullptr)
- {
- mpFrameView = pViewShell->GetFrameView();
- if (mpFrameView)
- mpFrameView->Connect();
- }
-
- // With the view in the center pane the sub controller is
- // released, too.
- mpBase->GetDrawController().SetSubController(
- Reference<drawing::XDrawSubController>());
-
- SfxViewShell* pSfxViewShell = pViewShell->GetViewShell();
- if (pSfxViewShell != nullptr)
- pSfxViewShell->DisconnectAllClients();
+ mpFrameView = pViewShell->GetFrameView();
+ if (mpFrameView)
+ mpFrameView->Connect();
}
- ReleaseView(*iViewShell, false);
+ // With the view in the center pane the sub controller is
+ // released, too.
+ mpBase->GetDrawController().SetSubController(
+ Reference<drawing::XDrawSubController>());
- mpViewShellContainer->erase(iViewShell);
- }
- else
- {
- throw lang::IllegalArgumentException();
+ SfxViewShell* pSfxViewShell = pViewShell->GetViewShell();
+ if (pSfxViewShell != nullptr)
+ pSfxViewShell->DisconnectAllClients();
}
+
+ ReleaseView(*iViewShell, false);
+
+ mpViewShellContainer->erase(iViewShell);
}
}