diff options
author | Justin Luth <justin.luth@collabora.com> | 2020-12-22 17:36:54 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-01-22 05:25:52 +0100 |
commit | b84bcb4fd70ae920ac2f54f70919b773fa9b2e78 (patch) | |
tree | e61402d585aeac32abcef29291c6e235d961d8df /sw/qa/uitest | |
parent | f72c5680b0e10ad59e2abf0ebc1e71c94c41d173 (diff) |
tdf#138546 sw PageDialog: fix bad reset of colwidth
The presence of border padding was causing the algorithm
to reset the overall width, which in page style triggered
an even redistribution of the columns. That should only
happen when the number of columns changes, or else one of
the 5 predefined column choices is selected.
My first python unit test is included.
make UITest_writer_tests4 \
UITEST_TEST_NAME=tdf138546.tdf138546.test_tdf138546
Change-Id: I650e429568f2ab794649cc557998a809479b6e82
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108210
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sw/qa/uitest')
-rw-r--r-- | sw/qa/uitest/data/tdf138546.odt | bin | 0 -> 9933 bytes | |||
-rw-r--r-- | sw/qa/uitest/writer_tests4/tdf138546.py | 46 |
2 files changed, 46 insertions, 0 deletions
diff --git a/sw/qa/uitest/data/tdf138546.odt b/sw/qa/uitest/data/tdf138546.odt Binary files differnew file mode 100644 index 000000000000..8bfa9f6e5a2d --- /dev/null +++ b/sw/qa/uitest/data/tdf138546.odt diff --git a/sw/qa/uitest/writer_tests4/tdf138546.py b/sw/qa/uitest/writer_tests4/tdf138546.py new file mode 100644 index 000000000000..c94f7eed3d48 --- /dev/null +++ b/sw/qa/uitest/writer_tests4/tdf138546.py @@ -0,0 +1,46 @@ +# -*- 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 change_measurement_unit +from uitest.uihelper.common import get_state_as_dict, type_text +from uitest.uihelper.common import select_pos +import org.libreoffice.unotest +import pathlib +def get_url_for_data_file(file_name): + return pathlib.Path(org.libreoffice.unotest.makeCopyFromTDOC(file_name)).as_uri() +class tdf138546(UITestCase): + def test_tdf138546(self): + self.ui_test.load_file(get_url_for_data_file("tdf138546.odt")) + xWriterDoc = self.xUITest.getTopFocusWindow() + + change_measurement_unit(self, "Centimeter") + + #dialog Columns + self.ui_test.execute_dialog_through_command(".uno:FormatColumns") + xDialog = self.xUITest.getTopFocusWindow() + + colsnf = xDialog.getChild("colsnf") + width1mf = xDialog.getChild("width1mf") + self.assertEqual(get_state_as_dict(colsnf)["Text"], "2") + self.assertEqual((get_state_as_dict(width1mf)["Text"])[0:3], "2.0") #2.00 cm + xOKBtn = xDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(xOKBtn) + + self.ui_test.execute_dialog_through_command(".uno:PageDialog") + xDialog = self.xUITest.getTopFocusWindow() + tabcontrol = xDialog.getChild("tabcontrol") + select_pos(tabcontrol, "7") #Columns + colsnf = xDialog.getChild("colsnf") + width1mf = xDialog.getChild("width1mf") + self.assertEqual(get_state_as_dict(colsnf)["Text"], "2") + self.assertEqual((get_state_as_dict(width1mf)["Text"])[0:3], "2.0") #2.00 cm + xOKBtn = xDialog.getChild("cancel") + self.ui_test.close_dialog_through_button(xOKBtn) + + self.ui_test.close_doc() + +# vim: set shiftwidth=4 softtabstop=4 expandtab: |