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/.
13 from org
.libreoffice
.unotest
import pyuno
14 from com
.sun
.star
.beans
import PropertyValue
16 testEnvironmentInitialized
= False
18 class CollectionsTestBase(unittest
.TestCase
):
22 cls
.context
= pyuno
.getComponentContext()
23 global testEnvironmentInitialized
24 if not testEnvironmentInitialized
:
25 pyuno
.private_initTestEnvironment()
26 testEnvironmentInitialized
= True
32 for component
in self
._components
:
38 def createHiddenWindow(self
, url
):
39 service_manager
= self
.context
.ServiceManager
40 desktop
= service_manager
.createInstanceWithContext('com.sun.star.frame.Desktop', self
.context
)
42 PropertyValue(Name
='Hidden', Value
=True),
43 PropertyValue(Name
='ReadOnly', Value
=False)
45 component
= desktop
.loadComponentFromURL(url
, '_blank', 0, load_props
)
48 def createBlankTextDocument(self
):
49 component
= self
.createHiddenWindow('private:factory/swriter')
50 self
._components
.append(component
)
53 def createBlankSpreadsheet(self
):
54 component
= self
.createHiddenWindow('private:factory/scalc')
55 self
._components
.append(component
)
58 def createBlankDrawing(self
):
59 component
= self
.createHiddenWindow('private:factory/sdraw')
60 self
._components
.append(component
)
63 # vim:set shiftwidth=4 softtabstop=4 expandtab: