tdf#136929 docx export: keep frame with paragraph
commit3fd156419654ba5e2f248357a2eed5eeaad04548
authorJustin Luth <justin.luth@collabora.com>
Thu, 10 Dec 2020 08:29:53 +0000 (10 11:29 +0300)
committerMiklos Vajna <vmiklos@collabora.com>
Fri, 11 Dec 2020 10:10:27 +0000 (11 11:10 +0100)
treecd672ddd5331bd04e976e21c8c481587218e8fc1
parenta4eec60c388cc65ae0b4c8ea0fd7235f520a749d
tdf#136929 docx export: keep frame with paragraph

EndParagraph was checking if any frames were to be
attached. Well, startParagraph can occur multiple
times before endParagraph, so the frames can be
attached to the wrong paragraph. In this case,
it was moving the text-body frame into the footer.

So make a stack of these things, so that each
paragraph can keep track of it's own setting.

RTF can have endParagraph without startParagraph.
Although that doesn't seem to apply
in this DOCX-only context, just to be safe
I'm assuming that it could in theory happen
as well with a DOCX, and so never assume
that the stack exists.

Based on a code read, (and then a
confirming unit test,) things seem to be
complicated by multi-levels of textboxes
that need to be squished.

The for loop with a changing upper end
really threw me for a loop, so I'm
clearly documenting that.

Change-Id: I1060736c0a2174af125d853ff7d72265e000c8de
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/107516
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
sw/qa/extras/ooxmlexport/data/tdf136929_framesOfParagraph.odt [new file with mode: 0644]
sw/qa/extras/ooxmlexport/ooxmlexport15.cxx
sw/source/filter/ww8/docxattributeoutput.cxx
sw/source/filter/ww8/docxattributeoutput.hxx