summaryrefslogtreecommitdiff
path: root/odk
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-11-11 15:32:10 +0200
committerNoel Grandin <noelgrandin@gmail.com>2014-11-12 08:01:55 +0000
commit36ff1527c9cb20542d3097d123d221c40a356795 (patch)
tree52590ce642803a862bc331b3eae2e2b100b8e85f /odk
parent1eb31467a5af90fe41dc646dd716bdb7d3e5db45 (diff)
java: reduce excessive code indentation levels
by using early return in some methods Change-Id: I3611c8c89b3a94ef7e1772d178acf065fd7fcdc7 Reviewed-on: https://gerrit.libreoffice.org/12374 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'odk')
-rw-r--r--odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java48
1 files changed, 24 insertions, 24 deletions
diff --git a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
index 8c2e95af56f5..239296cc30e5 100644
--- a/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
+++ b/odk/examples/DevelopersGuide/Components/Addons/ProtocolHandlerAddon_java/ProtocolHandlerAddon.java
@@ -201,30 +201,30 @@ public class ProtocolHandlerAddon {
}
public void showMessageBox(String sTitle, String sMessage) {
- if ( null != m_xFrame && null != m_xToolkit ) {
-
- // describe window properties.
- WindowDescriptor aDescriptor = new WindowDescriptor();
- aDescriptor.Type = WindowClass.MODALTOP;
- aDescriptor.WindowServiceName = "infobox";
- aDescriptor.ParentIndex = -1;
- aDescriptor.Parent = UnoRuntime.queryInterface(
- XWindowPeer.class, m_xFrame.getContainerWindow());
- aDescriptor.Bounds = new Rectangle(0,0,300,200);
- aDescriptor.WindowAttributes = WindowAttribute.BORDER |
- WindowAttribute.MOVEABLE |
- WindowAttribute.CLOSEABLE;
-
- XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor );
- if ( null != xPeer ) {
- XMessageBox xMsgBox = UnoRuntime.queryInterface(
- XMessageBox.class, xPeer);
- if ( null != xMsgBox )
- {
- xMsgBox.setCaptionText( sTitle );
- xMsgBox.setMessageText( sMessage );
- xMsgBox.execute();
- }
+ if ( null == m_xFrame || null == m_xToolkit ) {
+ return;
+ }
+ // describe window properties.
+ WindowDescriptor aDescriptor = new WindowDescriptor();
+ aDescriptor.Type = WindowClass.MODALTOP;
+ aDescriptor.WindowServiceName = "infobox";
+ aDescriptor.ParentIndex = -1;
+ aDescriptor.Parent = UnoRuntime.queryInterface(
+ XWindowPeer.class, m_xFrame.getContainerWindow());
+ aDescriptor.Bounds = new Rectangle(0,0,300,200);
+ aDescriptor.WindowAttributes = WindowAttribute.BORDER |
+ WindowAttribute.MOVEABLE |
+ WindowAttribute.CLOSEABLE;
+
+ XWindowPeer xPeer = m_xToolkit.createWindow( aDescriptor );
+ if ( null != xPeer ) {
+ XMessageBox xMsgBox = UnoRuntime.queryInterface(
+ XMessageBox.class, xPeer);
+ if ( null != xMsgBox )
+ {
+ xMsgBox.setCaptionText( sTitle );
+ xMsgBox.setMessageText( sMessage );
+ xMsgBox.execute();
}
}
}