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
.calc
import enter_text_to_cell
16 class Tdf95554(UITestCase
):
18 def test_tdf95554(self
):
19 with self
.ui_test
.create_doc_in_start_center("calc"):
20 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
21 gridwin
= xCalcDoc
.getChild("grid_window")
23 enter_text_to_cell(gridwin
, "A1", "A")
24 enter_text_to_cell(gridwin
, "A2", "B")
25 enter_text_to_cell(gridwin
, "A3", "C")
26 enter_text_to_cell(gridwin
, "A4", "D")
27 enter_text_to_cell(gridwin
, "A5", "E")
28 enter_text_to_cell(gridwin
, "A6", "F")
30 gridwin
.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A1"}))
31 gridwin
.executeAction("SELECT", mkPropertyValues({"RANGE": "A3:A3", "EXTEND":"1"}))
32 gridwin
.executeAction("SELECT", mkPropertyValues({"RANGE": "A5:A5", "EXTEND":"1"}))
33 gridwin
.executeAction("SELECT", mkPropertyValues({"RANGE": "A6:A6", "EXTEND":"1"}))
34 self
.xUITest
.executeCommand(".uno:Copy")
36 with self
.ui_test
.load_empty_file("writer") as writer_document
:
38 self
.xUITest
.getTopFocusWindow()
39 self
.xUITest
.executeCommand(".uno:PasteUnformatted")
41 # Without the fix, the test breaks here with:
42 #AssertionError: 'A\n\nC\n\nE\nF' != 'A'
44 if platform
.system() == "Windows":
45 self
.assertEqual('A\r\n\r\nC\r\n\r\nE\r\nF',
46 writer_document
.Text
.String
)
48 self
.assertEqual('A\n\nC\n\nE\nF',
49 writer_document
.Text
.String
)
51 # vim: set shiftwidth=4 softtabstop=4 expandtab: