summaryrefslogtreecommitdiff
path: root/nlpsolver
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-01-21 14:37:23 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-01-21 15:15:52 +0000
commit4d95bd62613344de9cba32e09c37fe60d6383dc4 (patch)
tree3f657ae2d4381fe9a28f3f6f1005b0a74664f7f9 /nlpsolver
parent683d193327b49971098517758d6d3f79c5d94a4f (diff)
coverity#1326449 Dereference null return value
and coverity#1326448 Dereference null return value Change-Id: I8e26c9c57264b654a5a7c3dc56c658f23291e357
Diffstat (limited to 'nlpsolver')
-rw-r--r--nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java20
1 files changed, 8 insertions, 12 deletions
diff --git a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java
index 36fdd4d55ac2..d10ad34931c6 100644
--- a/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java
+++ b/nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/dialogs/BaseDialog.java
@@ -71,20 +71,16 @@ public abstract class BaseDialog extends BaseControl {
return xMSF;
}
- private XFrame getCurrentFrame() {
- try {
- Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", context);
- XDesktop xDesktop = UnoRuntime.queryInterface(XDesktop.class, oDesktop);
- XComponent xComponent = xDesktop.getCurrentComponent();
- XModel xModel = UnoRuntime.queryInterface(XModel.class, xComponent);
- XController xController = xModel.getCurrentController();
- return xController.getFrame();
- } catch (Exception e) {
- return null;
- }
+ private XFrame getCurrentFrame() throws Exception {
+ Object oDesktop = xMCF.createInstanceWithContext("com.sun.star.frame.Desktop", context);
+ XDesktop xDesktop = UnoRuntime.queryInterface(XDesktop.class, oDesktop);
+ XComponent xComponent = xDesktop.getCurrentComponent();
+ XModel xModel = UnoRuntime.queryInterface(XModel.class, xComponent);
+ XController xController = xModel.getCurrentController();
+ return xController.getFrame();
}
- private Rectangle getWorkspaceDimensions() {
+ private Rectangle getWorkspaceDimensions() throws Exception {
return getCurrentFrame().getComponentWindow().getPosSize();
}