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 uitest
.uihelper
.calc
import enter_text_to_cell
11 from uitest
.uihelper
.common
import get_state_as_dict
13 from libreoffice
.calc
.document
import get_cell_by_position
14 from libreoffice
.uno
.propertyvalue
import mkPropertyValues
17 # Bug 54197 - Calc single cell filling (Ctrl+D) does not change data at input line
18 class tdf54197(UITestCase
):
20 def test_tdf54197_CTRL_D_input_line_change(self
):
21 with self
.ui_test
.create_doc_in_start_center("calc") as document
:
22 xCalcDoc
= self
.xUITest
.getTopFocusWindow()
23 gridwin
= xCalcDoc
.getChild("grid_window")
24 # 1. go to cell A1 enter any text
25 enter_text_to_cell(gridwin
, "A1", "t")
26 # 2. go to cell A2 press Ctrl+D
27 gridwin
.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
28 self
.xUITest
.executeCommand(".uno:FillDown")
29 # The same text as above is displayed at cell A2, BUT input line is still blank
30 self
.assertEqual(get_cell_by_position(document
, 0, 0, 0).getString(), "t")
31 self
.assertEqual(get_cell_by_position(document
, 0, 0, 1).getString(), "t")
32 xToolkit
= self
.xContext
.ServiceManager
.createInstance('com.sun.star.awt.Toolkit')
33 xToolkit
.processEventsToIdle()
34 xInputWin
= xCalcDoc
.getChild("sc_input_window")
35 self
.assertEqual(get_state_as_dict(xInputWin
)["Text"], "t")
38 # vim: set shiftwidth=4 softtabstop=4 expandtab: