Get the style color and number just once
[LibreOffice.git] / sw / qa / uitest / writer_tests6 / tdf126168.py
blobcea599f0ac21ee4982cf83c232269e29ab099383
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 #Bug 126168 - Crash in: rtl_uString_acquire: frame style undo redo
14 class tdf126168(UITestCase):
16 def test_tdf126168_frame_undo_redo_crash(self):
17 with self.ui_test.create_doc_in_start_center("writer") as document:
19 #2) Menu > Insert > Frame > Frame
20 #3) Press OK in Frame dialog
21 with self.ui_test.execute_dialog_through_command(".uno:InsertFrame"):
22 pass
23 self.assertEqual(len(document.TextFrames), 1)
24 #New Style from Selection [uno:StyleNewByExample]
25 with self.ui_test.execute_dialog_through_command(".uno:StyleNewByExample") as xDialog:
26 #5) Enter a name in the Create Style dialog and press OK
27 stylename = xDialog.getChild("stylename")
28 stylename.executeAction("TYPE", mkPropertyValues({"TEXT":"a"}))
29 #6) ctrl+z 3 times
30 self.xUITest.executeCommand(".uno:Undo")
31 self.xUITest.executeCommand(".uno:Undo")
32 self.xUITest.executeCommand(".uno:Undo")
33 self.assertEqual(len(document.TextFrames), 0)
34 #7) shift+ctrl+z 3 times
35 self.xUITest.executeCommand(".uno:Redo")
36 self.xUITest.executeCommand(".uno:Redo")
37 self.xUITest.executeCommand(".uno:Redo")
39 #Results: crash
40 self.assertEqual(document.CurrentController.PageCount, 1)
42 # vim: set shiftwidth=4 softtabstop=4 expandtab: