diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2021-11-03 12:59:47 +0100 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2021-11-24 09:19:18 +0100 |
commit | 04e279007272de286be31152d01e9cb45c9bd3e3 (patch) | |
tree | f22e0b6ecd2564066c57b7a0c2e7de5e4829dc27 /sd/qa | |
parent | 0bd2f13c653057433b6cb31059c1ac01636e71f0 (diff) |
tdf#145511 PPTX: export the password for editing
The password for editing wasn't exported in PPTX
documents.
Test: Edit->Edit Mode doesn't change to edit mode
any more without asking the password for editing.
Follow-up to commit 5697e09b3e726a38b58ce31ac0c3a97e7871c74a
"tdf#144943 PPTX import: fix permission for editing".
Change-Id: I1a9de511cf8b79224d8ac0a9aa0bf860b87bf184
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/124651
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd/qa')
-rw-r--r-- | sd/qa/uitest/impress_tests/save_readonly_with_password.py | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/sd/qa/uitest/impress_tests/save_readonly_with_password.py b/sd/qa/uitest/impress_tests/save_readonly_with_password.py index 3f789035d0a8..cd4fe98339c0 100644 --- a/sd/qa/uitest/impress_tests/save_readonly_with_password.py +++ b/sd/qa/uitest/impress_tests/save_readonly_with_password.py @@ -13,6 +13,53 @@ import os.path class save_readonly_with_password(UITestCase): + #Bug 145511 - FILESAVE to PPTX as read-only with additional password protection for editing not working + def test_save_to_pptx(self): + + with TemporaryDirectory() as tempdir: + xFilePath = os.path.join(tempdir, "tdf144374-tmp.pptx") + + with self.ui_test.create_doc_in_start_center("impress"): + xTemplateDlg = self.xUITest.getTopFocusWindow() + xCancelBtn = xTemplateDlg.getChild("close") + self.ui_test.close_dialog_through_button(xCancelBtn) + + # Save the document + with self.ui_test.execute_dialog_through_command(".uno:Save", close_button="") as xSaveDialog: + xFileName = xSaveDialog.getChild("file_name") + xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xFileName.executeAction("TYPE", mkPropertyValues({"KEYCODE":"BACKSPACE"})) + xFileName.executeAction("TYPE", mkPropertyValues({"TEXT": xFilePath})) + xFileTypeCombo = xSaveDialog.getChild("file_type") + select_by_text(xFileTypeCombo, "Office Open XML Presentation (.pptx)") + xPasswordCheckButton = xSaveDialog.getChild("password") + xPasswordCheckButton.executeAction("CLICK", tuple()) + xOpen = xSaveDialog.getChild("open") + + with self.ui_test.execute_dialog_through_action(xOpen, "CLICK") as xPasswordDialog: + xReadonly = xPasswordDialog.getChild("readonly") + xReadonly.executeAction("CLICK", tuple()) + xNewPassword = xPasswordDialog.getChild("newpassroEntry") + xNewPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"})) + xConfirmPassword = xPasswordDialog.getChild("confirmropassEntry") + xConfirmPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"})) + + # PPTX confirmation dialog is displayed + xWarnDialog = self.xUITest.getTopFocusWindow() + xSave = xWarnDialog.getChild("save") + self.ui_test.close_dialog_through_button(xSave) + + with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document: + + self.assertTrue(document.isReadonly()) + + # Without the fix in place, this dialog wouldn't have been displayed + with self.ui_test.execute_dialog_through_command(".uno:EditDoc") as xDialog: + xPassword = xDialog.getChild("newpassEntry") + xPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "password"})) + + self.assertFalse(document.isReadonly()) + def test_save_to_odp(self): with TemporaryDirectory() as tempdir: |