Avoid potential negative array index access to cached text.
[LibreOffice.git] / sc / qa / uitest / calc_tests9 / tdf118938.py
blob33f8cde75d8278510e29fec0d4f97f2927a18291
1 # -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*-
3 # This file is part of the LibreOffice project.
5 # This Source Code Form is subject to the terms of the Mozilla Public
6 # License, v. 2.0. If a copy of the MPL was not distributed with this
7 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 from uitest.framework import UITestCase
10 from uitest.uihelper.common import get_url_for_data_file
11 from libreoffice.uno.propertyvalue import mkPropertyValues
12 from com.sun.star.beans import PropertyValue
14 #Bug 118938 - FILESAVE to Microsoft Excel 2007-2013 XML (.xlsx) files as read-only
15 # with additional password protection for editing not working (Calc)
17 class tdf118938(UITestCase):
19 def test_tdf118938(self):
20 with self.ui_test.load_file(get_url_for_data_file("tdf118938.xlsx"), [PropertyValue(Name="Silent", Value=True)]):
21 #The document was created in Calc after this fix.
22 document = self.ui_test.get_component()
24 # Without the fix in place, this test would have failed with
25 # AssertionError: False is not true
26 self.assertTrue(document.isReadonly())
28 with self.ui_test.execute_dialog_through_command(".uno:EditDoc") as xDialog:
29 xPassword = xDialog.getChild("newpassEntry")
30 xPassword.executeAction("TYPE", mkPropertyValues({"TEXT": "a"}))
32 self.assertFalse(document.isReadonly())
34 # vim: set shiftwidth=4 softtabstop=4 expandtab: