tdf#129685 PPTX import: fix unexpected centering of shape text
commita3103ef8a3ef9ca2d0603781d7a13ca906667076
authorMiklos Vajna <vmiklos@collabora.com>
Fri, 18 Sep 2020 15:53:33 +0000 (18 17:53 +0200)
committerMiklos Vajna <vmiklos@collabora.com>
Tue, 22 Sep 2020 08:36:47 +0000 (22 10:36 +0200)
tree38946e013368a1f3adfb3afa9a0d585f8a0ce217
parent39a479b63abf2917abab8e1e431a9be1fc163b8e
tdf#129685 PPTX import: fix unexpected centering of shape text

Regression from commit 89f0af144c18efafe2573801641689a1432c0cae (tdf#113198 set
default shape paragraph alignment.., 2019-11-19), the old bugdoc had this
markup:

<a:bodyPr ... anchor="ctr"/> (centered)

The new bugdoc has 2 shapes with text:

<a:bodyPr .../> (aligned to left)
<a:bodyPr ... anchorCtr="1"/> (should be centered)

"anchor" is about vertical, "anchorCtr" is about horizontal centering of text.

Checking what the binary filter does, it maps horizontal centering to
TextHorizontalAdjust, so fix the original bug differently, by leaving
ParaAdjust alone, and tweaking TextHorizontalAdjust intead: this keeps the old
bugdoc working but fixes the new one.

This caused a number of "change detector" XML-based tests to fail: all of them
are unchanged visually, so the XML files are adapted to the new state.

The tdf#113198 fix itself was fixing a regression from tdf#104722, and that
commit had no testcase, I tested that we don't regress there, manually.

(cherry picked from commit 10bb02efd8afd42e633e370480104e2575546d8e)

Change-Id: I81a7b3e8c76bfbce5c5569d16d5238958ac20f75
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103136
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
oox/qa/unit/data/shape-text-alignment.pptx [new file with mode: 0644]
oox/qa/unit/drawingml.cxx
oox/source/drawingml/shape.cxx
oox/source/drawingml/textbodypropertiescontext.cxx
sd/qa/unit/data/xml/n762695_0.xml
sd/qa/unit/data/xml/n762695_1.xml
sd/qa/unit/data/xml/n819614_0.xml
sd/qa/unit/data/xml/n820786_0.xml
sd/qa/unit/data/xml/tdf109317_0.xml
sd/qa/unit/import-tests.cxx