diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2021-05-06 14:14:56 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2021-06-08 14:51:29 +0200 |
commit | d0a1616ccad0dd5f5a02c1b0204f537b57d0b4b5 (patch) | |
tree | f52e71cd8c4f6e2df6dad122d70e28a00d75e2a1 /sd/qa/uitest/impress_tests | |
parent | 95ebd24a629b4c8cd62cc20c0701683512cc8fa0 (diff) |
editengine-columns: Implement layout
This changes the way how different parts access positions of lines and
paragraphs. Now there is ImpEditEngine::IterateLineAreas, which performs
uniform iteration over all ParaPortions and lines in order, calling a
user-provided callback function for each portion and line; it passes
all information about current portion, line, area, and column to the
callback, and checks the return from the callback, to decide if it needs
to continue iteration (in case when callback indicated that if doesn't
need further data), and if it needs calling the callback for the rest of
current portion's lines.
This allows to have the code that calculates and iterates dimensions of
lines in one central place, without the need to have duplicating logic
in several places.
One important exception is ImpEditEngine::Paint, which iterates without
ImpEditEngine::IterateLineAreas, because it does many atomic paint
operations in different points of iteration process, and implementing
ImpEditEngine::IterateLineAreas to call callback in the required places
would require increased complexity, which is left for a future change.
To make that possible, ImpEditEngine::IterFlag should be extended to
indicate additional requirements.
Note that in fact, ImpEditEngine::Paint was taken as the model for
implementation of ImpEditEngine::IterateLineAreas, with its detailed
handling of all the vertical offsets like additional line spacing and
interparagraph spacings that depend on context.
The notable result of the centralization of the iteration code is slight
change of heights reported by ImpEditEngine::CalcTextHeight. Previously
it simply added all pre-calculated heights of portions, and not taking
into account all the spacing handling that ImpEditEngine::Paint did,
which was inconsistent (calculated height was different from painted
height). Now ImpEditEngine::CalcTextHeight should provide more accurate
results, which required small changes in the unit tests.
Change-Id: I33cbb978deb974b314d36fda8674186a03991107
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116034
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'sd/qa/uitest/impress_tests')
-rw-r--r-- | sd/qa/uitest/impress_tests/tdf91762.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/sd/qa/uitest/impress_tests/tdf91762.py b/sd/qa/uitest/impress_tests/tdf91762.py index 92a23de6b101..8492e3425373 100644 --- a/sd/qa/uitest/impress_tests/tdf91762.py +++ b/sd/qa/uitest/impress_tests/tdf91762.py @@ -26,9 +26,9 @@ class tdf91762(UITestCase): self.ui_test.close_dialog_through_button(xOkBtn) document = self.ui_test.get_component() - self.assertEqual(1929, document.DrawPages[0].getByIndex(1).BoundRect.Height) + self.assertEqual(1931, document.DrawPages[0].getByIndex(1).BoundRect.Height) self.assertEqual(25198, document.DrawPages[0].getByIndex(1).Size.Width) - self.assertEqual(1923, document.DrawPages[0].getByIndex(1).Size.Height) + self.assertEqual(1925, document.DrawPages[0].getByIndex(1).Size.Height) self.assertEqual(1400, document.DrawPages[0].getByIndex(1).Position.X) self.assertEqual(3685, document.DrawPages[0].getByIndex(1).Position.Y) @@ -40,8 +40,8 @@ class tdf91762(UITestCase): xEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "RETURN"})) # tdf#138011: Without the fix in place, this test would have failed with - # AssertionError: 5494 != 3559 - self.assertEqual(5494, document.DrawPages[0].getByIndex(1).BoundRect.Height) + # AssertionError: 5496 != 3559 + self.assertEqual(5496, document.DrawPages[0].getByIndex(1).BoundRect.Height) self.ui_test.close_doc() |