diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-09-30 17:09:25 +0200 |
---|---|---|
committer | Tomaž Vajngerl <tomaz.vajngerl@collabora.com> | 2014-10-04 17:42:10 +0200 |
commit | 520a4fdfe4b8f631c8c66eb6d65c5ac332503355 (patch) | |
tree | f718b3fb7d99dd2dc81dd0ea31fdcb8e0b86a8cb /android | |
parent | 005b8d429c3eac0294d49c5757714575357faae7 (diff) |
android: better default part name (document type dependent)
Change-Id: I7ea1f1f5c249a4df250bde049cc52b4f392e4d38
Diffstat (limited to 'android')
-rw-r--r-- | android/Bootstrap/src/org/libreoffice/kit/Document.java | 6 | ||||
-rw-r--r-- | android/experimental/LOAndroid3/src/java/org/libreoffice/LOKitTileProvider.java | 17 |
2 files changed, 22 insertions, 1 deletions
diff --git a/android/Bootstrap/src/org/libreoffice/kit/Document.java b/android/Bootstrap/src/org/libreoffice/kit/Document.java index d8d5286d02a6..52b9bfdc2674 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 44d438deedc8..7919a554f1fb 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); |