[Libreoffice-commits] core.git: android/source
Michael Weghorn (via logerrit)
logerrit at kemper.freedesktop.org
Wed Jul 1 18:16:48 UTC 2020
android/source/src/java/org/libreoffice/overlay/DocumentOverlayView.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 03093a91b64fea9852704f49cd20d162784ca748
Author: Michael Weghorn <m.weghorn at posteo.de>
AuthorDate: Wed Jul 1 16:06:33 2020 +0200
Commit: Michael Weghorn <m.weghorn at posteo.de>
CommitDate: Wed Jul 1 20:16:13 2020 +0200
tdf#134405 android: Add null check
Without it, Android Viewer crashes in experimental editing
mode when e.g. opening the sample doc and clicking into the
text area.
E AndroidRuntime: FATAL EXCEPTION: main
E AndroidRuntime: Process: org.libreoffice, PID: 6152
E AndroidRuntime: java.lang.NullPointerException: Attempt to read from field 'float android.graphics.RectF.left' on a null object reference
E AndroidRuntime: at org.mozilla.gecko.gfx.RectUtils.scale(RectUtils.java:45)
E AndroidRuntime: at org.libreoffice.overlay.DocumentOverlayView.convertToScreen(DocumentOverlayView.java:194)
E AndroidRuntime: at org.libreoffice.overlay.DocumentOverlayView.repositionWithViewport(DocumentOverlayView.java:184)
E AndroidRuntime: at org.libreoffice.overlay.DocumentOverlayView.changeGraphicSelection(DocumentOverlayView.java:157)
E AndroidRuntime: at org.libreoffice.overlay.DocumentOverlay$11.run(DocumentOverlay.java:199)
E AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:883)
E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:100)
E AndroidRuntime: at android.os.Looper.loop(Looper.java:214)
E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:7356)
E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
E AndroidRuntime: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930)
Change-Id: Ibff148a5d83413b4eed8a054b0143c9dae4e5537
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97632
Tested-by: Jenkins
Reviewed-by: Michael Weghorn <m.weghorn at posteo.de>
diff --git a/android/source/src/java/org/libreoffice/overlay/DocumentOverlayView.java b/android/source/src/java/org/libreoffice/overlay/DocumentOverlayView.java
index b425fbb59ef2..086108cd903f 100644
--- a/android/source/src/java/org/libreoffice/overlay/DocumentOverlayView.java
+++ b/android/source/src/java/org/libreoffice/overlay/DocumentOverlayView.java
@@ -181,8 +181,11 @@ public class DocumentOverlayView extends View implements View.OnTouchListener {
mCalcSelectionBox.reposition(rect);
}
- RectF scaledGraphicSelection = convertToScreen(mGraphicSelection.mRectangle, x, y, zoom);
- mGraphicSelection.reposition(scaledGraphicSelection);
+ if (mGraphicSelection != null && mGraphicSelection.mRectangle != null) {
+ RectF scaledGraphicSelection = convertToScreen(mGraphicSelection.mRectangle, x, y, zoom);
+ mGraphicSelection.reposition(scaledGraphicSelection);
+ }
+
invalidate();
}
More information about the Libreoffice-commits
mailing list