summaryrefslogtreecommitdiff
path: root/sdext/source/presenter/PresenterPaneBase.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2017-09-22 12:53:28 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-09-23 09:02:58 +0200
commita8622c77d26ca7a635afc95bba9a5054dc31eb7c (patch)
treeecb1ce71272291515dec10fc5fe94061f7231b78 /sdext/source/presenter/PresenterPaneBase.cxx
parent2684aefcf5d2804351bda01a2d2fe7bbbd351451 (diff)
loplugin:flatten in sdext..stoc
Change-Id: I460e813e20a691c53738373376d3363f553bbab2 Reviewed-on: https://gerrit.libreoffice.org/42636 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sdext/source/presenter/PresenterPaneBase.cxx')
-rw-r--r--sdext/source/presenter/PresenterPaneBase.cxx144
1 files changed, 71 insertions, 73 deletions
diff --git a/sdext/source/presenter/PresenterPaneBase.cxx b/sdext/source/presenter/PresenterPaneBase.cxx
index 7e034ee30551..c7bfa0b02fa0 100644
--- a/sdext/source/presenter/PresenterPaneBase.cxx
+++ b/sdext/source/presenter/PresenterPaneBase.cxx
@@ -143,86 +143,84 @@ void SAL_CALL PresenterPaneBase::initialize (const Sequence<Any>& rArguments)
static_cast<XWeak*>(this));
}
- if (rArguments.getLength() == 5 || rArguments.getLength() == 6)
+ if (rArguments.getLength() != 5 && rArguments.getLength() != 6)
{
- try
+ throw RuntimeException(
+ "PresenterSpritePane: invalid number of arguments",
+ static_cast<XWeak*>(this));
+ }
+
+ try
+ {
+ // Get the resource id from the first argument.
+ if ( ! (rArguments[0] >>= mxPaneId))
{
- // Get the resource id from the first argument.
- if ( ! (rArguments[0] >>= mxPaneId))
- {
- throw lang::IllegalArgumentException(
- "PresenterPane: invalid pane id",
- static_cast<XWeak*>(this),
- 0);
- }
-
- if ( ! (rArguments[1] >>= mxParentWindow))
- {
- throw lang::IllegalArgumentException(
- "PresenterPane: invalid parent window",
- static_cast<XWeak*>(this),
- 1);
- }
-
- Reference<rendering::XSpriteCanvas> xParentCanvas;
- if ( ! (rArguments[2] >>= xParentCanvas))
- {
- throw lang::IllegalArgumentException(
- "PresenterPane: invalid parent canvas",
- static_cast<XWeak*>(this),
- 2);
- }
-
- if ( ! (rArguments[3] >>= msTitle))
- {
- throw lang::IllegalArgumentException(
- "PresenterPane: invalid title",
- static_cast<XWeak*>(this),
- 3);
- }
-
- if ( ! (rArguments[4] >>= mxBorderPainter))
- {
- throw lang::IllegalArgumentException(
- "PresenterPane: invalid border painter",
- static_cast<XWeak*>(this),
- 4);
- }
-
- bool bIsWindowVisibleOnCreation (true);
- if (rArguments.getLength()>5 && ! (rArguments[5] >>= bIsWindowVisibleOnCreation))
- {
- throw lang::IllegalArgumentException(
- "PresenterPane: invalid window visibility flag",
- static_cast<XWeak*>(this),
- 5);
- }
-
- CreateWindows(mxParentWindow, bIsWindowVisibleOnCreation);
-
- if (mxBorderWindow.is())
- {
- mxBorderWindow->addWindowListener(this);
- mxBorderWindow->addPaintListener(this);
- }
-
- CreateCanvases(mxParentWindow, xParentCanvas);
-
- // Raise new windows.
- ToTop();
+ throw lang::IllegalArgumentException(
+ "PresenterPane: invalid pane id",
+ static_cast<XWeak*>(this),
+ 0);
}
- catch (Exception&)
+
+ if ( ! (rArguments[1] >>= mxParentWindow))
{
- mxContentWindow = nullptr;
- mxComponentContext = nullptr;
- throw;
+ throw lang::IllegalArgumentException(
+ "PresenterPane: invalid parent window",
+ static_cast<XWeak*>(this),
+ 1);
}
+
+ Reference<rendering::XSpriteCanvas> xParentCanvas;
+ if ( ! (rArguments[2] >>= xParentCanvas))
+ {
+ throw lang::IllegalArgumentException(
+ "PresenterPane: invalid parent canvas",
+ static_cast<XWeak*>(this),
+ 2);
+ }
+
+ if ( ! (rArguments[3] >>= msTitle))
+ {
+ throw lang::IllegalArgumentException(
+ "PresenterPane: invalid title",
+ static_cast<XWeak*>(this),
+ 3);
+ }
+
+ if ( ! (rArguments[4] >>= mxBorderPainter))
+ {
+ throw lang::IllegalArgumentException(
+ "PresenterPane: invalid border painter",
+ static_cast<XWeak*>(this),
+ 4);
+ }
+
+ bool bIsWindowVisibleOnCreation (true);
+ if (rArguments.getLength()>5 && ! (rArguments[5] >>= bIsWindowVisibleOnCreation))
+ {
+ throw lang::IllegalArgumentException(
+ "PresenterPane: invalid window visibility flag",
+ static_cast<XWeak*>(this),
+ 5);
+ }
+
+ CreateWindows(mxParentWindow, bIsWindowVisibleOnCreation);
+
+ if (mxBorderWindow.is())
+ {
+ mxBorderWindow->addWindowListener(this);
+ mxBorderWindow->addPaintListener(this);
+ }
+
+ CreateCanvases(mxParentWindow, xParentCanvas);
+
+ // Raise new windows.
+ ToTop();
}
- else
+ catch (Exception&)
{
- throw RuntimeException(
- "PresenterSpritePane: invalid number of arguments",
- static_cast<XWeak*>(this));
+ mxContentWindow = nullptr;
+ mxComponentContext = nullptr;
+ throw;
}
}