summaryrefslogtreecommitdiffstats
path: root/sc/qa/uitest/pasteSpecial
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 09:06:44 +0000
commited5640d8b587fbcfed7dd7967f3de04b37a76f26 (patch)
tree7a5f7c6c9d02226d7471cb3cc8fbbf631b415303 /sc/qa/uitest/pasteSpecial
parentInitial commit. (diff)
downloadlibreoffice-upstream.tar.xz
libreoffice-upstream.zip
Adding upstream version 4:7.4.7.upstream/4%7.4.7upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'sc/qa/uitest/pasteSpecial')
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf114710.py44
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf118308.py51
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf142932.py57
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf57274.py40
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf62267.py45
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf65856.py87
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf69450.py53
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf74577.py65
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf84810.py47
-rw-r--r--sc/qa/uitest/pasteSpecial/tdf86253.py51
10 files changed, 540 insertions, 0 deletions
diff --git a/sc/qa/uitest/pasteSpecial/tdf114710.py b/sc/qa/uitest/pasteSpecial/tdf114710.py
new file mode 100644
index 000000000..cb6fb3654
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf114710.py
@@ -0,0 +1,44 @@
+# -*- 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.uno.propertyvalue import mkPropertyValues
+
+class tdf114710(UITestCase):
+
+ def test_tdf114710(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf114710.ods")):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "A1:O7"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ with self.ui_test.load_empty_file("writer") as writer_document:
+
+ self.xUITest.getTopFocusWindow()
+
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xList = xDialog.getChild('list')
+
+ for childName in xList.getChildren():
+ xChild = xList.getChild(childName)
+ if get_state_as_dict(xChild)['Text'] == "Graphics Device Interface metafile (GDI)":
+ break
+
+ xChild.executeAction("SELECT", tuple())
+ self.assertEqual(
+ get_state_as_dict(xList)['SelectEntryText'], "Graphics Device Interface metafile (GDI)")
+
+
+ # Without the fix in place, this test would have crashed here
+ self.assertEqual(1, writer_document.GraphicObjects.getCount())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf118308.py b/sc/qa/uitest/pasteSpecial/tdf118308.py
new file mode 100644
index 000000000..130814710
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf118308.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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+
+class tdf118308(UITestCase):
+
+ def test_tdf118308(self):
+ with self.ui_test.create_doc_in_start_center("calc"):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ enter_text_to_cell(gridwin, "A1", "A")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ with self.ui_test.load_empty_file("calc") as calc_document:
+
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ # Without the fix in place, this test would have failed here
+ # since a different dialog would have been opened and the children
+ # wouldn't have been found
+ xText = xDialog.getChild("text")
+ xNumbers = xDialog.getChild("numbers")
+ xDatetime = xDialog.getChild("datetime")
+ xFormats = xDialog.getChild("formats")
+
+ self.assertEqual("true", get_state_as_dict(xText)["Selected"])
+ self.assertEqual("true", get_state_as_dict(xNumbers)["Selected"])
+ self.assertEqual("true", get_state_as_dict(xDatetime)["Selected"])
+ self.assertEqual("false", get_state_as_dict(xFormats)["Selected"])
+
+
+ self.assertEqual("A", get_cell_by_position(calc_document, 0, 0, 0).getString())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf142932.py b/sc/qa/uitest/pasteSpecial/tdf142932.py
new file mode 100644
index 000000000..7e75cf0af
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf142932.py
@@ -0,0 +1,57 @@
+# -*- 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
+from uitest.uihelper.common import get_state_as_dict
+
+class tdf142932(UITestCase):
+
+ def test_tdf142932(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf142932.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:SelectRow")
+
+ self.assertEqual("some comment", get_cell_by_position(calc_doc, 0, 4, 0).Annotation.String)
+
+ self.xUITest.executeCommand(".uno:Copy")
+
+ with self.ui_test.execute_dialog_through_command(".uno:Insert") as xDialog:
+ xAfter = xDialog.getChild('after')
+ xAfter.executeAction("CLICK", tuple())
+
+ self.assertEqual(get_state_as_dict(gridwin)["SelectedTable"], "1")
+
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+ xText = xDialog.getChild("text")
+ xComments = xDialog.getChild("comments")
+ xSkipEmpty = xDialog.getChild("skip_empty")
+ self.assertEqual('true', get_state_as_dict(xText)['Selected'])
+ self.assertEqual('false', get_state_as_dict(xComments)['Selected'])
+ xSkipEmpty.executeAction("CLICK", tuple())
+ self.assertEqual('true', get_state_as_dict(xSkipEmpty)['Selected'])
+
+ # Without the fix in place, this test would have crashed here
+
+ self.assertEqual("A", get_cell_by_position(calc_doc, 1, 0, 0).getString())
+ self.assertEqual("row", get_cell_by_position(calc_doc, 1, 1, 0).getString())
+ self.assertEqual("with", get_cell_by_position(calc_doc, 1, 2, 0).getString())
+ self.assertEqual("comment", get_cell_by_position(calc_doc, 1, 3, 0).getString())
+ self.assertEqual("for", get_cell_by_position(calc_doc, 1, 4, 0).getString())
+ self.assertEqual("a", get_cell_by_position(calc_doc, 1, 5, 0).getString())
+ self.assertEqual("certain", get_cell_by_position(calc_doc, 1, 6, 0).getString())
+ self.assertEqual("cell", get_cell_by_position(calc_doc, 1, 7, 0).getString())
+
+ self.assertEqual("", get_cell_by_position(calc_doc, 1, 4, 0).Annotation.String)
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf57274.py b/sc/qa/uitest/pasteSpecial/tdf57274.py
new file mode 100644
index 000000000..0a323d93f
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf57274.py
@@ -0,0 +1,40 @@
+# -*- 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: Paste Special Link Checkbox fails to insert cell references when the source cell is blank
+
+class tdf57274(UITestCase):
+
+ def test_tdf57274_tdf116385_row_only(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf57274.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #* Source Cells, range B6..E6
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "B6:E6"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B11"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial", close_button="") as xDialog:
+ #We paste here using Paste Special with 'Link' Checkbox activated
+ xLink = xDialog.getChild("link")
+ xLink.executeAction("CLICK", tuple())
+
+ xOkBtn = xDialog.getChild("ok")
+ with self.ui_test.execute_blocking_action(xOkBtn.executeAction, args=('CLICK', ()), close_button="yes"):
+ pass
+
+ #we would expect a reference to cell E6 here and a zero being displayed, but the cell is also simply blank.
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 10).getValue(), 0)
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 10).getFormula(), "=$Sheet1.$E$6")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf62267.py b/sc/qa/uitest/pasteSpecial/tdf62267.py
new file mode 100644
index 000000000..bd11b9819
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf62267.py
@@ -0,0 +1,45 @@
+# -*- 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.uno.propertyvalue import mkPropertyValues
+
+#Bug 62267 - Conditional formatting lost after paste special of text, numbers and dates.
+#If you have a cell with conditional formatting and you use paste special only inserting only text,
+#numbers and dates the formatting is lost. Undo do not recover the conditional formatting.
+
+class tdf62267(UITestCase):
+
+ def test_tdf62267(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf62267.ods")):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #* Copy A1, then paste special to C1;
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "C1"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial"):
+ #it's the default - text, numbers and dates
+ pass
+
+ #--> Cell formatting should stay as before
+ with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog", close_button="cancel") as xCondFormatMgr:
+
+
+ # check that we have exactly 1 conditional format
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '1')
+
+ xTreeEntry = xList.getChild('0')
+ self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1\tCell value = 1")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf65856.py b/sc/qa/uitest/pasteSpecial/tdf65856.py
new file mode 100644
index 000000000..32ec6205c
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf65856.py
@@ -0,0 +1,87 @@
+# -*- 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.uno.propertyvalue import mkPropertyValues
+from libreoffice.calc.document import get_cell_by_position
+
+class tdf65856(UITestCase):
+
+ def test_tdf65856_paste_special_shift_right(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf65856.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #- mark D1:E14; copy
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "D1:E14"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ #mark cell D1
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "D1"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xmove_right = xDialog.getChild("move_right")
+ xmove_right.executeAction("CLICK", tuple())
+
+
+ #check
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 0).getString(), "T1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 0).getString(), "TE1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 0).getString(), "TES1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 0).getString(), "TEST1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 0, 13).getString(), "T14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 13).getString(), "TE14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 13).getString(), "TES14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 13).getString(), "TEST14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 13).getString(), "TEST14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 13).getString(), "TEST14")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 6, 13).getString(), "TEST14")
+
+ def test_tdf65856_paste_special_shift_right_2(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf65856_2.ods")) as calc_doc:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #- select range C2:D4; copy
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C2:D4"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ #mark cell B2
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B2"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xmove_right = xDialog.getChild("move_right")
+ xmove_right.executeAction("CLICK", tuple())
+
+
+ #check
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getString(), "1")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getString(), "2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 1, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 2, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 3).getString(), "3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 1).getFormula(), "=D2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 1).getFormula(), "=D2")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 2).getFormula(), "=E3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 5, 2).getFormula(), "=E3")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 3, 3).getFormula(), "=F4")
+ self.assertEqual(get_cell_by_position(calc_doc, 0, 4, 3).getFormula(), "=F4")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf69450.py b/sc/qa/uitest/pasteSpecial/tdf69450.py
new file mode 100644
index 000000000..966ad8a4d
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf69450.py
@@ -0,0 +1,53 @@
+# -*- 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.uihelper.calc import enter_text_to_cell
+from libreoffice.calc.document import get_cell_by_position
+
+class tdf69450(UITestCase):
+
+ def test_tdf69450(self):
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #add text to A1 and B1
+ enter_text_to_cell(gridwin, "A1", "A")
+ enter_text_to_cell(gridwin, "B1", "B")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xtext = xDialog.getChild("text")
+ xnumbers = xDialog.getChild("numbers")
+ xdatetime = xDialog.getChild("datetime")
+ xformats = xDialog.getChild("formats")
+
+ xtext.executeAction("CLICK", tuple())
+ xnumbers.executeAction("CLICK", tuple())
+ xdatetime.executeAction("CLICK", tuple())
+ xformats.executeAction("CLICK", tuple())
+
+
+ #check B1 text
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B")
+
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A2"}))
+ self.xUITest.executeCommand(".uno:Bold")
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "B1"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial"):
+ pass
+
+ #check B1 text
+ self.assertEqual(get_cell_by_position(document, 0, 1, 0).getString(), "B")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf74577.py b/sc/qa/uitest/pasteSpecial/tdf74577.py
new file mode 100644
index 000000000..87fdd2f9a
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf74577.py
@@ -0,0 +1,65 @@
+# -*- 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
+
+
+class tdf74577(UITestCase):
+
+ def test_tdf74577(self):
+
+ # Open the HTML in writer
+ with self.ui_test.load_file(get_url_for_data_file("tdf74577.html")):
+
+ # Use SelectAll twice to select the table
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:SelectAll")
+
+ self.xUITest.executeCommand(".uno:Copy")
+
+ with self.ui_test.load_empty_file("calc") as calc_document:
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial", close_button="") as xDialog:
+
+ xList = xDialog.getChild('list')
+
+ for childName in xList.getChildren():
+ xChild = xList.getChild(childName)
+ if get_state_as_dict(xChild)['Text'] == "HyperText Markup Language (HTML)":
+ break
+
+ xChild.executeAction("SELECT", tuple())
+ self.assertEqual(
+ get_state_as_dict(xList)['SelectEntryText'], "HyperText Markup Language (HTML)")
+
+ xOkBtn = xDialog.getChild("ok")
+
+ with self.ui_test.execute_blocking_action(xOkBtn.executeAction, args=('CLICK', ())):
+ pass
+
+ self.assertEqual("Cell1", get_cell_by_position(calc_document, 0, 0, 0).getString())
+ self.assertEqual("Cell1", get_cell_by_position(calc_document, 0, 0, 1).getString())
+ self.assertEqual("Cell1 + Cell2", get_cell_by_position(calc_document, 0, 0, 2).getString())
+ self.assertEqual("Cell1 + Cell2 + Cell3", get_cell_by_position(calc_document, 0, 0, 3).getString())
+ self.assertEqual("Cell1 + Cell2", get_cell_by_position(calc_document, 0, 0, 4).getString())
+
+ self.assertEqual("Cell2 + 3", get_cell_by_position(calc_document, 0, 1, 0).getString())
+ self.assertEqual("Cell2", get_cell_by_position(calc_document, 0, 1, 1).getString())
+ self.assertEqual("Cell3", get_cell_by_position(calc_document, 0, 2, 1).getString())
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: 'Cell3' != ''
+ self.assertEqual("Cell3", get_cell_by_position(calc_document, 0, 2, 2).getString())
+
+ self.assertEqual("Cell2 + Cell3", get_cell_by_position(calc_document, 0, 1, 4).getString())
+ self.assertEqual("Cell2", get_cell_by_position(calc_document, 0, 1, 5).getString())
+ self.assertEqual("Cell3", get_cell_by_position(calc_document, 0, 2, 5).getString())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf84810.py b/sc/qa/uitest/pasteSpecial/tdf84810.py
new file mode 100644
index 000000000..c4504492f
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf84810.py
@@ -0,0 +1,47 @@
+# -*- 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 libreoffice.calc.document import get_cell_by_position
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+from uitest.uihelper.calc import enter_text_to_cell
+
+
+class ManualCalcTests(UITestCase):
+ def test_paste_special(self):
+ # EN-8:Paste special with options
+ # This test is to check that paste special combined with some options and link is ok.
+ # Refers to tdf#84810
+
+ with self.ui_test.create_doc_in_start_center("calc") as document:
+
+ # Write text to cell A1
+ xGridWin = self.xUITest.getTopFocusWindow().getChild("grid_window")
+ enter_text_to_cell(xGridWin, "A1", "abcd")
+
+ # Copy cell A1 to clipboard
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+
+ # Set cursor to cell A3
+ xGridWin.executeAction("SELECT", mkPropertyValues({"CELL": "A3"}))
+
+ # Choose Paste Special Options and paste data
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xPasteSpecialDlg:
+ xAllChkBox = xPasteSpecialDlg.getChild("paste_all")
+ xAllChkBox.executeAction("CLICK", tuple())
+ xLinkChkBox = xPasteSpecialDlg.getChild("link")
+ xLinkChkBox.executeAction("CLICK", tuple())
+
+ # Assert successful paste
+ self.assertEqual(get_cell_by_position(document, 0, 0, 2).getString(), "abcd")
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sc/qa/uitest/pasteSpecial/tdf86253.py b/sc/qa/uitest/pasteSpecial/tdf86253.py
new file mode 100644
index 000000000..7e8ab372b
--- /dev/null
+++ b/sc/qa/uitest/pasteSpecial/tdf86253.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, get_url_for_data_file
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+class tdf86253(UITestCase):
+
+ def test_tdf86253(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf86253.ods")):
+ xCalcDoc = self.xUITest.getTopFocusWindow()
+ gridwin = xCalcDoc.getChild("grid_window")
+
+ #* Copy A1, then paste special only "formatting" to C1:C17;
+ gridwin.executeAction("SELECT", mkPropertyValues({"CELL": "A1"}))
+ self.xUITest.executeCommand(".uno:Copy")
+ gridwin.executeAction("SELECT", mkPropertyValues({"RANGE": "C1:C17"}))
+ with self.ui_test.execute_dialog_through_command(".uno:PasteSpecial") as xDialog:
+
+ xtext = xDialog.getChild("text")
+ xnumbers = xDialog.getChild("numbers")
+ xdatetime = xDialog.getChild("datetime")
+ xformats = xDialog.getChild("formats")
+
+ xtext.executeAction("CLICK", tuple())
+ xnumbers.executeAction("CLICK", tuple())
+ xdatetime.executeAction("CLICK", tuple())
+ xformats.executeAction("CLICK", tuple())
+
+
+ #--> Cell formatting for C1:C17 is changed. But, if you go to "Format - Conditional Formatting - Manage",
+ #you will see that a new formatting condition is created with the range "C1:C6", rather than "C1:C17". This is wrong behavior.
+ with self.ui_test.execute_dialog_through_command(".uno:ConditionalFormatManagerDialog", close_button="cancel") as xCondFormatMgr:
+
+
+ # check that we have exactly 1 conditional format and range is C1:C17
+ xList = xCondFormatMgr.getChild("CONTAINER")
+ list_state = get_state_as_dict(xList)
+ self.assertEqual(list_state['Children'], '1')
+
+ xTreeEntry = xList.getChild('0')
+ self.assertEqual(get_state_as_dict(xTreeEntry)["Text"], "A1:A6,C1:C17\tCell value >= 0")
+
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: