[Libreoffice-commits] .: android/experimental

Michael Meeks michael at kemper.freedesktop.org
Tue Aug 14 03:30:47 PDT 2012


 android/experimental/LibreOffice4Android/Makefile                                          |    3 +-
 android/experimental/LibreOffice4Android/jni/Application.mk                                |    2 -
 android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java |   11 +++++++++-
 3 files changed, 12 insertions(+), 4 deletions(-)

New commits:
commit 318590b2900ff01ac36bb0bab84ddb69ffa0f9c9
Author: Michael Meeks <michael.meeks at suse.com>
Date:   Tue Aug 14 10:28:47 2012 +0100

    android: recover from un-thumb-nail-able documents without crashing

diff --git a/android/experimental/LibreOffice4Android/Makefile b/android/experimental/LibreOffice4Android/Makefile
index 3a49c7d..0bfbf3b 100644
--- a/android/experimental/LibreOffice4Android/Makefile
+++ b/android/experimental/LibreOffice4Android/Makefile
@@ -244,4 +244,5 @@ build-ant: copy-stuff properties
 
 run:
 # /data/local/tmp/sample-document.odt
-	adb shell am start -n $(APP_PACKAGE)/.ui.LibreOfficeUIActivity -e input /assets/test1.odt -e lo-main-delay 20
+# add -e lo-strace to strace
+	adb shell am start -n $(APP_PACKAGE)/.ui.LibreOfficeUIActivity  -e lo-strace -e input /assets/test1.odt
diff --git a/android/experimental/LibreOffice4Android/jni/Application.mk b/android/experimental/LibreOffice4Android/jni/Application.mk
deleted file mode 100644
index a11b28d..0000000
--- a/android/experimental/LibreOffice4Android/jni/Application.mk
+++ /dev/null
@@ -1,2 +0,0 @@
-APP_ABI := armeabi-v7a
-APP_PLATFORM := android-14
diff --git a/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java b/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java
index a4d0336..7c824f8 100644
--- a/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java
+++ b/android/experimental/LibreOffice4Android/src/org/libreoffice/ui/LibreOfficeUIActivity.java
@@ -132,7 +132,7 @@ public class LibreOfficeUIActivity extends SherlockActivity implements ActionBar
         //Set the "home" - top level - directory.
         homeDirectory  = new File(Environment.getExternalStorageDirectory(),"LibreOffice");
         homeDirectory.mkdirs();
-        currentDirectory = homeDirectory;        
+        currentDirectory = homeDirectory;
         //Load default settings
         
 
@@ -819,6 +819,9 @@ class ListItemAdapter implements ListAdapter{
                     toolkit = (XToolkit2) UnoRuntime.queryInterface(XToolkit2.class, toolkitService);
 
                     renderable = (XRenderable) UnoRuntime.queryInterface(XRenderable.class, doc);
+		    if (renderable == null)
+			// some serious error with the rendering backend
+			return new Integer(0);
 
                     // Set up dummySmallDevice and use it to find out the number
                     // of pages ("renderers").
@@ -851,6 +854,12 @@ class ListItemAdapter implements ListAdapter{
         }
 
             protected void onPostExecute(Integer result){
+
+		if (renderable == null) {
+                    Log.i(TAG, "Document is un-renderable");
+		    return; // TODO: check if this falls-back to a sensible image
+		}
+
                 int widthInPx = dpToPx( 100 );
                 int heightInPx = dpToPx( (int)( 100*Math.sqrt(2) ) );
                 ByteBuffer bb = renderPage( 0 , widthInPx , heightInPx);


More information about the Libreoffice-commits mailing list