summaryrefslogtreecommitdiff
path: root/android
diff options
context:
space:
mode:
authorTor Lillqvist <tlillqvist@suse.com>2012-04-18 16:53:54 +0300
committerTor Lillqvist <tlillqvist@suse.com>2012-04-20 00:57:23 +0300
commit409f117e1c849883f8490e82f4a2323a9dc8ad75 (patch)
treec0d7651e3953d92e5805c1a21975cfde84b39b06 /android
parent2bf32c53740313afe473056e55a953b23433e25d (diff)
Enable loading of several documents, and do that then
Diffstat (limited to 'android')
-rw-r--r--android/experimental/DocumentLoader/Makefile8
-rw-r--r--android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java39
2 files changed, 28 insertions, 19 deletions
diff --git a/android/experimental/DocumentLoader/Makefile b/android/experimental/DocumentLoader/Makefile
index 5dea15a9f929..2a6710975a0f 100644
--- a/android/experimental/DocumentLoader/Makefile
+++ b/android/experimental/DocumentLoader/Makefile
@@ -155,7 +155,11 @@ copy-stuff:
for F in xml/services xml/ure/services; do \
sed -e 's!uri="vnd.sun.star.expand:$$LO_LIB_DIR/!uri="file://$(APP_DATA_PATH)/lib/!g' <$(OUTDIR)/$$F.rdb >assets/$$F.rdb; \
done
- cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt assets
+ cp $(SRC_ROOT)/odk/examples/java/DocumentHandling/test/test1.odt \
+ $(SRC_ROOT)/sc/qa/unit/data/xls/border.xls \
+ $(SRC_ROOT)/sw/qa/core/data/odt/test.odt \
+ $(SRC_ROOT)/sw/qa/core/data/doc/testVba.doc \
+ assets
cp $(WORKDIR)/ComponentTarget/i18npool/util/i18npool.component assets/ComponentTarget/i18npool/util
#
mkdir -p assets/ure/share/misc assets/share/registry/res assets/share/config/soffice.cfg
@@ -259,7 +263,7 @@ uninstall:
$(ANDROID_SDK_HOME)/platform-tools/adb uninstall $(APP_PACKAGE)
run:
- adb shell am start -n org.libreoffice.android.examples/.DocumentLoader -e input /assets/test1.odt
+ adb shell am start -n org.libreoffice.android.examples/.DocumentLoader -e input /assets/test1.odt:/assets/border.xls:/assets/test.odt:/assets/testVba.doc
clean:
$(ANT) clean
diff --git a/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java b/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
index 76b545ff0c9a..409a95c7a0a1 100644
--- a/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
+++ b/android/experimental/DocumentLoader/src/org/libreoffice/android/examples/DocumentLoader.java
@@ -77,7 +77,7 @@ public class DocumentLoader
if (input == null)
input = "/assets/test1.odt";
- // We need to fake up abn argv, and the argv[0] even needs to
+ // We need to fake up an argv, and the argv[0] even needs to
// point to some file name that we can pretend is the "program".
// setCommandArgs() will prefix argv[0] with the app's data
// directory.
@@ -102,22 +102,27 @@ public class DocumentLoader
Log.i(TAG, "xCompLoader is" + (xCompLoader!=null ? " not" : "") + " null");
- // Loading the wanted document
- com.sun.star.beans.PropertyValue propertyValues[] =
- new com.sun.star.beans.PropertyValue[2];
- propertyValues[0] = new com.sun.star.beans.PropertyValue();
- propertyValues[0].Name = "Hidden";
- propertyValues[0].Value = new Boolean(true);
- propertyValues[1] = new com.sun.star.beans.PropertyValue();
- propertyValues[1].Name = "ReadOnly";
- propertyValues[1].Value = new Boolean(true);
-
- String sUrl = "file://" + input;
-
- Object oDoc =
- xCompLoader.loadComponentFromURL
- (sUrl, "_blank", 0, propertyValues);
- Log.i(TAG, "oDoc is " + (oDoc!=null ? oDoc.toString() : "null"));
+ // Load the wanted document(s)
+ String[] inputs = input.split(":");
+ for (int i = 0; i < inputs.length; i++) {
+ com.sun.star.beans.PropertyValue propertyValues[] =
+ new com.sun.star.beans.PropertyValue[2];
+ propertyValues[0] = new com.sun.star.beans.PropertyValue();
+ propertyValues[0].Name = "Hidden";
+ propertyValues[0].Value = new Boolean(true);
+ propertyValues[1] = new com.sun.star.beans.PropertyValue();
+ propertyValues[1].Name = "ReadOnly";
+ propertyValues[1].Value = new Boolean(true);
+
+ String sUrl = "file://" + inputs[i];
+
+ Log.i(TAG, "Attempting to load " + sUrl);
+
+ Object oDoc =
+ xCompLoader.loadComponentFromURL
+ (sUrl, "_blank", 0, propertyValues);
+ Log.i(TAG, "oDoc is " + (oDoc!=null ? oDoc.toString() : "null"));
+ }
}
catch (Exception e) {
e.printStackTrace(System.err);