2 This is file is part of the LibreOffice project.
4 This Source Code Form is subject to the terms of the Mozilla Public
5 License, v. 2.0. If a copy of the MPL was not distributed with this
6 file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 This file incorporates work covered by the following license notice:
10 Licensed to the Apache Software Foundation (ASF) under one or more
11 contributor license agreements. See the NOTICE file distributed
12 with this work for additional information regarding copyright
13 ownership. The ASF licenses this file to you under the Apache
14 License, Version 2.0 (the "License"); you may not use this file
15 except in compliance with the License. You may obtain a copy of
16 the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 from org
.libreoffice
.unotest
import UnoInProcess
21 from com
.sun
.star
.text
.WritingMode2
import RL_TB
as __WritingMode2_RL_TB__
22 from com
.sun
.star
.text
.WritingMode2
import LR_TB
as __WritingMode2_LR_TB__
24 class CalcRTL(unittest
.TestCase
):
29 cls
._uno
= UnoInProcess()
33 def tearDownClass(cls
):
36 def testSpreadsheetProperties(self
):
37 self
.assertTrue(self
.openSpreadsheetDocument(), msg
="Couldn't open document")
39 set= self
.getSpreadsheet()
40 # Make sure there are at least 2 sheets, otherwise hiding a sheet won't work
41 self
.xSheetDoc
.getSheets().insertNewByName("Some Sheet", 0)
43 self
._uno
.checkProperties(set,{'IsVisible': False}, self
)
44 self
._uno
.checkProperties(set,{'IsVisible': True}, self
)
45 self
._uno
.checkProperties(set,{'PageStyle': 'Report'}, self
)
46 self
._uno
.checkProperties(set,{'PageStyle': 'Default'}, self
)
47 self
._uno
.checkProperties(set,{'TableLayout': __WritingMode2_RL_TB__
}, self
)
48 self
._uno
.checkProperties(set,{'TableLayout': __WritingMode2_LR_TB__
}, self
)
50 self
.assertTrue(self
.closeSpreadsheetDocument(), msg
="Couldn't close document")
52 def openSpreadsheetDocument(self
):
54 print("creating a sheetdocument")
56 self
.xSheetDoc
= self
._uno
.openEmptyCalcDoc()
62 def closeSpreadsheetDocument(self
):
64 print(" disposing xSheetDoc ")
66 self
.xSheetDoc
.close(0)
72 def getSpreadsheet(self
):
73 return self
.xSheetDoc
.getSheets()[0]
75 if __name__
== '__main__':