summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalazs Santha <santha.balazs@simonyi.bme.hu>2021-07-05 12:57:47 +0200
committerXisco Fauli <xiscofauli@libreoffice.org>2021-07-06 11:15:32 +0200
commit913ea7e18af9e04c82c9b33ddd34b4b5a0917f29 (patch)
tree416c9fe480dcf54d345b030c4416429fe3f3bf09
parent003d65ef1305eefb43315f93bdf10cee787f90f0 (diff)
sw: test fix of tdf#131771
Change-Id: I9879f13e842dd7288c996c1097130e7e7b28589c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118432 Tested-by: Jenkins Reviewed-by: Michael Stahl <michael.stahl@allotropia.de> Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
-rw-r--r--sw/qa/uitest/writer_tests7/tdf131771.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/sw/qa/uitest/writer_tests7/tdf131771.py b/sw/qa/uitest/writer_tests7/tdf131771.py
new file mode 100644
index 000000000000..5cbadee63c0e
--- /dev/null
+++ b/sw/qa/uitest/writer_tests7/tdf131771.py
@@ -0,0 +1,40 @@
+# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
+#
+# 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.common import select_pos
+
+# Bug 131771 - Copying+Pasting a table: caused the loss of table style setting.
+
+
+class tdf131771(UITestCase):
+ def test_tdf131771(self):
+ with self.ui_test.create_doc_in_start_center("writer"):
+ xWriterDoc = self.xUITest.getTopFocusWindow()
+ xWriterEdit = xWriterDoc.getChild("writer_edit")
+ # generate a 2x2 tables with the same autoformat table style (Default Table Style)
+ # Note that this style is different than applying nothing!
+ with self.ui_test.execute_dialog_through_command(".uno:InsertTable") as xDialog:
+ formatlbinstable = xDialog.getChild("formatlbinstable")
+ entry = formatlbinstable.getChild("1")
+ entry.executeAction("SELECT", tuple())
+
+ # select the table
+ self.xUITest.executeCommand(".uno:SelectAll")
+
+ # copying and pasting the table below
+ self.xUITest.executeCommand(".uno:Copy")
+ self.xUITest.executeCommand(".uno:GoDown")
+ self.xUITest.executeCommand(".uno:Paste")
+
+ document = self.ui_test.get_component()
+ tables = document.getTextTables()
+ self.assertEqual(tables[0].TableTemplateName, 'Default Style')
+ self.assertEqual(tables[1].TableTemplateName, 'Default Style')
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: