diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2023-05-16 08:31:21 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2023-05-16 09:42:18 +0200 |
commit | d9cd177b9b08d454882dd77ffeb825a184a1b540 (patch) | |
tree | 7eba3da817fbbb7c09f2717d6082826402789d68 /sw/qa/uitest | |
parent | bb0edd05b5595e8b795db6ce521491716661a09a (diff) |
sw floattable: disable UI if the frame is chained already
TextFrames can be chained and we look at those fly frames as shapes. In
this case, we should not offer the "split fly" functionality, which
makes sense only when the fly frame is considered as a floating table.
The combination of these two features have no use-case and it would just
cause trouble when exporting to Word formats.
Fix the problem by making SwFramePage::Reset() more strict: it already
only allowed fly split for the case when the content was a single table,
but now it also requires no chaining.
The other way around (split fly -> no chain) still needs doing.
Change-Id: I06c240209a3a26519a5df953e22c9ee1b54aed34
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/151822
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/qa/uitest')
-rw-r--r-- | sw/qa/uitest/data/chained-frames.odt | bin | 0 -> 10241 bytes | |||
-rw-r--r-- | sw/qa/uitest/ui/frmdlg/frmdlg.py | 17 |
2 files changed, 17 insertions, 0 deletions
diff --git a/sw/qa/uitest/data/chained-frames.odt b/sw/qa/uitest/data/chained-frames.odt Binary files differnew file mode 100644 index 000000000000..281e06520e27 --- /dev/null +++ b/sw/qa/uitest/data/chained-frames.odt diff --git a/sw/qa/uitest/ui/frmdlg/frmdlg.py b/sw/qa/uitest/ui/frmdlg/frmdlg.py index cfa2dd8ba954..e3aeb67c569c 100644 --- a/sw/qa/uitest/ui/frmdlg/frmdlg.py +++ b/sw/qa/uitest/ui/frmdlg/frmdlg.py @@ -13,6 +13,7 @@ import time from libreoffice.uno.propertyvalue import mkPropertyValues from uitest.framework import UITestCase from uitest.uihelper.common import get_state_as_dict +from uitest.uihelper.common import get_url_for_data_file class Test(UITestCase): @@ -44,5 +45,21 @@ class Test(UITestCase): # Then make sure the doc model is updated correctly: self.assertEqual(xComponent.TextFrames.Frame1.IsSplitAllowed, True) + def test_chained_fly_split(self): + # Given a document with 2 chained fly frames: + with self.ui_test.load_file(get_url_for_data_file("chained-frames.odt")): + # When selecting the first and opening the fly frame properties dialog: + self.xUITest.executeCommand(".uno:JumpToNextFrame") + # Wait until SwTextShell is replaced with SwDrawShell after 120 ms, as set in the SwView + # ctor. + time.sleep(0.2) + with self.ui_test.execute_dialog_through_command(".uno:FrameDialog") as xDialog: + # Then make sure that the 'split' checkbox is hidden: + xFlysplit = xDialog.getChild("flysplit") + # Without the accompanying fix in place, this test would have failed with: + # AssertionError: 'true' != 'false' + # i.e. the UI didn't hide this option, leading to some weird mix of chained shapes + # and floating tables. + self.assertEqual(get_state_as_dict(xFlysplit)['Visible'], "false") # vim: set shiftwidth=4 softtabstop=4 expandtab: |