[Libreoffice-commits] core.git: 2 commits - android/README android/source
Christian Lohmaier
lohmaier+LibreOffice at googlemail.com
Sat Apr 7 20:19:58 UTC 2018
android/README | 3 +++
android/source/src/java/org/libreoffice/LOKitTileProvider.java | 9 +++++++--
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 6cf76c15dd10c130c8ca24b8eb55680b7016c960
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date: Sat Apr 7 22:07:25 2018 +0200
add hint on how to use lldb pretty-printers form within android studio
Change-Id: Ia028dd64c04d1de95e42ea2b89ee2bca689a2390
diff --git a/android/README b/android/README
index ce7c3be7a603..21ede90e94e4 100644
--- a/android/README
+++ b/android/README
@@ -243,6 +243,9 @@ Using lldb from within Android Studio is more comfortable though and works like
- on tab "General" pick module "source"
- on tab "Native Debugger" add android/source/obj/local/<hostarch> to
the Symbol directories
+ - on the LLDB startup commands tab add
+ "command script import /path/to/solenv/lldb/libreoffice/LO.py"
+ to get some pretty printing hooks for the various string classes
Then you can select your new configuration and use Run | Debug to launch it.
Note that lldb doesn't initially stop execution, so if you want to add
commit 59f88e62f53cf54f441f51456767f6ba0e52ca54
Author: Christian Lohmaier <lohmaier+LibreOffice at googlemail.com>
Date: Sat Apr 7 21:01:10 2018 +0200
prevent crash on invalid bitmap size
sometimes the width and height cannot be determined properly (and 0 in
that case), and this causes IllegalArgumentException when trying to
create the Bitmap
Change-Id: Id001c40d0febf9e85b4db5c0318a77e1f880353a
diff --git a/android/source/src/java/org/libreoffice/LOKitTileProvider.java b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
index a96f6092363c..bf2c2601e7cd 100644
--- a/android/source/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/source/src/java/org/libreoffice/LOKitTileProvider.java
@@ -467,8 +467,13 @@ class LOKitTileProvider implements TileProvider {
if (mDocument != null)
mDocument.paintTile(buffer, widthPixel, heightPixel, 0, 0, (int) mWidthTwip, (int) mHeightTwip);
- Bitmap bitmap = Bitmap.createBitmap(widthPixel, heightPixel, Bitmap.Config.ARGB_8888);
- bitmap.copyPixelsFromBuffer(buffer);
+ Bitmap bitmap = null;
+ try {
+ bitmap = Bitmap.createBitmap(widthPixel, heightPixel, Bitmap.Config.ARGB_8888);
+ bitmap.copyPixelsFromBuffer(buffer);
+ } catch (IllegalArgumentException e) {
+ Log.e(LOGTAG, "width (" + widthPixel + ") and height (" + heightPixel + ") must not be 0! (ToDo: likely timing issue)");
+ }
if (bitmap == null) {
Log.w(LOGTAG, "Thumbnail not created!");
}
More information about the Libreoffice-commits
mailing list