summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
authorTünde Tóth <toth.tunde@nisz.hu>2021-10-06 10:19:05 +0200
committerLászló Németh <nemeth@numbertext.org>2021-10-13 14:45:30 +0200
commit5697e09b3e726a38b58ce31ac0c3a97e7871c74a (patch)
tree996ff2c6c68898347615680f062f600879418e0a /sd
parenta3416ed058884a1fcaae0659ff6e71f5a7dff8d0 (diff)
tdf#144943 PPTX import: fix permission for editing
The passwords for editing in PPTX documents created with PowerPoint weren't asked and verified. Change-Id: I62eb4fd68aac6422c1221a639f4815459ab556c9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/123130 Tested-by: Jenkins Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sd')
-rw-r--r--sd/qa/uitest/impress_tests/data/tdf144943.pptxbin0 -> 33389 bytes
-rw-r--r--sd/qa/uitest/impress_tests/tdf144943.py29
-rw-r--r--sd/source/ui/unoidl/UnoDocumentSettings.cxx2
3 files changed, 31 insertions, 0 deletions
diff --git a/sd/qa/uitest/impress_tests/data/tdf144943.pptx b/sd/qa/uitest/impress_tests/data/tdf144943.pptx
new file mode 100644
index 000000000000..e03788fbadb1
--- /dev/null
+++ b/sd/qa/uitest/impress_tests/data/tdf144943.pptx
Binary files differ
diff --git a/sd/qa/uitest/impress_tests/tdf144943.py b/sd/qa/uitest/impress_tests/tdf144943.py
new file mode 100644
index 000000000000..7c63dfab8637
--- /dev/null
+++ b/sd/qa/uitest/impress_tests/tdf144943.py
@@ -0,0 +1,29 @@
+# -*- 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_url_for_data_file
+from libreoffice.uno.propertyvalue import mkPropertyValues
+
+#Bug 144943 - FILEOPEN PPTX Read-only passwords on PPTX files are not working
+
+class tdf144943(UITestCase):
+
+ def test_tdf144943(self):
+ with self.ui_test.load_file(get_url_for_data_file("tdf144943.pptx")):
+ document = self.ui_test.get_component()
+
+ # Without the fix in place, this test would have failed with
+ # AssertionError: False is not true
+ self.assertTrue(document.isReadonly())
+
+ 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())
+
+# vim: set shiftwidth=4 softtabstop=4 expandtab:
diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
index 24ac8f626dbe..5d13db6c4ecd 100644
--- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx
+++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx
@@ -951,6 +951,8 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries,
if ( !pDocSh->SetModifyPasswordInfo( aInfo ) )
throw beans::PropertyVetoException(
"The hash is not allowed to be changed now!" );
+ else
+ bOk = true;
}
break;