Kaydet (Commit) 409f117e authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Enable loading of several documents, and do that then

üst 2bf32c53
......@@ -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
......
......@@ -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);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment