[Libreoffice-commits] core.git: 17 commits - android/experimental configure.ac desktop/source sd/source solenv/bin sw/source

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Sun Aug 3 13:40:19 PDT 2014


 android/experimental/LOAndroid3/AndroidManifest.xml                                          |   51 +++-
 android/experimental/LOAndroid3/Makefile                                                     |    2 
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java                    |   59 ++---
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java              |   18 +
 android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java        |    9 
 android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java               |    6 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GLController.java             |    3 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java         |   67 ++++-
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java |  116 ----------
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/Layer.java                    |    3 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java          |    4 
 android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java            |   34 +-
 configure.ac                                                                                 |    3 
 desktop/source/lib/lokandroid.cxx                                                            |    2 
 sd/source/filter/xml/sdxmlwrp.cxx                                                            |    5 
 solenv/bin/native-code.py                                                                    |    8 
 sw/source/filter/xml/swxml.cxx                                                               |    5 
 17 files changed, 198 insertions(+), 197 deletions(-)

New commits:
commit 10acf77f1af4c5c233c64ef54e3ef8657d1d9c6a
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Sun Aug 3 22:41:12 2014 +0200

    LOAndroid3: set part 0 by default, log document size
    
    Change-Id: I5517ff43c17637730639351f84df15a719aeb0a3

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index e39c51b..5e79a77 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -54,8 +54,9 @@ public class LOKitTileProvider implements TileProvider {
         } else {
             Log.i(LOGTAG, "Document parts: " + mDocument.getParts());
             if (mDocument.getParts() >= 1) {
-                mDocument.setPart(1);
+                mDocument.setPart(0);
             }
+            Log.i(LOGTAG, "Document size: " + mDocument.getDocumentWidth() + " x " + mDocument.getDocumentHeight());
         }
     }
 
commit 392bb7af178c6531a9b94e2a9e5c085e0c40bbdd
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Sun Aug 3 22:40:02 2014 +0200

    LOAndroid3: include in native-code.py some more needed libraries
    
    Change-Id: I74a2ff491c9328acd59a05ec3f83ed037847a1d6

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 116e2e4..9b3895c 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -130,6 +130,10 @@ calc_factory_list = [
     ("libscfiltlo.a", "scfilt_component_getFactory"),
     ("libsclo.a", "sc_component_getFactory"),
     ("libavmedialo.a", "avmedia_component_getFactory"),
+    ("libanalysislo.a", "analysis_component_getFactory"),
+    ("libdatelo.a", "date_component_getFactory"),
+    ("libpricinglo.a", "pricing_component_getFactory"),
+    ("libsvllo.a", "svl_component_getFactory"),
     ]
 
 calc_constructor_list = [
@@ -139,6 +143,8 @@ draw_factory_list = [
     ("libsddlo.a", "sdd_component_getFactory"),
     ("libsdlo.a", "sd_component_getFactory"),
     ("libsvgfilterlo.a", "svgfilter_component_getFactory"),
+    ("libdeployment.a", "deployment_component_getFactory"),
+    ("libemboleobj.a", "emboleobj_component_getFactory"),
     ]
 
 draw_constructor_list = [
commit 2b61e26c4ad81bf410f659e328e758acb637d01b
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Sun Aug 3 22:39:05 2014 +0200

    LOAndroid3: correctly calculate which tiles to draw
    
    Change-Id: I195a318c8ce86cfcb12f724e04c115e0de444345

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 58339bf..a195da0 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -26,6 +26,20 @@ public class LOKitThread extends Thread {
         mInputFile = inputFile;
     }
 
+    RectF normlizeRect(ViewportMetrics metrics) {
+        RectF rect = metrics.getViewport();
+        float zoomFactor = metrics.getZoomFactor();
+        return new RectF(rect.left / zoomFactor, rect.top / zoomFactor, rect.right / zoomFactor, rect.bottom / zoomFactor);
+    }
+
+    Rect roundToTileSize(RectF input, int tileSize) {
+        int minX = (Math.round(input.left)    / tileSize) * tileSize;
+        int minY = (Math.round(input.top)     / tileSize) * tileSize;
+        int maxX = ((Math.round(input.right)  / tileSize) + 1) * tileSize;
+        int maxY = ((Math.round(input.bottom) / tileSize) + 1) * tileSize;
+        return new Rect(minX, minY, maxX, maxY);
+    }
+
     private boolean draw() throws InterruptedException {
         int pageWidth = mTileProvider.getPageWidth();
         int pageHeight = mTileProvider.getPageHeight();
@@ -34,27 +48,15 @@ public class LOKitThread extends Thread {
         mViewportMetrics.setPageSize(new FloatSize(pageWidth, pageHeight));
 
         GeckoLayerClient layerClient = mApplication.getLayerClient();
-        ViewportMetrics metrics = mApplication.getLayerController().getViewportMetrics();
-
-        RectF viewport = metrics.getClampedViewport();
-        float zoomFactor = metrics.getZoomFactor();
-
         boolean shouldContinue = layerClient.beginDrawing(mViewportMetrics);
 
         if (!shouldContinue) {
             return false;
         }
 
-        int minX = ((int) viewport.left / TILE_SIZE) * TILE_SIZE;
-        int minY = ((int) viewport.top / TILE_SIZE) * TILE_SIZE;
-        int maxX = (((int) viewport.right / TILE_SIZE) + 1) * TILE_SIZE;
-        int maxY = (((int) viewport.bottom / TILE_SIZE) + 1) * TILE_SIZE;
-
-        Rect rect = new Rect(
-                Math.round(minX / zoomFactor),
-                Math.round(minY / zoomFactor),
-                Math.round(maxX / zoomFactor),
-                Math.round(maxY / zoomFactor));
+        ViewportMetrics metrics = mApplication.getLayerController().getViewportMetrics();
+        RectF viewport = normlizeRect(metrics);
+        Rect rect = roundToTileSize(viewport, TILE_SIZE);
 
         ArrayList<SubTile> removeTiles = new ArrayList<SubTile>();
         for (SubTile tile : layerClient.getTiles()) {
@@ -64,8 +66,8 @@ public class LOKitThread extends Thread {
         }
         layerClient.getTiles().removeAll(removeTiles);
 
-        for (int y = minY; y <= maxY; y+=TILE_SIZE) {
-            for (int x = minX; x <= maxX; x+=TILE_SIZE) {
+        for (int y = rect.top; y <= rect.bottom; y += TILE_SIZE) {
+            for (int x = rect.left; x <= rect.right; x += TILE_SIZE) {
                 if (x > pageWidth) {
                     continue;
                 }
commit 370f05aabbcb8f348a9739d2ef324b7f72f0afa7
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Wed Jul 30 13:18:37 2014 +0200

    LOAndroid3: add draw to native-code
    
    Change-Id: I215d99c0161a9b9c9df3f8ef362514e161b31acf

diff --git a/android/experimental/LOAndroid3/Makefile b/android/experimental/LOAndroid3/Makefile
index 3c7417a..08e933e 100644
--- a/android/experimental/LOAndroid3/Makefile
+++ b/android/experimental/LOAndroid3/Makefile
@@ -13,7 +13,7 @@ BOOTSTRAPDIR=../../Bootstrap
 include $(BOOTSTRAPDIR)/Makefile.shared
 
 native-code.cxx: $(SRCDIR)/solenv/bin/native-code.py
-	$< -j -g core -g writer -g calc > $@
+	$< -j -g core -g writer -g calc -g draw > $@
 
 build-ant: android_version_setup copy-stuff link-so properties
 #
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 7236929..116e2e4 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -139,7 +139,6 @@ draw_factory_list = [
     ("libsddlo.a", "sdd_component_getFactory"),
     ("libsdlo.a", "sd_component_getFactory"),
     ("libsvgfilterlo.a", "svgfilter_component_getFactory"),
-    ("libwpftdrawlo.a", "wpftdraw_component_getFactory"),
     ]
 
 draw_constructor_list = [
commit f264ff6aad5684fbcc4789a9a8094f5443586ad2
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Wed Jul 30 13:14:51 2014 +0200

    put ReadThroughComponent to anon. namespace to avoid redefinition
    
    Change-Id: Idcc97e067b0f389a5d9e01013ab2fc20d2dd4ccd

diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index dd6d8cd..73ce021 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -174,6 +174,9 @@ SdXMLFilter::~SdXMLFilter(void)
 {
 }
 
+namespace
+{
+
 sal_Int32 ReadThroughComponent(
     Reference<io::XInputStream> xInputStream,
     Reference<XComponent> xModelComponent,
@@ -410,6 +413,8 @@ sal_Int32 ReadThroughComponent(
     return SD_XML_READERROR;
 }
 
+}
+
 bool SdXMLFilter::Import( ErrCode& nError )
 {
     sal_uInt32  nRet = 0;
diff --git a/sw/source/filter/xml/swxml.cxx b/sw/source/filter/xml/swxml.cxx
index afce162..4c0c008 100644
--- a/sw/source/filter/xml/swxml.cxx
+++ b/sw/source/filter/xml/swxml.cxx
@@ -119,6 +119,9 @@ int XMLReader::GetReaderType()
     return SW_STORAGE_READER;
 }
 
+namespace
+{
+
 /// read a component (file + filter version)
 sal_Int32 ReadThroughComponent(
     uno::Reference<io::XInputStream> xInputStream,
@@ -365,6 +368,8 @@ sal_Int32 ReadThroughComponent(
     return ERR_SWG_READ_ERROR;
 }
 
+}
+
 // #i44177#
 static void lcl_AdjustOutlineStylesForOOo(SwDoc& _rDoc)
 {
commit 7f36e996a07ed7f39a33fffb2d2c523adf00eefc
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Mon Jul 28 13:20:32 2014 +0200

    build avmedia for Android
    
    Change-Id: I0137bb7ce6337ca852af513565cc19dad3c8dc8b

diff --git a/configure.ac b/configure.ac
index fc99563..d9d9303 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2446,10 +2446,9 @@ fi
 AC_SUBST(DISABLE_EXPORT)
 
 # Whether to build "avmedia" functionality or not.
-# We probably don't want it for non-desktop.
 
 if test -z "$enable_avmedia"; then
-    if test $_os != iOS -a $_os != Android; then
+    if test $_os != iOS; then
         enable_avmedia=yes
     fi
 fi
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index 2e0f3b7..7236929 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -129,6 +129,7 @@ calc_factory_list = [
     ("libscdlo.a", "scd_component_getFactory"),
     ("libscfiltlo.a", "scfilt_component_getFactory"),
     ("libsclo.a", "sc_component_getFactory"),
+    ("libavmedialo.a", "avmedia_component_getFactory"),
     ]
 
 calc_constructor_list = [
commit c77f452d83f4f01bb0b91c19773ca9715d1aae2a
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Mon Jul 28 13:17:41 2014 +0200

    LOAndroid3: add calc to native-code to include the necessary libs
    
    Change-Id: I59eeadfe5417d2a574d672ff3f039bc125abbdbe

diff --git a/android/experimental/LOAndroid3/Makefile b/android/experimental/LOAndroid3/Makefile
index 445b7fd..3c7417a 100644
--- a/android/experimental/LOAndroid3/Makefile
+++ b/android/experimental/LOAndroid3/Makefile
@@ -13,7 +13,7 @@ BOOTSTRAPDIR=../../Bootstrap
 include $(BOOTSTRAPDIR)/Makefile.shared
 
 native-code.cxx: $(SRCDIR)/solenv/bin/native-code.py
-	$< -j -g core -g writer > $@
+	$< -j -g core -g writer -g calc > $@
 
 build-ant: android_version_setup copy-stuff link-so properties
 #
commit f944bb4ec4d2a65759a74260b11fb78dbf0e6a39
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Mon Jul 28 08:53:20 2014 +0200

    LOAndroid3: Fix mTileWidth / mTileHeight initialization
    
    Change-Id: If2af5afa3abff6da45e726dd8c28216e6f939caf

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index e793158..e39c51b 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -39,6 +39,9 @@ public class LOKitTileProvider implements TileProvider {
     public LOKitTileProvider(LayerController layerController, String input) {
         mLayerController = layerController;
         mDPI = (double) LOKitShell.getDpi();
+        mTileWidth = pixelToTwip(TILE_SIZE, mDPI);
+        mTileHeight = pixelToTwip(TILE_SIZE, mDPI);
+
         LibreOfficeKit.putenv("SAL_LOG=+WARN+INFO-INFO.legacy.osl-INFO.i18nlangtag");
         LibreOfficeKit.init(LibreOfficeMainActivity.mAppContext);
 
@@ -53,8 +56,6 @@ public class LOKitTileProvider implements TileProvider {
             if (mDocument.getParts() >= 1) {
                 mDocument.setPart(1);
             }
-            mTileWidth = pixelToTwip(TILE_SIZE, mDPI);
-            mTileHeight = pixelToTwip(TILE_SIZE, mDPI);
         }
     }
 
commit 4d197ba48338c27265b7d23b7f73b4f8d6e6e6c3
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Mon Jul 28 08:38:53 2014 +0200

    LOAndroid3: don't update viewport if scrolled by (0,0)
    
    Change-Id: I299ebf08d77c7f2a35ed551dfcdf17fa8d0a8d79

diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java
index 38de9c4..54def4a 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerController.java
@@ -275,6 +275,10 @@ public class LayerController {
      * Scrolls the viewport by the given offset. You must hold the monitor while calling this.
      */
     public void scrollBy(PointF point) {
+        if (point.equals(0,0)) {
+            return;
+        }
+
         PointF origin = mViewportMetrics.getOrigin();
         origin.offset(point.x, point.y);
         mViewportMetrics.setOrigin(origin);
commit 6e1aa919e36bc0112cc48a8d9ff3ddf8b1b20aec
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Mon Jul 28 08:37:50 2014 +0200

    LOAndroid3: log and handle error after document load
    
    Change-Id: I0486a6530565919588dae8411e10d7e8e27020be

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index f5b44f7..e793158 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -1,6 +1,7 @@
 package org.libreoffice;
 
 import android.graphics.Bitmap;
+import android.util.Log;
 
 import org.libreoffice.kit.Document;
 import org.libreoffice.kit.LibreOfficeKit;
@@ -13,6 +14,8 @@ import org.mozilla.gecko.gfx.SubTile;
 import java.nio.ByteBuffer;
 
 public class LOKitTileProvider implements TileProvider {
+    private static final String LOGTAG = LOKitShell.class.getSimpleName();
+
     private final LayerController mLayerController;
 
     public static int TILE_SIZE = 256;
@@ -40,10 +43,19 @@ public class LOKitTileProvider implements TileProvider {
         LibreOfficeKit.init(LibreOfficeMainActivity.mAppContext);
 
         mOffice = new Office(LibreOfficeKit.getLibreOfficeKitHandle());
+
         mDocument = mOffice.documentLoad(input);
 
-        mTileWidth  = pixelToTwip(TILE_SIZE, mDPI);
-        mTileHeight = pixelToTwip(TILE_SIZE, mDPI);
+        if(mDocument == null) {
+            Log.e(LOGTAG, "Error: " + mOffice.getError());
+        } else {
+            Log.i(LOGTAG, "Document parts: " + mDocument.getParts());
+            if (mDocument.getParts() >= 1) {
+                mDocument.setPart(1);
+            }
+            mTileWidth = pixelToTwip(TILE_SIZE, mDPI);
+            mTileHeight = pixelToTwip(TILE_SIZE, mDPI);
+        }
     }
 
     @Override
commit 3086d7114d8dbb744e87cca966426d50c0cbfdd6
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Mon Jul 28 08:36:43 2014 +0200

    LOAndroid3: extract some repeated access to local variables
    
    Change-Id: I1bf6f23247da73eeccde569f220095d0e1716d0a

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index c418b4c..58339bf 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -5,6 +5,7 @@ import android.graphics.RectF;
 import android.util.Log;
 
 import org.mozilla.gecko.gfx.FloatSize;
+import org.mozilla.gecko.gfx.GeckoLayerClient;
 import org.mozilla.gecko.gfx.SubTile;
 import org.mozilla.gecko.gfx.ViewportMetrics;
 
@@ -32,10 +33,13 @@ public class LOKitThread extends Thread {
         mViewportMetrics = new ViewportMetrics();
         mViewportMetrics.setPageSize(new FloatSize(pageWidth, pageHeight));
 
-        RectF viewport = mApplication.getLayerController().getViewportMetrics().getClampedViewport();
-        float zoomFactor = mApplication.getLayerController().getViewportMetrics().getZoomFactor();
+        GeckoLayerClient layerClient = mApplication.getLayerClient();
+        ViewportMetrics metrics = mApplication.getLayerController().getViewportMetrics();
 
-        boolean shouldContinue = mApplication.getLayerClient().beginDrawing(mViewportMetrics);
+        RectF viewport = metrics.getClampedViewport();
+        float zoomFactor = metrics.getZoomFactor();
+
+        boolean shouldContinue = layerClient.beginDrawing(mViewportMetrics);
 
         if (!shouldContinue) {
             return false;
@@ -53,12 +57,12 @@ public class LOKitThread extends Thread {
                 Math.round(maxY / zoomFactor));
 
         ArrayList<SubTile> removeTiles = new ArrayList<SubTile>();
-        for (SubTile tile : mApplication.getLayerClient().getTiles()) {
+        for (SubTile tile : layerClient.getTiles()) {
             if (!rect.intersects(tile.x, tile.y, tile.x + TILE_SIZE, tile.y + TILE_SIZE)) {
                 removeTiles.add(tile);
             }
         }
-        mApplication.getLayerClient().getTiles().removeAll(removeTiles);
+        layerClient.getTiles().removeAll(removeTiles);
 
         for (int y = minY; y <= maxY; y+=TILE_SIZE) {
             for (int x = minX; x <= maxX; x+=TILE_SIZE) {
@@ -69,19 +73,19 @@ public class LOKitThread extends Thread {
                     continue;
                 }
                 boolean contains = false;
-                for (SubTile tile : mApplication.getLayerClient().getTiles()) {
+                for (SubTile tile : layerClient.getTiles()) {
                     if (tile.x == x && tile.y == y) {
                         contains = true;
                     }
                 }
                 if (!contains) {
                     SubTile tile = mTileProvider.createTile(x, y);
-                    mApplication.getLayerClient().addTile(tile);
+                    layerClient.addTile(tile);
                 }
             }
         }
 
-        mApplication.getLayerClient().endDrawing();
+        layerClient.endDrawing();
 
         return true;
     }
commit 0e6b06aae0432d5580762469a7f090c8c360da1e
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Mon Jul 28 08:33:44 2014 +0200

    LOAndroid3: add additional mime types that open LO viewer
    
    Change-Id: Ia2a41f0f483fe15ae3938140b63f3215b692014a

diff --git a/android/experimental/LOAndroid3/AndroidManifest.xml b/android/experimental/LOAndroid3/AndroidManifest.xml
index ab2db55..f4c122c 100644
--- a/android/experimental/LOAndroid3/AndroidManifest.xml
+++ b/android/experimental/LOAndroid3/AndroidManifest.xml
@@ -25,13 +25,50 @@
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
             </intent-filter>
-             <intent-filter>
-                 <action android:name="android.intent.action.VIEW" />
-                 <action android:name="android.intent.action.EDIT" />
-                 <action android:name="android.intent.action.PICK" />
-                 <category android:name="android.intent.category.DEFAULT" />
-                 <data android:mimeType="application/vnd.oasis.opendocument.text" />
-             </intent-filter>
+            <intent-filter>
+                <action android:name="android.intent.action.VIEW" />
+                <action android:name="android.intent.action.EDIT" />
+                <action android:name="android.intent.action.PICK" />
+                <category android:name="android.intent.category.DEFAULT" />
+
+                <!-- ODT -->
+                <data android:mimeType="application/vnd.oasis.opendocument.text" />
+                <data android:mimeType="application/vnd.oasis.opendocument.graphics" />
+                <data android:mimeType="application/vnd.oasis.opendocument.presentation" />
+                <data android:mimeType="application/vnd.oasis.opendocument.spreadsheet" />
+                <data android:mimeType="application/vnd.oasis.opendocument.text-flat-xml" />
+                <data android:mimeType="application/vnd.oasis.opendocument.graphics-flat-xml" />
+                <data android:mimeType="application/vnd.oasis.opendocument.presentation-flat-xml" />
+                <data android:mimeType="application/vnd.oasis.opendocument.spreadsheet-flat-xml" />
+
+                <!-- MS -->
+                <data android:mimeType="application/rtf" />
+                <data android:mimeType="text/rtf" />
+                <data android:mimeType="application/msword" />
+                <data android:mimeType="application/vnd.ms-powerpoint" />
+                <data android:mimeType="application/vnd.ms-excel" />
+                <data android:mimeType="application/vnd.visio" />
+                <data android:mimeType="application/vnd.visio.xml" />
+                <data android:mimeType="application/x-mspublisher" />
+
+                <!-- OOXML -->
+                <data android:mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
+                <data android:mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation" />
+                <data android:mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
+
+                <!-- OTHER -->
+                <data android:mimeType="text/csv" />
+                <data android:mimeType="text/spreadsheet" />
+                <data android:mimeType="application/vnd.ms-works" />
+                <data android:mimeType="application/vnd.apple.keynote" />
+                <data android:mimeType="application/x-abiword" />
+                <data android:mimeType="application/x-pagemaker" />
+                <data android:mimeType="image/x-emf" />
+                <data android:mimeType="image/x-svm" />
+                <data android:mimeType="image/x-wmf" />
+                <data android:mimeType="image/svg+xml" />
+
+            </intent-filter>
         </activity>
     </application>
 </manifest>
commit bb493b75c3a0be73f912242c69bbfd3f8e403c56
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Mon Jul 28 08:32:43 2014 +0200

    JNI: getErrorNative should be getError now
    
    Change-Id: If448e748f40cd8a41977129c576f6c5eac7b5727

diff --git a/desktop/source/lib/lokandroid.cxx b/desktop/source/lib/lokandroid.cxx
index b9fa1ba..68ebfdf 100644
--- a/desktop/source/lib/lokandroid.cxx
+++ b/desktop/source/lib/lokandroid.cxx
@@ -41,7 +41,7 @@ void setHandle(JNIEnv* pEnv, jobject aObject, T* aType)
     pEnv->SetLongField(aObject, getHandleField(pEnv, aObject), aHandle);
 }
 
-extern "C" SAL_JNI_EXPORT jstring JNICALL Java_org_libreoffice_kit_Office_getErrorNative(JNIEnv* pEnv, jobject aObject)
+extern "C" SAL_JNI_EXPORT jstring JNICALL Java_org_libreoffice_kit_Office_getError(JNIEnv* pEnv, jobject aObject)
 {
     LibreOfficeKit* pLibreOfficeKit = getHandle<LibreOfficeKit>(pEnv, aObject);
     char* pError = pLibreOfficeKit->pClass->getError(pLibreOfficeKit);
commit 90a87989721a2e115cd250f68f41f7a83c7d4a47
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Wed Jul 23 12:40:58 2014 +0200

    LODroid3: move GeckoSoftwareLayerClient into GeckoLayerClient
    
    Change-Id: Ic0186be09fcca52f10ab67957db54efc9c72267c

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
index a9d17aa..888db32 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LibreOfficeMainActivity.java
@@ -1,7 +1,6 @@
 package org.libreoffice;
 
 import android.app.Activity;
-import android.net.Uri;
 import android.os.Bundle;
 import android.os.SystemClock;
 import android.util.DisplayMetrics;
@@ -11,7 +10,7 @@ import android.view.MenuItem;
 import android.widget.LinearLayout;
 import android.widget.RelativeLayout;
 
-import org.mozilla.gecko.gfx.GeckoSoftwareLayerClient;
+import org.mozilla.gecko.gfx.GeckoLayerClient;
 import org.mozilla.gecko.gfx.LayerController;
 
 public class LibreOfficeMainActivity extends Activity {
@@ -22,7 +21,7 @@ public class LibreOfficeMainActivity extends Activity {
     private LinearLayout mMainLayout;
     private RelativeLayout mGeckoLayout;
     private static LayerController mLayerController;
-    private static GeckoSoftwareLayerClient mLayerClient;
+    private static GeckoLayerClient mLayerClient;
     private static LOKitThread sLOKitThread;
 
     public static LibreOfficeMainActivity mAppContext;
@@ -81,7 +80,7 @@ public class LibreOfficeMainActivity extends Activity {
             mLayerController = new LayerController(this);
 
             Log.e(LOGTAG, "### Creating GeckoSoftwareLayerClient");
-            mLayerClient = new GeckoSoftwareLayerClient(this);
+            mLayerClient = new GeckoLayerClient(this);
             Log.e(LOGTAG, "### Done creating GeckoSoftwareLayerClient");
 
             mLayerController.setLayerClient(mLayerClient);
@@ -98,7 +97,7 @@ public class LibreOfficeMainActivity extends Activity {
         return sLOKitThread;
     }
 
-    public static GeckoSoftwareLayerClient getLayerClient() {
+    public static GeckoLayerClient getLayerClient() {
         return mLayerClient;
     }
 
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
index 3ed1104..bfac3a9 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoLayerClient.java
@@ -49,19 +49,22 @@ import org.libreoffice.LOKitShell;
 import org.libreoffice.LibreOfficeMainActivity;
 import org.mozilla.gecko.util.FloatUtils;
 
-public abstract class GeckoLayerClient {
+import java.util.List;
+
+public class GeckoLayerClient {
     private static final String LOGTAG = "GeckoLayerClient";
     private static final long MIN_VIEWPORT_CHANGE_DELAY = 25L;
+
+    private static final IntSize TILE_SIZE = new IntSize(256, 256);
+
     protected IntSize mScreenSize;
     protected Layer mTileLayer;
-
     /* The viewport that Gecko is currently displaying. */
     protected ViewportMetrics mGeckoViewport;
-
     /* The viewport that Gecko will display when drawing is finished */
     protected ViewportMetrics mNewGeckoViewport;
-
     protected LayerController mLayerController;
+    private Context mContext;
     private long mLastViewportChangeTime;
     private boolean mPendingViewportAdjust;
     private boolean mViewportSizeChanged;
@@ -74,14 +77,33 @@ public abstract class GeckoLayerClient {
     private String mLastCheckerboardColor;
 
     public GeckoLayerClient(Context context) {
+        mContext = context;
         mScreenSize = new IntSize(0, 0);
     }
 
-    protected abstract boolean setupLayer();
+    protected boolean setupLayer() {
+        Log.i(LOGTAG, "Creating MultiTileLayer");
+        if (mTileLayer == null) {
+            mTileLayer = new MultiTileLayer(TILE_SIZE);
+            mLayerController.setRoot(mTileLayer);
+        }
 
-    protected abstract void updateLayerAfterDraw();
+        // Force a resize event to be sent because the results of this
+        // are different depending on what tile system we're using
+        //sendResizeEventIfNecessary(true);
 
-    protected abstract IntSize getTileSize();
+        return false;
+    }
+
+    protected void updateLayerAfterDraw() {
+        if (mTileLayer instanceof MultiTileLayer) {
+            ((MultiTileLayer) mTileLayer).invalidate();
+        }
+    }
+
+    protected IntSize getTileSize() {
+        return TILE_SIZE;
+    }
 
     /**
      * Attaches the root layer to the layer controller so that Gecko appears.
@@ -94,7 +116,7 @@ public abstract class GeckoLayerClient {
             layerController.setViewportMetrics(mGeckoViewport);
         }
 
-        sendResizeEventIfNecessary();
+        sendResizeEventIfNecessary(false);
     }
 
     public boolean beginDrawing(ViewportMetrics viewportMetrics) {
@@ -155,24 +177,26 @@ public abstract class GeckoLayerClient {
         DisplayMetrics metrics = new DisplayMetrics();
         LibreOfficeMainActivity.mAppContext.getWindowManager().getDefaultDisplay().getMetrics(metrics);
 
+        IntSize newScreenSize = new IntSize(metrics.widthPixels, metrics.heightPixels);
+
         // Return immediately if the screen size hasn't changed or the viewport
         // size is zero (which indicates that the rendering surface hasn't been
         // allocated yet).
-        boolean screenSizeChanged = (metrics.widthPixels != mScreenSize.width || metrics.heightPixels != mScreenSize.height);
+        boolean screenSizeChanged = !mScreenSize.equals(newScreenSize);
         boolean viewportSizeValid = (mLayerController != null && mLayerController.getViewportSize().isPositive());
 
         if (!(force || (screenSizeChanged && viewportSizeValid))) {
             return;
         }
 
-        mScreenSize = new IntSize(metrics.widthPixels, metrics.heightPixels);
-        IntSize tileSize = getTileSize();
+        mScreenSize = newScreenSize;
 
-        Log.e(LOGTAG, "### Screen-size changed to " + mScreenSize);
+        if (screenSizeChanged) {
+            Log.d(LOGTAG, "Screen-size changed to " + mScreenSize);
+        }
 
-        LOEvent event = LOEvent.sizeChanged(
-                metrics.widthPixels, metrics.heightPixels,
-                tileSize.width, tileSize.height);
+        IntSize tileSize = getTileSize();
+        LOEvent event = LOEvent.sizeChanged(metrics.widthPixels, metrics.heightPixels, tileSize.width, tileSize.height);
         LOKitShell.sendEvent(event);
     }
 
@@ -236,4 +260,17 @@ public abstract class GeckoLayerClient {
     private void sendResizeEventIfNecessary() {
         sendResizeEventIfNecessary(false);
     }
+
+    public void addTile(SubTile tile) {
+        if (mTileLayer instanceof MultiTileLayer) {
+            ((MultiTileLayer) mTileLayer).addTile(tile);
+        }
+    }
+
+    public List<SubTile> getTiles() {
+        if (mTileLayer instanceof MultiTileLayer) {
+            return ((MultiTileLayer) mTileLayer).getTiles();
+        }
+        return null;
+    }
 }
\ No newline at end of file
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
deleted file mode 100644
index a8276fa..0000000
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
- * ***** BEGIN LICENSE BLOCK *****
- * Version: MPL 1.1/GPL 2.0/LGPL 2.1
- *
- * The contents of this file are subject to the Mozilla Public License Version
- * 1.1 (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- * http://www.mozilla.org/MPL/
- *
- * Software distributed under the License is distributed on an "AS IS" basis,
- * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
- * for the specific language governing rights and limitations under the
- * License.
- *
- * The Original Code is Mozilla Android code.
- *
- * The Initial Developer of the Original Code is Mozilla Foundation.
- * Portions created by the Initial Developer are Copyright (C) 2009-2010
- * the Initial Developer. All Rights Reserved.
- *
- * Contributor(s):
- *   Patrick Walton <pcwalton at mozilla.com>
- *   Chris Lord <chrislord.net at gmail.com>
- *
- * Alternatively, the contents of this file may be used under the terms of
- * either the GNU General Public License Version 2 or later (the "GPL"), or
- * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
- * in which case the provisions of the GPL or the LGPL are applicable instead
- * of those above. If you wish to allow use of your version of this file only
- * under the terms of either the GPL or the LGPL, and not to allow others to
- * use your version of this file under the terms of the MPL, indicate your
- * decision by deleting the provisions above and replace them with the notice
- * and other provisions required by the GPL or the LGPL. If you do not delete
- * the provisions above, a recipient may use your version of this file under
- * the terms of any one of the MPL, the GPL or the LGPL.
- *
- * ***** END LICENSE BLOCK ***** */
-
-package org.mozilla.gecko.gfx;
-
-import android.content.Context;
-import android.util.Log;
-
-import java.util.List;
-
-
-/**
- * Transfers a software-rendered Gecko to an ImageLayer so that it can be rendered by our
- * compositor.
- *
- * TODO: Throttle down Gecko's priority when we pan and zoom.
- */
-public class GeckoSoftwareLayerClient extends GeckoLayerClient {
-    private static final String LOGTAG = "GeckoSoftwareLayerClient";
-
-    private static final IntSize TILE_SIZE = new IntSize(256, 256);
-
-    public GeckoSoftwareLayerClient(Context context) {
-        super(context);
-    }
-
-    public void setLayerController(LayerController layerController) {
-        super.setLayerController(layerController);
-
-        layerController.setRoot(mTileLayer);
-
-        if (mGeckoViewport != null) {
-            layerController.setViewportMetrics(mGeckoViewport);
-        }
-
-        sendResizeEventIfNecessary(false);
-    }
-
-    @Override
-    protected boolean setupLayer() {
-        Log.i(LOGTAG, "Creating MultiTileLayer");
-        if(mTileLayer == null) {
-            mTileLayer = new MultiTileLayer(TILE_SIZE);
-            mLayerController.setRoot(mTileLayer);
-        }
-
-        // Force a resize event to be sent because the results of this
-        // are different depending on what tile system we're using
-        sendResizeEventIfNecessary(true);
-
-        return false;
-    }
-
-    @Override
-    protected void updateLayerAfterDraw() {
-        if (mTileLayer instanceof MultiTileLayer) {
-            ((MultiTileLayer)mTileLayer).invalidate();
-        }
-    }
-
-
-    @Override
-    protected IntSize getTileSize() {
-        return TILE_SIZE;
-    }
-
-    public void addTile(SubTile tile) {
-        if (mTileLayer instanceof MultiTileLayer) {
-            ((MultiTileLayer)mTileLayer).addTile(tile);
-        }
-    }
-
-    public List<SubTile> getTiles() {
-        if (mTileLayer instanceof MultiTileLayer) {
-            return ((MultiTileLayer)mTileLayer).getTiles();
-        }
-        return null;
-    }
-}
-
commit 29fbaec862373d353dbad19ee108ddf5b4de1a0f
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Tue Jul 22 16:18:32 2014 +0200

    LOAndroid3: clean-up code
    
    Change-Id: I18aa63baff99e29ed343ce9092cc5ea73cc097d7

diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GLController.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GLController.java
index e8f2012..9f38bfe 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GLController.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GLController.java
@@ -37,9 +37,8 @@
 
 package org.mozilla.gecko.gfx;
 
-import android.util.Log;
 import android.view.SurfaceHolder;
-import android.view.SurfaceView;
+
 import javax.microedition.khronos.egl.EGL10;
 import javax.microedition.khronos.egl.EGL11;
 import javax.microedition.khronos.egl.EGLConfig;
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
index 43cf88d..a8276fa 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/GeckoSoftwareLayerClient.java
@@ -76,10 +76,9 @@ public class GeckoSoftwareLayerClient extends GeckoLayerClient {
         Log.i(LOGTAG, "Creating MultiTileLayer");
         if(mTileLayer == null) {
             mTileLayer = new MultiTileLayer(TILE_SIZE);
+            mLayerController.setRoot(mTileLayer);
         }
 
-        mLayerController.setRoot(mTileLayer);
-
         // Force a resize event to be sent because the results of this
         // are different depending on what tile system we're using
         sendResizeEventIfNecessary(true);
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/Layer.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/Layer.java
index b70c88e..cc689ed 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/Layer.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/Layer.java
@@ -69,8 +69,7 @@ public abstract class Layer {
      */
     public final boolean update(RenderContext context) {
         if (mTransactionLock.isHeldByCurrentThread()) {
-            throw new RuntimeException("draw() called while transaction lock held by this " +
-                    "thread?!");
+            throw new RuntimeException("draw() called while transaction lock held by this thread?!");
         }
 
         if (mTransactionLock.tryLock()) {
diff --git a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
index 8fb391a..ba7608f 100644
--- a/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
+++ b/android/experimental/LOAndroid3/src/java/org/mozilla/gecko/gfx/LayerRenderer.java
@@ -525,7 +525,9 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
             mLastPageContext = mPageContext;
 
             /* Update layers. */
-            if (rootLayer != null) mUpdated &= rootLayer.update(mPageContext);
+            if (rootLayer != null) {
+                mUpdated &= rootLayer.update(mPageContext);
+            }
             mUpdated &= mBackgroundLayer.update(mScreenContext);
             mUpdated &= mShadowLayer.update(mPageContext);
             updateCheckerboardLayer(mScreenContext);
@@ -533,14 +535,16 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
             mUpdated &= mVertScrollLayer.update(mPageContext);
             mUpdated &= mHorizScrollLayer.update(mPageContext);
 
-            for (Layer layer : mExtraLayers)
+            for (Layer layer : mExtraLayers) {
                 mUpdated &= layer.update(mPageContext);
+            }
 
             GLES20.glDisable(GLES20.GL_SCISSOR_TEST);
 
             // If a layer update requires further work, schedule another redraw
-            if (!mUpdated)
+            if (!mUpdated) {
                 mView.requestRender();
+            }
 
             PanningPerfAPI.recordFrameTime();
 
@@ -565,8 +569,9 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
             Rect pageRect = getPageRect();
             RectF untransformedPageRect = new RectF(0.0f, 0.0f, pageRect.width(),
                     pageRect.height());
-            if (!untransformedPageRect.contains(mView.getController().getViewport()))
+            if (!untransformedPageRect.contains(mView.getController().getViewport())) {
                 mShadowLayer.draw(mPageContext);
+            }
 
             /* Draw the checkerboard. */
             setScissorRect();
@@ -591,22 +596,24 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
             LayerController controller = mView.getController();
 
             /* Draw any extra layers that were added (likely plugins) */
-            for (Layer layer : mExtraLayers)
+            for (Layer layer : mExtraLayers) {
                 layer.draw(mPageContext);
+            }
 
             /* Draw the vertical scrollbar. */
             IntSize screenSize = new IntSize(controller.getViewportSize());
-            if (pageRect.height() > screenSize.height)
+            if (pageRect.height() > screenSize.height) {
                 mVertScrollLayer.draw(mPageContext);
+            }
 
             /* Draw the horizontal scrollbar. */
-            if (pageRect.width() > screenSize.width)
+            if (pageRect.width() > screenSize.width) {
                 mHorizScrollLayer.draw(mPageContext);
+            }
 
             /* Measure how much of the screen is checkerboarding */
             Layer rootLayer = controller.getRoot();
-            if ((rootLayer != null) &&
-                    (mProfileRender || PanningPerfAPI.isRecordingCheckerboard())) {
+            if (rootLayer != null && (mProfileRender || PanningPerfAPI.isRecordingCheckerboard())) {
                 // Find out how much of the viewport area is valid
                 Rect viewport = RectUtils.round(mPageContext.viewport);
                 Region validRegion = rootLayer.getValidRegion(mPageContext);
@@ -622,10 +629,10 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
                     //     source, but is not mentioned in the Android documentation,
                     //     and so is liable to change.
                     //     If it does change, this code will need to be reevaluated.
-                    Rect r = new Rect();
+                    Rect rect = new Rect();
                     int checkerboardArea = 0;
-                    for (RegionIterator i = new RegionIterator(validRegion); i.next(r);) {
-                        checkerboardArea += r.width() * r.height();
+                    for (RegionIterator i = new RegionIterator(validRegion); i.next(rect);) {
+                        checkerboardArea += rect.width() * rect.height();
                     }
 
                     checkerboard = checkerboardArea / (float)screenArea;
@@ -658,8 +665,9 @@ public class LayerRenderer implements GLSurfaceView.Renderer {
 
         public void endDrawing() {
             // If a layer update requires further work, schedule another redraw
-            if (!mUpdated)
+            if (!mUpdated) {
                 mView.requestRender();
+            }
 
             PanningPerfAPI.recordFrameTime();
 
commit 28515edda26b7ad0aeb7748d61189492a606a955
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Tue Jul 22 16:12:36 2014 +0200

    LOAndroid3: change MockTileProvider to accept filename
    
    Change-Id: I48a4739d67c2951ddb7966f0ad10e2f4fd2a76ca

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java
index d3b8664..1515d9c 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/MockTileProvider.java
@@ -8,11 +8,13 @@ import org.mozilla.gecko.gfx.LayerController;
 import org.mozilla.gecko.gfx.SubTile;
 
 public class MockTileProvider implements TileProvider {
-    private final LayerController layerController;
     private static final int TILE_SIZE = 256;
+    private final LayerController layerController;
+    private final String inputFile;
 
-    public MockTileProvider(LayerController layerController) {
+    public MockTileProvider(LayerController layerController, String inputFile) {
         this.layerController = layerController;
+        this.inputFile = inputFile;
     }
 
     @Override
commit 1d3ea0e7535cf1b1213767a549be02b9a624759d
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Tue Jul 22 16:09:01 2014 +0200

    LOAndroid3: use LinkedBlockingQueue - block until there are event
    
    Change-Id: Ia375c28d5adde5a6b2927e9b46105cfccd0b0f10

diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
index 456f7b7..c418b4c 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitThread.java
@@ -9,13 +9,13 @@ import org.mozilla.gecko.gfx.SubTile;
 import org.mozilla.gecko.gfx.ViewportMetrics;
 
 import java.util.ArrayList;
-import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.LinkedBlockingQueue;
 
 public class LOKitThread extends Thread {
     private static final String LOGTAG = LOKitThread.class.getSimpleName();
 
     private static final int TILE_SIZE = 256;
-    public ConcurrentLinkedQueue<LOEvent> mEvents = new ConcurrentLinkedQueue<LOEvent>();
+    public LinkedBlockingQueue<LOEvent> mEventQueue = new LinkedBlockingQueue<LOEvent>();
     private LibreOfficeMainActivity mApplication;
     private TileProvider mTileProvider;
     private ViewportMetrics mViewportMetrics;
@@ -97,10 +97,7 @@ public class LOKitThread extends Thread {
             try {
                 boolean drawn = false;
                 while (true) {
-                    if (!mEvents.isEmpty()) {
-                        processEvent(mEvents.poll());
-                    }
-                    Thread.sleep(100L);
+                    processEvent(mEventQueue.take());
                 }
             } catch (InterruptedException ex) {
             }
@@ -123,6 +120,6 @@ public class LOKitThread extends Thread {
 
     public void queueEvent(LOEvent event) {
         Log.i(LOGTAG, "Event: " + event.getTypeString());
-        mEvents.add(event);
+        mEventQueue.add(event);
     }
 }


More information about the Libreoffice-commits mailing list