summaryrefslogtreecommitdiff
path: root/unotest
diff options
context:
space:
mode:
authorLionel Elie Mamane <lionel@mamane.lu>2015-02-01 15:55:17 +0100
committerLionel Elie Mamane <lionel@mamane.lu>2015-02-03 13:24:34 +0000
commit3e8c54916e10e046b55931d70eaa1a9473d608c1 (patch)
treea46a3ad836f3df1952ffe2a34d7874437e32a114 /unotest
parentfcba36b6b7efdf9222ccf9d330297b90cd04eb33 (diff)
copy test file to workdir to avoid overwriting
Change-Id: I2acc5cd6a57bb6a18f3f20177b3bcf2b8469a834 Reviewed-on: https://gerrit.libreoffice.org/14272 Reviewed-by: Lionel Elie Mamane <lionel@mamane.lu> Tested-by: Lionel Elie Mamane <lionel@mamane.lu>
Diffstat (limited to 'unotest')
-rw-r--r--unotest/source/python/org/libreoffice/unotest.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/unotest/source/python/org/libreoffice/unotest.py b/unotest/source/python/org/libreoffice/unotest.py
index 4ae21c1f7ac8..0acf05afe617 100644
--- a/unotest/source/python/org/libreoffice/unotest.py
+++ b/unotest/source/python/org/libreoffice/unotest.py
@@ -218,6 +218,17 @@ class UnoInProcess:
assert(self.xDoc)
return self.xDoc
+ def openDoc(self, file):
+ assert(self.xContext)
+ smgr = self.getContext().ServiceManager
+ desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop", self.getContext())
+ props = [("Hidden", True), ("ReadOnly", False), ("AsTemplate", False)]
+ loadProps = tuple([mkPropertyValue(name, value) for (name, value) in props])
+ url = "file://" + file
+ self.xDoc = desktop.loadComponentFromURL(url, "_blank", 0, loadProps)
+ assert(self.xDoc)
+ return self.xDoc
+
def checkProperties(self, obj, dict, test):
for k,v in dict.items():
obj.setPropertyValue(k, v)