summaryrefslogtreecommitdiff
path: root/unotest
diff options
context:
space:
mode:
Diffstat (limited to 'unotest')
-rw-r--r--unotest/source/python/org/libreoffice/unotest.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/unotest/source/python/org/libreoffice/unotest.py b/unotest/source/python/org/libreoffice/unotest.py
index eb13d374e83c..ab3cd8a4919d 100644
--- a/unotest/source/python/org/libreoffice/unotest.py
+++ b/unotest/source/python/org/libreoffice/unotest.py
@@ -186,6 +186,20 @@ class UnoInProcess:
assert(self.xDoc)
return self.xDoc
+ def openEmptyCalcDoc(self):
+ self.xDoc = self.openEmptyDoc("private:factory/scalc")
+ return self.xDoc
+
+ def openEmptyDoc(self, url, bHidden = True, bReadOnly = False):
+ assert(self.xContext)
+ smgr = self.getContext().ServiceManager
+ desktop = smgr.createInstanceWithContext("com.sun.star.frame.Desktop", self.getContext())
+ props = [("Hidden", bHidden), ("ReadOnly", bReadOnly)]
+ loadProps = tuple([mkPropertyValue(name, value) for (name, value) in props])
+ self.xDoc = desktop.loadComponentFromURL(url, "_blank", 0, loadProps)
+ assert(self.xDoc)
+ return self.xDoc
+
def openWriterTemplateDoc(self, file):
assert(self.xContext)
smgr = self.getContext().ServiceManager