| 1 |
# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- |
| 2 |
# |
| 3 |
# This file is part of the LibreOffice project. |
| 4 |
# |
| 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/. |
| 8 |
# |
| 9 |
from uitest.framework import UITestCase |
| 10 |
from libreoffice.uno.propertyvalue import mkPropertyValues |
| 11 |
from uitest.uihelper.calc import enter_text_to_cell |
| 12 |
|
| 13 |
class tdf164299(UITestCase): |
| 14 |
def test_tdf164299(self): |
| 15 |
with self.ui_test.create_doc_in_start_center("calc"): |
| 16 |
|
| 17 |
xCalcDoc = self.xUITest.getTopFocusWindow() |
| 18 |
gridwin = xCalcDoc.getChild("grid_window") |
| 19 |
|
| 20 |
enter_text_to_cell(gridwin, "A1", "Test 1") |
| 21 |
enter_text_to_cell(gridwin, "A2", "Test 2") |
| 22 |
enter_text_to_cell(gridwin, "A3", "Test 3") |
| 23 |
enter_text_to_cell(gridwin, "A4", "Test 4") |
| 24 |
|
| 25 |
gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"})) |
| 26 |
|
| 27 |
self.xUITest.executeCommand(".uno:Copy") |
| 28 |
|
| 29 |
with self.ui_test.load_empty_file("impress") as document: |
| 30 |
|
| 31 |
# Paste as HTML |
| 32 |
# Without the fix in place, this test would have crashed here |
| 33 |
formatProperty = mkPropertyValues({"SelectedFormat": 51}) |
| 34 |
self.xUITest.executeCommandWithParameters(".uno:ClipboardFormatItems", formatProperty) |
| 35 |
|
| 36 |
xDrawPage = document.getDrawPages()[0] |
| 37 |
self.assertEqual(3, len(xDrawPage)) |
| 38 |
xShape = xDrawPage[2] |
| 39 |
self.assertEqual(1000, xShape.getSize().Width) |
| 40 |
self.assertEqual(3697, xShape.getSize().Height) |
| 41 |
|
| 42 |
# vim: set shiftwidth=4 softtabstop=4 expandtab: |