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
, type_text
12 from uitest
.uihelper
.common
import select_pos
14 #Bug 122722 - Hiding characters will crash. Crash in: SwAttrIter::CtorInitAttrIter(SwTextNode &,SwScriptInfo &,SwTextFrame const *)
16 class tdf122722(UITestCase
):
17 def test_tdf122722_format_character_hidden(self
):
18 with self
.ui_test
.create_doc_in_start_center("writer") as document
:
19 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
20 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
22 #2. Create New Writer Document
23 #3. Type "LibreOffice" in Writer
24 type_text(xWriterEdit
, "LibreOffice")
25 #4. Select "LibreOffice" with mouse, and right click
26 self
.xUITest
.executeCommand(".uno:SelectAll")
27 self
.assertEqual(document
.Text
.String
[0:11], "LibreOffice")
28 #5. Appear Context Menu, Character -> Character
29 #6. Opened Character, Select "Font Effect" tab
30 #7. Check Hidden, and click [OK]
31 #8. Crash a LibreOffice
32 with self
.ui_test
.execute_dialog_through_command(".uno:FontDialog") as xDialog
:
33 xTabs
= xDialog
.getChild("tabcontrol")
34 select_pos(xTabs
, "1")
36 xHidden
= xDialog
.getChild("hiddencb")
38 xHidden
.executeAction("CLICK", tuple())
41 with self
.ui_test
.execute_dialog_through_command(".uno:FontDialog") as xDialog
:
42 xTabs
= xDialog
.getChild("tabcontrol")
43 select_pos(xTabs
, "1")
45 xHidden
= xDialog
.getChild("hiddencb")
47 self
.assertEqual(get_state_as_dict(xHidden
)["Selected"], "true")
48 xHidden
.executeAction("CLICK", tuple())
51 self
.assertEqual(document
.Text
.String
[0:11], "LibreOffice")
53 # vim: set shiftwidth=4 softtabstop=4 expandtab: