From 267c6f2ac71f92999e969232431ba04678e7437e Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Mon, 15 Apr 2024 07:54:39 +0200 Subject: Adding upstream version 4:24.2.0. Signed-off-by: Daniel Baumann --- sc/qa/uitest/textToColumns/tdf85979.py | 49 ++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 sc/qa/uitest/textToColumns/tdf85979.py (limited to 'sc/qa/uitest/textToColumns/tdf85979.py') diff --git a/sc/qa/uitest/textToColumns/tdf85979.py b/sc/qa/uitest/textToColumns/tdf85979.py new file mode 100644 index 0000000000..ca5808947e --- /dev/null +++ b/sc/qa/uitest/textToColumns/tdf85979.py @@ -0,0 +1,49 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. +# +from uitest.framework import UITestCase +from uitest.uihelper.common import get_state_as_dict, get_url_for_data_file +from libreoffice.calc.document import get_cell_by_position +from libreoffice.uno.propertyvalue import mkPropertyValues + +#Bug 85979 - Crash: data text to columns + +class tdf85979(UITestCase): + def test_td85979_text_to_columns(self): + with self.ui_test.load_file(get_url_for_data_file("tdf85979.ods")) as calc_doc: + xCalcDoc = self.xUITest.getTopFocusWindow() + gridwin = xCalcDoc.getChild("grid_window") + + #(I selected C1 to C5, then Text to Columns, unselected "Tab" and selected "Space") + gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:C5"})) + # Data - Text to Columns + with self.ui_test.execute_dialog_through_command(".uno:TextToColumns") as xDialog: + xspace = xDialog.getChild("space") + if (get_state_as_dict(xspace)["Selected"]) == "false": + xspace.executeAction("CLICK", tuple()) + # Click Ok + + #Verify + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 0).getValue(), 99) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getValue(), 4) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getValue(), 9) + self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getValue(), 9) + self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 0).getValue(), 260) + self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 1).getValue(), 10) + self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getValue(), 23) + self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getValue(), 23) + self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 0).getValue(), 149) + self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getValue(), 6) + self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 2).getValue(), 14) + self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getValue(), 14) + self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 0).getValue(), 0) + self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getValue(), 16) + self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getValue(), 35) + self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 3).getValue(), 35) + +# vim: set shiftwidth=4 softtabstop=4 expandtab: -- cgit v1.2.3