[Libreoffice-commits] core.git: android/source
Christian Lohmaier
lohmaier+LibreOffice at googlemail.com
Mon Jan 29 14:24:28 UTC 2018
android/source/src/java/org/libreoffice/InvalidationHandler.java | 5 ++++-
android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java | 4 ++++
2 files changed, 8 insertions(+), 1 deletion(-)
New commits:
commit 2ff6afcce2c4df59d81f9d07cd9b7ffda00da479
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date: Mon Jan 29 15:18:51 2018 +0100
tdf#89215 only process state changes after TileProvider is ready
otherwise the handling tries to access properties like fonts too early
and trigger NPEs
Change-Id: I132c02f936c7b3e70fced1e1e022a6cf803ed5ff
diff --git a/android/source/src/java/org/libreoffice/InvalidationHandler.java b/android/source/src/java/org/libreoffice/InvalidationHandler.java
index b3b654346256..a79ecde2ad01 100644
--- a/android/source/src/java/org/libreoffice/InvalidationHandler.java
+++ b/android/source/src/java/org/libreoffice/InvalidationHandler.java
@@ -239,7 +239,10 @@ public class InvalidationHandler implements Document.MessageCallback, Office.Mes
}
final String value = parts[1];
boolean pressed = Boolean.parseBoolean(value);
-
+ if (!mContext.getTileProvider().isReady()) {
+ Log.w(LOGTAG, "tile provider not ready, ignoring payload "+payload);
+ return;
+ }
if (parts[0].equals(".uno:Bold")) {
mContext.getFormattingController().onToggleStateChanged(Document.BOLD, pressed);
} else if (parts[0].equals(".uno:Italic")) {
diff --git a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
index 48722dcd9bfd..0b3f8b8e0e06 100644
--- a/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/source/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -719,6 +719,10 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
mTileProvider = loKitTileProvider;
}
+ public LOKitTileProvider getTileProvider() {
+ return mTileProvider;
+ }
+
public void savePassword(String pwd) {
mPassword = pwd;
synchronized (mTileProvider.getMessageCallback()) {
More information about the Libreoffice-commits
mailing list