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/.
9 from uitest
.framework
import UITestCase
10 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
11 from uitest
.uihelper
.common
import get_state_as_dict
, get_url_for_data_file
13 #Bug 124675 - CRASH: after moving the content down and undoing
15 class tdf124675(UITestCase
):
16 def test_tdf124675_crash_moving_SwTextFrame_previous_page(self
):
17 with self
.ui_test
.load_file(get_url_for_data_file("tdf124675.docx")) as writer_doc
:
18 xWriterDoc
= self
.xUITest
.getTopFocusWindow()
19 xWriterEdit
= xWriterDoc
.getChild("writer_edit")
21 self
.assertEqual(writer_doc
.CurrentController
.PageCount
, 2)
22 self
.assertEqual(get_state_as_dict(xWriterEdit
)["CurrentPage"], "1")
25 xWriterEdit
.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"}))
27 self
.assertEqual(writer_doc
.CurrentController
.PageCount
, 4)
28 self
.assertEqual(get_state_as_dict(xWriterEdit
)["CurrentPage"], "3")
31 self
.xUITest
.executeCommand(".uno:Undo")
33 self
.assertEqual(writer_doc
.CurrentController
.PageCount
, 2)
34 self
.assertEqual(get_state_as_dict(xWriterEdit
)["CurrentPage"], "1")
36 # vim: set shiftwidth=4 softtabstop=4 expandtab: