summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2022-04-26 08:27:21 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2022-04-26 14:06:14 +0200
commit6df639114da3fa98bd2fd749eca40d3c2190c018 (patch)
tree669ec55625982428e4f5262f82c9c551767a96c7
parent052c8a4b1b3aaa472ca89f834572c293f7d9ead2 (diff)
android: Use 'if' instead of switch-cases with just 1 case
... which IMHO makes this a bit more readable. Change-Id: Ica1d9416f711e75e6d6c23963ca64d13e08c138e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133428 Tested-by: Jenkins Reviewed-by: Michael Weghorn <m.weghorn@posteo.de>
-rw-r--r--android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java9
1 files changed, 3 insertions, 6 deletions
diff --git a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
index c096332b2bcc..697980af397d 100644
--- a/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
+++ b/android/source/src/java/org/mozilla/gecko/gfx/JavaPanZoomController.java
@@ -143,12 +143,9 @@ class JavaPanZoomController
/** This function MUST be called on the UI thread */
public boolean onMotionEvent(MotionEvent event) {
- switch (event.getSource() & InputDevice.SOURCE_CLASS_MASK) {
- case InputDevice.SOURCE_CLASS_POINTER:
- switch (event.getAction() & MotionEvent.ACTION_MASK) {
- case MotionEvent.ACTION_SCROLL: return handlePointerScroll(event);
- }
- break;
+ if ((event.getSource() & InputDevice.SOURCE_CLASS_MASK) == InputDevice.SOURCE_CLASS_POINTER
+ && (event.getAction() & MotionEvent.ACTION_MASK) == MotionEvent.ACTION_SCROLL) {
+ return handlePointerScroll(event);
}
return false;
}