1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
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/.
10 from uitest
.framework
import UITestCase
11 from uitest
.uihelper
.common
import get_state_as_dict
12 from uitest
.uihelper
.common
import select_pos
14 class tdf115572(UITestCase
):
16 def insertTextIntoCell(self
, table
, cellName
, text
):
17 tableText
= table
.getCellByName( cellName
)
18 tableText
.setString( text
)
20 def test_tdf115572_table_format_gets_reset_deleting_row(self
):
21 with self
.ui_test
.create_doc_in_start_center("writer") as document
:
23 with self
.ui_test
.execute_dialog_through_command(".uno:InsertTable"):
25 #select font format - Bold and write text "abc"
26 self
.xUITest
.executeCommand(".uno:Bold")
27 tables
= document
.getTextTables()
28 self
.insertTextIntoCell(tables
[0], "A1", "abc" )
29 #go to second row - arrow down
30 self
.xUITest
.executeCommand(".uno:GoDown")
32 self
.xUITest
.executeCommand(".uno:DeleteRows")
33 #now the cursor is in the second column - go left
34 self
.xUITest
.executeCommand(".uno:GoLeft")
35 self
.xUITest
.executeCommand(".uno:GoLeft")
36 #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
37 with self
.ui_test
.execute_dialog_through_command(".uno:FontDialog", close_button
="cancel") as xDialog
:
38 xTabs
= xDialog
.getChild("tabcontrol")
39 select_pos(xTabs
, "0")
40 xweststylelbcjk
= xDialog
.getChild("cbWestStyle")
41 self
.assertEqual(get_state_as_dict(xweststylelbcjk
)["Text"], "Bold")
44 def test_tdf115572_table_format_gets_reset_deleting_column(self
):
45 with self
.ui_test
.create_doc_in_start_center("writer") as document
:
47 with self
.ui_test
.execute_dialog_through_command(".uno:InsertTable"):
49 #select font format - Bold and write text "abc"
50 self
.xUITest
.executeCommand(".uno:Bold")
51 tables
= document
.getTextTables()
52 self
.insertTextIntoCell(tables
[0], "A1", "abc" )
54 self
.xUITest
.executeCommand(".uno:GoRight")
56 self
.xUITest
.executeCommand(".uno:DeleteColumns")
57 #check the format of the text (should be still bold) Format-Character-Font-Style-Bold
58 with self
.ui_test
.execute_dialog_through_command(".uno:FontDialog", close_button
="cancel") as xDialog
:
59 xTabs
= xDialog
.getChild("tabcontrol")
60 select_pos(xTabs
, "0")
61 xweststylelbcjk
= xDialog
.getChild("cbWestStyle")
62 self
.assertEqual(get_state_as_dict(xweststylelbcjk
)["Text"], "Bold")
64 # vim: set shiftwidth=4 softtabstop=4 expandtab: