3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
12 from org
.libreoffice
.unotest
import pyuno
13 from com
.sun
.star
.beans
import PropertyValue
15 testEnvironmentInitialized
= False
17 class CollectionsTestBase(unittest
.TestCase
):
21 cls
.context
= pyuno
.getComponentContext()
22 global testEnvironmentInitialized
23 if not testEnvironmentInitialized
:
24 pyuno
.private_initTestEnvironment()
25 testEnvironmentInitialized
= True
31 for component
in self
._components
:
37 def createHiddenWindow(self
, url
):
38 service_manager
= self
.context
.ServiceManager
39 desktop
= service_manager
.createInstanceWithContext('com.sun.star.frame.Desktop', self
.context
)
41 PropertyValue(Name
='Hidden', Value
=True),
42 PropertyValue(Name
='ReadOnly', Value
=False)
44 component
= desktop
.loadComponentFromURL(url
, '_blank', 0, load_props
)
47 def createBlankTextDocument(self
):
48 component
= self
.createHiddenWindow('private:factory/swriter')
49 self
._components
.append(component
)
52 def createBlankSpreadsheet(self
):
53 component
= self
.createHiddenWindow('private:factory/scalc')
54 self
._components
.append(component
)
57 def createBlankDrawing(self
):
58 component
= self
.createHiddenWindow('private:factory/sdraw')
59 self
._components
.append(component
)
62 # vim:set shiftwidth=4 softtabstop=4 expandtab: