diff options
author | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2017-04-05 21:42:46 +0200 |
---|---|---|
committer | Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> | 2017-05-28 14:26:50 +0200 |
commit | eac12b1fe5108bcd64be37e6011721f8566e2015 (patch) | |
tree | a5789c1f617f7242c4652dd306095f3dc2204526 | |
parent | 2d13a00bfa17dd610979b5d89b4f159f2e548d3d (diff) |
android: simplify some more if statements
Change-Id: I49f7069ca774468b4b9d44541238e38edd0f5bd7
-rw-r--r-- | android/source/src/java/org/libreoffice/canvas/CommonCanvasElement.java | 5 | ||||
-rw-r--r-- | android/source/src/java/org/mozilla/gecko/gfx/LayerView.java | 20 |
2 files changed, 6 insertions, 19 deletions
diff --git a/android/source/src/java/org/libreoffice/canvas/CommonCanvasElement.java b/android/source/src/java/org/libreoffice/canvas/CommonCanvasElement.java index 101afe4b70ac..6b40ae4ba905 100644 --- a/android/source/src/java/org/libreoffice/canvas/CommonCanvasElement.java +++ b/android/source/src/java/org/libreoffice/canvas/CommonCanvasElement.java @@ -41,9 +41,6 @@ public abstract class CommonCanvasElement implements CanvasElement, CanvasElemen */ @Override public boolean contains(float x, float y) { - if (!isVisible()) { - return false; - } - return onHitTest(x, y); + return isVisible() && onHitTest(x, y); } } diff --git a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java index 41fafd46a3db..05f2118114c8 100644 --- a/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java +++ b/android/source/src/java/org/mozilla/gecko/gfx/LayerView.java @@ -200,37 +200,27 @@ public class LayerView extends FrameLayout { @Override public boolean onKeyPreIme(int keyCode, KeyEvent event) { - if (mInputConnectionHandler != null) - return mInputConnectionHandler.onKeyPreIme(keyCode, event); - return false; + return mInputConnectionHandler != null && mInputConnectionHandler.onKeyPreIme(keyCode, event); } @Override public boolean onKeyDown(int keyCode, KeyEvent event) { - if (mInputConnectionHandler != null) - return mInputConnectionHandler.onKeyDown(keyCode, event); - return false; + return mInputConnectionHandler != null && mInputConnectionHandler.onKeyDown(keyCode, event); } @Override public boolean onKeyLongPress(int keyCode, KeyEvent event) { - if (mInputConnectionHandler != null) - return mInputConnectionHandler.onKeyLongPress(keyCode, event); - return false; + return mInputConnectionHandler != null && mInputConnectionHandler.onKeyLongPress(keyCode, event); } @Override public boolean onKeyMultiple(int keyCode, int repeatCount, KeyEvent event) { - if (mInputConnectionHandler != null) - return mInputConnectionHandler.onKeyMultiple(keyCode, repeatCount, event); - return false; + return mInputConnectionHandler != null && mInputConnectionHandler.onKeyMultiple(keyCode, repeatCount, event); } @Override public boolean onKeyUp(int keyCode, KeyEvent event) { - if (mInputConnectionHandler != null) - return mInputConnectionHandler.onKeyUp(keyCode, event); - return false; + return mInputConnectionHandler != null && mInputConnectionHandler.onKeyUp(keyCode, event); } public boolean isIMEEnabled() { |