summaryrefslogtreecommitdiff
path: root/cui/qa
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2018-01-03 13:34:46 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-01-03 17:44:22 +0100
commitdba3cd508116780cf5d115f964b7311dd61e180d (patch)
tree09717141298d21e0a7f90c80ce571d00c9062058 /cui/qa
parentde84816c1acefe0607827418f73477ff7163728d (diff)
tdf#113357 cui: fix duplicate 'Formatted text [Richtext]' paste option
Prefer RTF when we have both RICHTEXT and RTF. Change-Id: Ib4133ae4fdecc32429d89b56b0c9466dd3451522 Reviewed-on: https://gerrit.libreoffice.org/47316 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'cui/qa')
-rw-r--r--cui/qa/uitest/dialogs/pastedlg.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/cui/qa/uitest/dialogs/pastedlg.py b/cui/qa/uitest/dialogs/pastedlg.py
new file mode 100644
index 000000000000..93973178c254
--- /dev/null
+++ b/cui/qa/uitest/dialogs/pastedlg.py
@@ -0,0 +1,46 @@
+#
+# 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 libreoffice.uno.propertyvalue import mkPropertyValues
+from uitest.framework import UITestCase
+from uitest.uihelper.common import get_state_as_dict
+
+
+# Test for SvPasteObjectDialog.
+class Test(UITestCase):
+
+ def testGetFormat(self):
+ # Copy a string in Impress.
+ self.ui_test.create_doc_in_start_center("impress")
+ template = self.xUITest.getTopFocusWindow()
+ self.ui_test.close_dialog_through_button(template.getChild("cancel"))
+ doc = self.xUITest.getTopFocusWindow()
+ editWin = doc.getChild("impress_win")
+ # Select the title shape.
+ editWin.executeAction("TYPE", mkPropertyValues({"KEYCODE": "TAB"}))
+ editWin.executeAction("TYPE", mkPropertyValues({"TEXT": "t"}))
+ self.xUITest.executeCommand(".uno:SelectAll")
+ self.xUITest.executeCommand(".uno:Copy")
+
+ # Now use paste special to see what formats are offered.
+ self.ui_test.execute_dialog_through_command(".uno:PasteSpecial")
+ pasteSpecial = self.xUITest.getTopFocusWindow()
+ formats = pasteSpecial.getChild("list")
+ entryCount = int(get_state_as_dict(formats)["EntryCount"])
+ items = []
+ for index in range(entryCount):
+ formats.executeAction("SELECT", mkPropertyValues({"POS": str(index)}))
+ items.append(get_state_as_dict(formats)["SelectEntryText"])
+
+ # Make sure there is no RTF vs Richtext duplication.
+ self.assertTrue("Formatted text [RTF]" in items)
+ self.assertFalse("Formatted text [Richtext]" in items)
+
+ # Close the dialog and the document.
+ self.ui_test.close_dialog_through_button(pasteSpecial.getChild("cancel"))
+ self.ui_test.close_doc()
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab: