merge duplicate part of branches
[LibreOffice.git] / sw / qa / uitest / writer_tests5 / tdf147935.py
blobf1d8c399b5d9264b2eed331e92c2d15fa03d2b9e
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
14 class Tdf147935(UITestCase):
16 def test_tdf147935(self):
18 with self.ui_test.create_doc_in_start_center("calc"):
19 xCalcDoc = self.xUITest.getTopFocusWindow()
20 gridwin = xCalcDoc.getChild("grid_window")
21 #enter data
22 enter_text_to_cell(gridwin, "A1", "DDE")
24 #select A1
25 gridwin.executeAction("SELECT", mkPropertyValues({"Cell": "A1"}))
27 self.xUITest.executeCommand(".uno:Copy")
29 with self.ui_test.load_empty_file("writer") as writer_doc:
31 # Paste as DDE
32 formatProperty = mkPropertyValues({"SelectedFormat": 59})
33 self.xUITest.executeCommandWithParameters(".uno:ClipboardFormatItems", formatProperty)
35 # Without the fix in place, this test would have failed because the warning message
36 # "A table with no rows or no cells cannot be inserted" would have been displayed
38 self.assertEqual(1, len(writer_doc.TextTables))
39 table = writer_doc.getTextTables()[0]
40 self.assertEqual("DDE", table.getCellByName("A1").getString())
42 # vim: set shiftwidth=4 softtabstop=4 expandtab: