sw/qa/uitest/table/tdf170554_save_large_table.py | 56 +++++++++++++++++++++++ 1 file changed, 56 insertions(+)
New commits: commit d982e56ab3a99a6033a191d5829cb03289c63720 Author: Xisco Fauli <[email protected]> AuthorDate: Mon Feb 2 11:18:01 2026 +0100 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Feb 2 14:26:35 2026 +0100 tdf#170554: sw: Add UItest Change-Id: Ic54ae1f56f369f3c13853fa084d12343e295a394 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/198528 Tested-by: Jenkins Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/qa/uitest/table/tdf170554_save_large_table.py b/sw/qa/uitest/table/tdf170554_save_large_table.py new file mode 100644 index 000000000000..8964a51db9a5 --- /dev/null +++ b/sw/qa/uitest/table/tdf170554_save_large_table.py @@ -0,0 +1,56 @@ +# -*- tab-width: 4; indent-tabs-mode: nil; py-indent-offset: 4 -*- +# +# This file is part of the LibreOffice project. +# +# 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 org.libreoffice.unotest import systemPathToFileUrl +from tempfile import TemporaryDirectory +import os.path + +class tdf170554(UITestCase): + + def test_tdf170554_save_large_table(self): + + with TemporaryDirectory() as tempdir: + xFilePath = os.path.join(tempdir, 'tdf170554-tmp.odt') + + with self.ui_test.create_doc_in_start_center("writer") as document: + + with self.ui_test.execute_dialog_through_command(".uno:InsertTable") as xDialog: + + xColSpin = xDialog.getChild("colspin") + xColSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xColSpin.executeAction("TYPE", mkPropertyValues({"TEXT": "40"})) + + xRowSpin = xDialog.getChild("rowspin") + xRowSpin.executeAction("TYPE", mkPropertyValues({"KEYCODE":"CTRL+A"})) + xRowSpin.executeAction("TYPE", mkPropertyValues({"TEXT": "600"})) + + self.assertEqual("40", get_state_as_dict(xColSpin)["Text"]) + self.assertEqual("600", get_state_as_dict(xRowSpin)["Text"]) + + tables = document.getTextTables() + self.assertEqual(600, len(tables[0].getRows())) + self.assertEqual(40, len(tables[0].getColumns())) + + # Without the fix in place, this test would have failed to save the document + with self.ui_test.execute_dialog_through_command('.uno:SaveAs', close_button="open") as xDialog: + xFileName = xDialog.getChild('file_name') + xFileName.executeAction('TYPE', mkPropertyValues({'KEYCODE':'CTRL+A'})) + xFileName.executeAction('TYPE', mkPropertyValues({'KEYCODE':'BACKSPACE'})) + xFileName.executeAction('TYPE', mkPropertyValues({'TEXT': xFilePath})) + + with self.ui_test.load_file(systemPathToFileUrl(xFilePath)) as document2: + + tables = document2.getTextTables() + self.assertEqual(600, len(tables[0].getRows())) + self.assertEqual(40, len(tables[0].getColumns())) + +# vim: set shiftwidth=4 softtabstop=4 expandtab:
