[Libreoffice-commits] core.git: Branch 'feature/droid_calcimpress2' - android/Bootstrap android/experimental

Tomaž Vajngerl tomaz.vajngerl at collabora.com
Tue Sep 30 08:13:48 PDT 2014


 android/Bootstrap/src/org/libreoffice/kit/Document.java                         |    6 +++
 android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java |   17 +++++++++-
 2 files changed, 22 insertions(+), 1 deletion(-)

New commits:
commit c2c976c802a8630a54931153b257eec058c81300
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.com>
Date:   Tue Sep 30 17:09:25 2014 +0200

    android: better default part name (document type dependent)
    
    Change-Id: I7ea1f1f5c249a4df250bde049cc52b4f392e4d38

diff --git a/android/Bootstrap/src/org/libreoffice/kit/Document.java b/android/Bootstrap/src/org/libreoffice/kit/Document.java
index d8d5286..52b9bfd 100644
--- a/android/Bootstrap/src/org/libreoffice/kit/Document.java
+++ b/android/Bootstrap/src/org/libreoffice/kit/Document.java
@@ -18,6 +18,12 @@ public class Document {
     public static final int PART_MODE_SLIDENOTES = 3;
     public static final int PART_MODE_EMBEDDEDOBJ = 4;
 
+    public static final int DOCTYPE_TEXT = 0;
+    public static final int DOCTYPE_SPREADSHEET = 1;
+    public static final int DOCTYPE_PRESENTATION = 2;
+    public static final int DOCTYPE_DRAWING = 3;
+    public static final int DOCTYPE_OTHER = 4;
+
     private final long handle;
 
     public Document(long handle) {
diff --git a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
index 44d438d..7919a55 100644
--- a/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
+++ b/android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java
@@ -49,7 +49,22 @@ public class LOKitTileProvider implements TileProvider {
             for (int i = 0; i < parts; i++) {
                 String partName = mDocument.getPartName(i);
                 if (partName.isEmpty()) {
-                    partName = "Part " + (i + 1);
+                    switch (mDocument.getDocumentType()) {
+                        case Document.DOCTYPE_DRAWING:
+                        case Document.DOCTYPE_TEXT:
+                            partName = "Page " + (i + 1);
+                            break;
+                        case Document.DOCTYPE_SPREADSHEET:
+                            partName = "Sheet " + (i + 1);
+                            break;
+                        case Document.DOCTYPE_PRESENTATION:
+                            partName = "Slide " + (i + 1);
+                            break;
+                        case Document.DOCTYPE_OTHER:
+                        default:
+                            partName = "Part " + (i + 1);
+                            break;
+                    }
                 }
                 Log.i(LOGTAG, "Document part " + i + " name:'" + partName + "'");
                 final DocumentPartView partView = new DocumentPartView(i, partName);


More information about the Libreoffice-commits mailing list