summaryrefslogtreecommitdiffstats
path: root/sc/qa/uitest/textToColumns
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 05:54:39 +0000
commit267c6f2ac71f92999e969232431ba04678e7437e (patch)
tree358c9467650e1d0a1d7227a21dac2e3d08b622b2 /sc/qa/uitest/textToColumns
parentInitial commit. (diff)
downloadlibreoffice-267c6f2ac71f92999e969232431ba04678e7437e.tar.xz
libreoffice-267c6f2ac71f92999e969232431ba04678e7437e.zip
Adding upstream version 4:24.2.0.upstream/4%24.2.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sc/qa/uitest/textToColumns')
-rw-r--r--sc/qa/uitest/textToColumns/tdf143008.py41
-rw-r--r--sc/qa/uitest/textToColumns/tdf51700.py51
-rw-r--r--sc/qa/uitest/textToColumns/tdf69981.py67
-rw-r--r--sc/qa/uitest/textToColumns/tdf73006.py39
-rw-r--r--sc/qa/uitest/textToColumns/tdf82398.py59
-rw-r--r--sc/qa/uitest/textToColumns/tdf85403.py33
-rw-r--r--sc/qa/uitest/textToColumns/tdf85979.py49
-rw-r--r--sc/qa/uitest/textToColumns/tdf89907.py66
-rw-r--r--sc/qa/uitest/textToColumns/tdf92423.py55
-rw-r--r--sc/qa/uitest/textToColumns/textToColumns.py369
10 files changed, 829 insertions, 0 deletions
diff --git a/sc/qa/uitest/textToColumns/tdf143008.py b/sc/qa/uitest/textToColumns/tdf143008.py
new file mode 100644
index 0000000000..087a7b5a8f
--- /dev/null
+++ b/sc/qa/uitest/textToColumns/tdf143008.py
@@ -0,0 +1,41 @@
+# -*- 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.calc import enter_text_to_cell
+from uitest.uihelper.common import get_state_as_dict, select_by_text
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf143008(UITestCase):
+
+ def test_tdf143008(self):
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+ #fill data
+ enter_text_to_cell(gridwin, "A1", "22/06/2021 10:02 PM")
+
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns") as xDialog:
+ xGrid = xDialog.getChild("csvgrid")
+ xColumnType = xDialog.getChild("columntype")
+
+ # Use the right arrow to put the focus in the grid
+ xGrid.executeAction("TYPE", mkPropertyValues({"KEYCODE":"RIGHT"}))
+
+ self.assertEqual('true', get_state_as_dict(xColumnType)['Enabled'])
+
+ select_by_text(xColumnType, "Date (DMY)")
+
+ self.assertEqual('Date (DMY)', get_state_as_dict(xColumnType)['SelectEntryText'])
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: '06/22/21 10:02 PM' != '06/22/21 10:02 AM'
+ self.assertEqual("06/22/21 10:02 PM", get_cell_by_position(document, 0, 0, 0).getString())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/textToColumns/tdf51700.py b/sc/qa/uitest/textToColumns/tdf51700.py
new file mode 100644
index 0000000000..98c33d8f31
--- /dev/null
+++ b/sc/qa/uitest/textToColumns/tdf51700.py
@@ -0,0 +1,51 @@
+# -*- 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
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+#Bug 51700 - Text to columns puts result into first line if whole column is selected
+
+class tdf51700(UITestCase):
+ def test_tdf51700_text_to_columns(self):
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #Add data
+ enter_text_to_cell(gridwin, "A2", "3242,43242,3242,2342")
+ enter_text_to_cell(gridwin, "A3", "fdsfa,afsdfa,adfdas,fsad")
+ enter_text_to_cell(gridwin, "A4", "21312,1111,1111,111")
+ #select column A
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ # Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns") as xDialog:
+ xcomma = xDialog.getChild("comma")
+ if (get_state_as_dict(xcomma)["Selected"]) == "false":
+ xcomma.executeAction("CLICK", tuple())
+ # Click Ok
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "fdsfa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 21312)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 43242)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "afsdfa")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "adfdas")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 2342)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "fsad")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 111)
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/textToColumns/tdf69981.py b/sc/qa/uitest/textToColumns/tdf69981.py
new file mode 100644
index 0000000000..87c09e8ffc
--- /dev/null
+++ b/sc/qa/uitest/textToColumns/tdf69981.py
@@ -0,0 +1,67 @@
+# -*- 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
+
+class tdf69981(UITestCase):
+
+ def test_tdf69981_text_to_columns(self):
+
+ with self.ui_test.load_file(get_url_for_data_file("tdf69981.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #Select A2:A7
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A2:A7"}))
+ #Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns", close_button="") as xDialog:
+ xtab = xDialog.getChild("tab")
+ xcomma = xDialog.getChild("comma")
+ xtab.executeAction("CLICK", tuple())
+
+ if get_state_as_dict(xcomma)['Selected'] == 'false':
+ xcomma.executeAction("CLICK", tuple())
+
+ self.assertEqual('false', get_state_as_dict(xtab)['Selected'])
+ self.assertEqual('true', get_state_as_dict(xcomma)['Selected'])
+ #Click Ok
+ #overwrite warning come up
+ #press Ok.
+ xOK = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getString(), "Original")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getString(), "a")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 2).getString(), "")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 3).getString(), "")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 4).getString(), "a")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 5).getString(), "a")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 6).getString(), "a")
+
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getString(), "Copy")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getString(), "b")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getString(), "b")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 3).getString(), "")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 5).getString(), "b")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 6).getString(), "")
+
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 0).getString(), "")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getString(), "c")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getString(), "c")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getString(), "c")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 4).getString(), "")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 5).getString(), "")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 6).getString(), "c")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/textToColumns/tdf73006.py b/sc/qa/uitest/textToColumns/tdf73006.py
new file mode 100644
index 0000000000..1ac519f73c
--- /dev/null
+++ b/sc/qa/uitest/textToColumns/tdf73006.py
@@ -0,0 +1,39 @@
+# -*- 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
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+#Bug 73006 - EDITING: Results filled in wrong cells after Text to Columns
+
+class tdf73006(UITestCase):
+ def test_tdf73006_text_to_columns(self):
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #Add data
+ enter_text_to_cell(gridwin, "A2", "A B")
+ #select column A
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ # 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(document, 0, 0, 1).getString(), "A")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getString(), "B")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/textToColumns/tdf82398.py b/sc/qa/uitest/textToColumns/tdf82398.py
new file mode 100644
index 0000000000..b0722fcbd1
--- /dev/null
+++ b/sc/qa/uitest/textToColumns/tdf82398.py
@@ -0,0 +1,59 @@
+# -*- 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
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+#Bug 82398 - EDITING: "Text to Columns" not applied to selected cells after change 'Format Cells'
+
+class tdf82398(UITestCase):
+ def test_tdf82398_text_to_columns(self):
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #Add data
+ enter_text_to_cell(gridwin, "A1", "afasdfs.fdfasd.fsadf.fasd")
+ enter_text_to_cell(gridwin, "A2", "3242.43242.3242.2342")
+ enter_text_to_cell(gridwin, "A3", "fdsfa.afsdfa.adfdas.fsad")
+ enter_text_to_cell(gridwin, "A4", "21312.1111.1111.111")
+ #select column A1:A4 / .uno:NumberFormatDate
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A4"}))
+ self.xUITest.executeCommand(".uno:NumberFormatDate")
+ # Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns") as xDialog:
+ xother = xDialog.getChild("other")
+ xinputother = xDialog.getChild("inputother")
+
+ if (get_state_as_dict(xother)["Selected"]) == "false":
+ xother.executeAction("CLICK", tuple())
+ xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"."}))
+ # Click Ok
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "afasdfs")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "fdsfa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 21312)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "fdfasd")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 43242)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "afsdfa")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "fsadf")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "adfdas")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "fasd")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 2342)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "fsad")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 111)
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/textToColumns/tdf85403.py b/sc/qa/uitest/textToColumns/tdf85403.py
new file mode 100644
index 0000000000..771e9dc4bc
--- /dev/null
+++ b/sc/qa/uitest/textToColumns/tdf85403.py
@@ -0,0 +1,33 @@
+# -*- 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_url_for_data_file
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+#Bug 85403 - no broadcast after text to columns to convert text to numbers
+
+class tdf85403(UITestCase):
+ def test_tdf85403_text_to_columns(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf85403.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #'123 in A1, SUM(A1) in B1, result is 0 as expected,
+ #now select A1 and use data->text to columns->ok and B1 is not updated,
+ #putting a new SUM(A1) in C1 will show 123
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ # Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getValue(), 123)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
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:
diff --git a/sc/qa/uitest/textToColumns/tdf89907.py b/sc/qa/uitest/textToColumns/tdf89907.py
new file mode 100644
index 0000000000..ef5f164f92
--- /dev/null
+++ b/sc/qa/uitest/textToColumns/tdf89907.py
@@ -0,0 +1,66 @@
+# -*- 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
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.common import change_measurement_unit
+#Bug 89907 - Text to columns only affects first line when width is auto set
+
+class tdf89907(UITestCase):
+ def test_tdf89907_text_to_columns(self):
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+
+ with change_measurement_unit(self, "Centimeter"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #Add data
+ enter_text_to_cell(gridwin, "A1", "afasdfs.fdfasd.fsadf.fasd")
+ enter_text_to_cell(gridwin, "A2", "3242.43242.3242.2342")
+ enter_text_to_cell(gridwin, "A3", "fdsfa.afsdfa.adfdas.fsad")
+ enter_text_to_cell(gridwin, "A4", "21312.1111.1111.111")
+ #select column A
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectColumn")
+ #Optimal Width
+ with self.ui_test.execute_dialog_through_command(".uno:SetOptimalColumnWidth") as xDialog:
+ xvalue = xDialog.getChild("value")
+ self.assertEqual("0.20 cm", get_state_as_dict(xvalue)["Text"])
+
+ # Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns") as xDialog:
+ xother = xDialog.getChild("other")
+ xinputother = xDialog.getChild("inputother")
+ if (get_state_as_dict(xother)["Selected"]) == "false":
+ xother.executeAction("CLICK", tuple())
+ xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"."}))
+ # Click Ok
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 0).getString(), "afasdfs")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "fdsfa")
+ self.assertEqual(get_cell_by_position(document, 0, 0, 3).getValue(), 21312)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "fdfasd")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 1).getValue(), 43242)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 2).getString(), "afsdfa")
+ self.assertEqual(get_cell_by_position(document, 0, 1, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 0).getString(), "fsadf")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 1).getValue(), 3242)
+ self.assertEqual(get_cell_by_position(document, 0, 2, 2).getString(), "adfdas")
+ self.assertEqual(get_cell_by_position(document, 0, 2, 3).getValue(), 1111)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 0).getString(), "fasd")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 1).getValue(), 2342)
+ self.assertEqual(get_cell_by_position(document, 0, 3, 2).getString(), "fsad")
+ self.assertEqual(get_cell_by_position(document, 0, 3, 3).getValue(), 111)
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/textToColumns/tdf92423.py b/sc/qa/uitest/textToColumns/tdf92423.py
new file mode 100644
index 0000000000..99486bb2f0
--- /dev/null
+++ b/sc/qa/uitest/textToColumns/tdf92423.py
@@ -0,0 +1,55 @@
+# -*- 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
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+#Bug 92423 - EDITING Text to columns... does not respect currently selected cells
+
+class tdf92423(UITestCase):
+ def test_tdf92423_text_to_columns(self):
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #enter data
+ enter_text_to_cell(gridwin, "A1", "1;2")
+ enter_text_to_cell(gridwin, "A2", "2;3")
+ enter_text_to_cell(gridwin, "A3", "3;4")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A3"}))
+ #copy data
+ self.xUITest.executeCommand(".uno:Copy")
+ #move down
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:GoDown")
+ #paste data, should be selected
+ self.xUITest.executeCommand(".uno:Paste") #A7:A9
+ gridWinState = get_state_as_dict(gridwin)
+ self.assertEqual(gridWinState["MarkedArea"], "Sheet1.A7:Sheet1.A9")
+ # Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns") as xDialog:
+ xSemicolon = xDialog.getChild("semicolon") #check semicolon checkbox
+ if (get_state_as_dict(xSemicolon)["Selected"]) == "false":
+ xSemicolon.executeAction("CLICK", tuple())
+
+ #Verify
+ self.assertEqual(get_cell_by_position(document, 0, 0, 6).getValue(), 1)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 7).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 0, 8).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 6).getValue(), 2)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 7).getValue(), 3)
+ self.assertEqual(get_cell_by_position(document, 0, 1, 8).getValue(), 4)
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/textToColumns/textToColumns.py b/sc/qa/uitest/textToColumns/textToColumns.py
new file mode 100644
index 0000000000..c67e879d18
--- /dev/null
+++ b/sc/qa/uitest/textToColumns/textToColumns.py
@@ -0,0 +1,369 @@
+# -*- 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
+
+#text to column testcase
+
+class CalcTextToColumns(UITestCase):
+
+ def test_text_to_columns_dot(self):
+ #_Dot_as_Separator
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_dot.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #Select A1:A5 on Sheet 'Dot_as_Separator'
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ #Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns", close_button="") as xDialog:
+ #Untag Tab as separator and tag other. Put a dot into the input field next to the other checkbox
+ xother = xDialog.getChild("other")
+ xinputother = xDialog.getChild("inputother")
+
+ if (get_state_as_dict(xother)["Selected"]) == "false":
+ xother.executeAction("CLICK", tuple())
+ xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"."}))
+ #Click Ok
+ xOK = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 0).getString(), "random content")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 1).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 2).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content")
+
+ def test_text_to_columns_comma(self):
+ #Comma as Separator
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_comma.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ # Select A1:A5
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ # Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns", close_button="") as xDialog:
+ # Untag Tab as separator and tag comma.
+ xComma = xDialog.getChild("comma")
+ if (get_state_as_dict(xComma)["Selected"]) == "false":
+ xComma.executeAction("CLICK", tuple())
+ # Click Ok
+
+ xOK = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 0).getString(), "random content")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 1).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 2).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content")
+
+ def test_text_to_columns_semicolon(self):
+ #Semicolon as Separator
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_semicolon.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ # Select A1:A5 on Sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ # Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns", close_button="") as xDialog:
+ # Untag comma as separator and tag Semicolon
+ xSemicolon = xDialog.getChild("semicolon")
+ if (get_state_as_dict(xSemicolon)["Selected"]) == "false":
+ xSemicolon.executeAction("CLICK", tuple())
+ # Click Ok
+
+ xOK = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 0).getString(), "random content")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 1).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 2).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content")
+
+ def test_text_to_columns_space(self):
+ #Space as Separator
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_space.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ # Select A1:A5 on Sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ # Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns", close_button="") as xDialog:
+ # Untag comma as separator and tag Semicolon
+ xSpace = xDialog.getChild("space")
+ if (get_state_as_dict(xSpace)["Selected"]) == "false":
+ xSpace.executeAction("CLICK", tuple())
+ # xspace.executeAction("CLICK", tuple())
+ # Click Ok
+
+ xOK = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 0).getString(), "random content")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 1).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 2).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content")
+
+ def test_text_to_columns_pipe(self):
+ #Space as Separator
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_pipe.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ # Select A1:A5 on Sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ # Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns", close_button="") as xDialog:
+ # Untag comma as separator and tag Semicolon
+ xother = xDialog.getChild("other")
+ xinputother = xDialog.getChild("inputother")
+ if (get_state_as_dict(xother)["Selected"]) == "false":
+ xother.executeAction("CLICK", tuple())
+ xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"|"}))
+ # Click Ok
+
+ xOK = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 0).getString(), "random content")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 1).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 2).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content")
+
+ def test_text_to_columns_pipespace(self):
+ #Space as Separator
+ with self.ui_test.load_file(get_url_for_data_file("text_to_columns_pipe_space.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ # Select A1:A5 on Sheet
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:A5"}))
+ # Data - Text to Columns
+ with self.ui_test.execute_dialog_through_command(".uno:TextToColumns", close_button="") as xDialog:
+ xspace = xDialog.getChild("space")
+ xother = xDialog.getChild("other")
+ xinputother = xDialog.getChild("inputother")
+ if (get_state_as_dict(xspace)["Selected"]) == "false":
+ xspace.executeAction("CLICK", tuple())
+ if (get_state_as_dict(xother)["Selected"]) == "false":
+ xother.executeAction("CLICK", tuple())
+ xinputother.executeAction("TYPE", mkPropertyValues({"TEXT":"|"}))
+ # Click Ok
+
+ xOK = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOK.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #Verify
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getValue(), 1)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 3).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 4).getValue(), 2)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 0).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 4).getValue(), 3)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 0).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 1).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 4).getValue(), 4)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 0).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 2).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 4).getValue(), 5)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 0).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 3).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 4).getValue(), 6)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 0).getString(), "random content")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 1).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 2).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 3).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 4).getString(), "random content")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: