summaryrefslogtreecommitdiff
path: root/wizards
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2016-02-04 11:43:38 +0000
committerCaolán McNamara <caolanm@redhat.com>2016-02-04 15:47:13 +0000
commitef2061233d2948e5cdc970277adec2159aae88f8 (patch)
tree299a52f069bd15967f00379c15f0fffbd9fe1067 /wizards
parent72f0f535d322850bc1b8d44dd1dc71ebe313470b (diff)
coverity#1326401 Dereference null return value
Change-Id: I7d19233bb0f63f55c87d83e50b7f865f5c7a8ea4
Diffstat (limited to 'wizards')
-rw-r--r--wizards/com/sun/star/wizards/common/Desktop.java28
-rw-r--r--wizards/com/sun/star/wizards/document/OfficeDocument.java2
2 files changed, 11 insertions, 19 deletions
diff --git a/wizards/com/sun/star/wizards/common/Desktop.java b/wizards/com/sun/star/wizards/common/Desktop.java
index 62b3ea6754d2..b19d1f3759c6 100644
--- a/wizards/com/sun/star/wizards/common/Desktop.java
+++ b/wizards/com/sun/star/wizards/common/Desktop.java
@@ -82,33 +82,25 @@ public class Desktop
return null;
}
- private static com.sun.star.util.URL getDispatchURL(XMultiServiceFactory xMSF, String _sURL)
+ private static com.sun.star.util.URL getDispatchURL(XMultiServiceFactory xMSF, String _sURL) throws com.sun.star.uno.Exception
{
- try
- {
- Object oTransformer = xMSF.createInstance("com.sun.star.util.URLTransformer");
- XURLTransformer xTransformer = UnoRuntime.queryInterface(XURLTransformer.class, oTransformer);
- com.sun.star.util.URL[] oURL = new com.sun.star.util.URL[1];
- oURL[0] = new com.sun.star.util.URL();
- oURL[0].Complete = _sURL;
- xTransformer.parseStrict(oURL);
- return oURL[0];
- }
- catch (Exception e)
- {
- e.printStackTrace(System.err);
- }
- return null;
+ Object oTransformer = xMSF.createInstance("com.sun.star.util.URLTransformer");
+ XURLTransformer xTransformer = UnoRuntime.queryInterface(XURLTransformer.class, oTransformer);
+ com.sun.star.util.URL[] oURL = new com.sun.star.util.URL[1];
+ oURL[0] = new com.sun.star.util.URL();
+ oURL[0].Complete = _sURL;
+ xTransformer.parseStrict(oURL);
+ return oURL[0];
}
- private static void dispatchURL(XMultiServiceFactory xMSF, String sURL, XFrame xFrame, String _stargetframe)
+ private static void dispatchURL(XMultiServiceFactory xMSF, String sURL, XFrame xFrame, String _stargetframe) throws com.sun.star.uno.Exception
{
com.sun.star.util.URL oURL = getDispatchURL(xMSF, sURL);
XDispatch xDispatch = getDispatcher(xFrame, _stargetframe, oURL);
dispatchURL(xDispatch, oURL);
}
- public static void dispatchURL(XMultiServiceFactory xMSF, String sURL, XFrame xFrame)
+ public static void dispatchURL(XMultiServiceFactory xMSF, String sURL, XFrame xFrame) throws com.sun.star.uno.Exception
{
dispatchURL(xMSF, sURL, xFrame, PropertyNames.EMPTY_STRING);
}
diff --git a/wizards/com/sun/star/wizards/document/OfficeDocument.java b/wizards/com/sun/star/wizards/document/OfficeDocument.java
index 8a85e68cfdb3..965e640a06cc 100644
--- a/wizards/com/sun/star/wizards/document/OfficeDocument.java
+++ b/wizards/com/sun/star/wizards/document/OfficeDocument.java
@@ -66,7 +66,7 @@ public class OfficeDocument
Desktop.dispatchURL(xMSF, ".uno:CloseDoc", xFrame);
}
}
- catch (PropertyVetoException exception)
+ catch (Exception exception)
{
exception.printStackTrace(System.err);
}