The images in the bug document are anchored to a paragraph that holds nothing
else, inside a text frame of a fixed height, and are centred vertically on
their paragraph's content. Such a paragraph has no text of its own, so its
height is whatever the object's own wrap gives it: the position and the area
it is measured against depend on each other. That circle has no solution
here, because a centred object needs a line of space above and below it
inside the paragraph (2 * 276 + 2400 = 2952 twips), more than the 2880 twips
of the frame. Layout alternated between a paragraph of a single line, with
the object ending up above the frame, and a paragraph filling the frame with
the object centred in it, and kept whichever of the two the pending
invalidations left behind. That is also why the same document changed its
appearance on a refresh and with the window size.
Take the content area of the text frame as the area to centre on, when the
anchor paragraph is the frame's only content and holds nothing but the
object. That is the space the paragraph can occupy, and unlike the paragraph
it does not follow the object, so there is one solution and layout reaches it
in a single pass. An object that fits into its anchor paragraph keeps using
the paragraph, so one placed next to the paragraph's own line stays there.
Signed-off-by: Mike Kaganski <mike.kaganski@collabora.com>
Change-Id: I8d642ea7328fde505a33d0fad727bc4b7fd2c457
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/7833
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Caolán McNamara <caolan.mcnamara@collabora.com>
(cherry picked from commit 7d264c9f67515623e0152515d00e07f20960d97c)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/208654
Tested-by: Jenkins
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>