summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2021-05-06 14:14:56 +0300
committerMiklos Vajna <vmiklos@collabora.com>2021-06-10 10:13:17 +0200
commite6ab0cd94e02b5a6be80a0052100175424311455 (patch)
treeb76be3d8d019b08aecd0a1fa56e91c7684b6375f /test
parent90d9ef313d514eedb91e770039407c3286ea6d9a (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> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/116876 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'test')
-rw-r--r--test/source/sheet/xsheetannotationshapesupplier.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/test/source/sheet/xsheetannotationshapesupplier.cxx b/test/source/sheet/xsheetannotationshapesupplier.cxx
index dac446b72b52..fe392fc83494 100644
--- a/test/source/sheet/xsheetannotationshapesupplier.cxx
+++ b/test/source/sheet/xsheetannotationshapesupplier.cxx
@@ -33,7 +33,7 @@ void XSheetAnnotationShapeSupplier::testGetAnnotationShape()
CPPUNIT_ASSERT_EQUAL_MESSAGE("getAnnotationShape() wrong width",
sal_Int32(11275), xShape->getSize().Width);
CPPUNIT_ASSERT_EQUAL_MESSAGE("getAnnotationShape() wrong height",
- sal_Int32(1386), xShape->getSize().Height);
+ sal_Int32(1387), xShape->getSize().Height);
}
}