Version 6.4.0.3, tag libreoffice-6.4.0.3
[LibreOffice.git] / sc / qa / uitest / calc_tests7 / tdf125030.py
blob5aaa81abca9a8a8629859edfee6681c6305e76d9
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/.
7 from uitest.framework import UITestCase
8 import os
9 from uitest.uihelper.common import get_state_as_dict
10 from uitest.debug import sleep
11 from libreoffice.uno.propertyvalue import mkPropertyValues
12 from libreoffice.calc.document import get_cell_by_position
13 from uitest.uihelper.calc import enter_text_to_cell
15 #Bug 125030 - nice crash by repeating apply style (Ctrl+Shft+Y)
17 class tdf125030(UITestCase):
18 def test_tdf125030_repeat_crash(self):
19 calc_doc = self.ui_test.create_doc_in_start_center("calc")
20 xCalcDoc = self.xUITest.getTopFocusWindow()
21 gridwin = xCalcDoc.getChild("grid_window")
22 document = self.ui_test.get_component()
23 #enter data
24 enter_text_to_cell(gridwin, "A1", "aaaa")
25 enter_text_to_cell(gridwin, "B1", "bbbb")
26 #select A1
27 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
28 self.xUITest.executeCommand(".uno:StyleApply?Style:string=Heading%201&FamilyName:string=CellStyles")
29 #focus on A2
30 gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
31 #repeat (Ctrl+Shft+Y)
32 self.xUITest.executeCommand(".uno:Repeat")
33 self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "aaaa")
35 self.ui_test.close_doc()
36 # vim: set shiftwidth=4 softtabstop=4 expandtab: