Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / qa / uitest / hide_cols / tdf95306.py
blob63f976849ee35b397754ea0f95c535ff6fd4d1c3
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 from libreoffice.uno.propertyvalue import mkPropertyValues
10 from uitest.framework import UITestCase
11 from libreoffice.calc.document import get_column
13 import time
15 def get_column_hidden(doc, index):
16 column = get_column(doc, index)
17 val = column.getPropertyValue("IsVisible")
18 return not val
20 class HideDisjointColumns(UITestCase):
22 def test_hide_columns(self):
23 self.ui_test.create_doc_in_start_center("calc")
24 xTopWindow = self.xUITest.getTopFocusWindow()
26 gridwin = xTopWindow.getChild("grid_window")
27 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
28 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1", "EXTEND":"true"}))
30 doc = self.ui_test.get_component()
31 self.assertFalse(get_column_hidden(doc, 1))
32 self.assertFalse(get_column_hidden(doc, 3))
33 self.ui_test._xUITest.executeCommand(".uno:HideColumn")
34 self.assertTrue(get_column_hidden(doc, 1))
35 self.assertTrue(get_column_hidden(doc, 3))
36 self.ui_test._xUITest.executeCommand(".uno:Undo")
37 self.assertFalse(get_column_hidden(doc, 1))
38 self.assertFalse(get_column_hidden(doc, 3))
40 self.ui_test.close_doc()
42 # vim: set shiftwidth=4 softtabstop=4 expandtab: