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 libreoffice
.uno
.propertyvalue
import mkPropertyValues
12 from uitest
.uihelper
.common
import get_state_as_dict
, get_url_for_data_file
14 #Bug 122449 - Crash in: mergedlo.dll when closing "Edit Index Entry" dialog (gen/gtk)
16 class tdf122449(UITestCase
):
18 def test_tdf122449_crash_edit_index_entry(self
):
19 with self
.ui_test
.load_file(get_url_for_data_file("tdf122449.odt")):
20 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
21 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
22 #search word Autocorrect (second find) .uno:SearchDialog
23 with self
.ui_test
.execute_modeless_dialog_through_command(".uno:SearchDialog", close_button
="close") as xDialog
:
25 searchterm
= xDialog
.getChild("searchterm")
26 searchterm
.executeAction("TYPE", mkPropertyValues({"TEXT":"Autocorrection"}))
27 xsearch
= xDialog
.getChild("search")
28 xsearch
.executeAction("CLICK", tuple()) #first search
29 xsearch
.executeAction("CLICK", tuple()) #2nd search
30 self
.assertEqual(get_state_as_dict(xWriterEdit
)["CurrentPage"], "6")
31 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "HOME"}))
32 # invoke Index dialog Index entry .uno:IndexEntryDialog
33 with self
.ui_test
.execute_dialog_through_command(".uno:IndexEntryDialog", close_button
="close"):
37 with self
.ui_test
.execute_dialog_through_command(".uno:GotoPage") as xDialog
:
38 xPageText
= xDialog
.getChild("page")
39 xPageText
.executeAction("TYPE", mkPropertyValues({"TEXT":"2"}))
41 self
.assertEqual(get_state_as_dict(xWriterEdit
)["CurrentPage"], "2")
43 # vim: set shiftwidth=4 softtabstop=4 expandtab: