sw/qa/extras/ooxmlexport/data/tdf150822.docx |binary sw/qa/extras/ooxmlexport/ooxmlexport25.cxx | 16 ++++++++++++++++ sw/source/writerfilter/ooxml/model.xml | 12 ++++++++++++ 3 files changed, 28 insertions(+)
New commits: commit 4575abfde5468b82e4eabf911293ca2cc77d877a Author: Jonathan Clark <jonat...@libreoffice.org> AuthorDate: Thu Jul 31 10:13:57 2025 -0600 Commit: Jonathan Clark <jonat...@libreoffice.org> CommitDate: Fri Aug 1 21:27:31 2025 +0200 tdf#150822 writerfilter: Handle ST_TextDirection in OOXML strict OOXML strict and OOXML transitional use different values for ST_TextDirection. This change adds the OOXML strict values as aliases for our already-supported transitional values, per ECMA-376 17.18.93 Change-Id: I4a1bbe9409988855de1c2b78c3f519868316841c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/188703 Reviewed-by: Jonathan Clark <jonat...@libreoffice.org> Tested-by: Jenkins diff --git a/sw/qa/extras/ooxmlexport/data/tdf150822.docx b/sw/qa/extras/ooxmlexport/data/tdf150822.docx new file mode 100644 index 000000000000..df8a2890f343 Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf150822.docx differ diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx index 7fd763d22e4a..b7681ff523d3 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport25.cxx @@ -258,6 +258,22 @@ CPPUNIT_TEST_FIXTURE(Test, testTdf167583) fnVerify(false); } +CPPUNIT_TEST_FIXTURE(Test, testTdf150822) +{ + createSwDoc("tdf150822.docx"); + + auto fnVerify = [this] { + auto pXmlDoc = parseLayoutDump(); + + // Without the fix, vertical layout won't be parsed + assertXPath(pXmlDoc, "//txt[@WritingMode='Vertical']", 3); + }; + + fnVerify(); + saveAndReload(mpFilter); + fnVerify(); +} + } // end of anonymous namespace CPPUNIT_PLUGIN_IMPLEMENT(); diff --git a/sw/source/writerfilter/ooxml/model.xml b/sw/source/writerfilter/ooxml/model.xml index 133dd0f2f48d..0d6d4514ab6f 100644 --- a/sw/source/writerfilter/ooxml/model.xml +++ b/sw/source/writerfilter/ooxml/model.xml @@ -12183,16 +12183,22 @@ <choice> <!-- Left to Right, Top to Bottom --> <value>lrTb</value> + <value>tb</value> <!-- Strict --> <!-- Top to Bottom, Right to Left --> <value>tbRl</value> + <value>rl</value> <!-- Strict --> <!-- Bottom to Top, Left to Right --> <value>btLr</value> + <value>lr</value> <!-- Strict --> <!-- Left to Right, Top to Bottom Rotated --> <value>lrTbV</value> + <value>tbV</value> <!-- Strict --> <!-- Top to Bottom, Right to Left Rotated --> <value>tbRlV</value> + <value>rlV</value> <!-- Strict --> <!-- Top to Bottom, Left to Right Rotated --> <value>tbLrV</value> + <value>lrV</value> <!-- Strict --> </choice> </define> <define name="CT_TextDirection"> @@ -17534,11 +17540,17 @@ </resource> <resource name="ST_TextDirection" resource="List"> <value tokenid="ooxml:Value_ST_TextDirection_lrTb">lrTb</value> + <value tokenid="ooxml:Value_ST_TextDirection_lrTb">tb</value> <!-- Strict --> <value tokenid="ooxml:Value_ST_TextDirection_tbRl">tbRl</value> + <value tokenid="ooxml:Value_ST_TextDirection_tbRl">rl</value> <!-- Strict --> <value tokenid="ooxml:Value_ST_TextDirection_btLr">btLr</value> + <value tokenid="ooxml:Value_ST_TextDirection_btLr">lr</value> <!-- Strict --> <value tokenid="ooxml:Value_ST_TextDirection_lrTbV">lrTbV</value> + <value tokenid="ooxml:Value_ST_TextDirection_lrTbV">tbV</value> <!-- Strict --> <value tokenid="ooxml:Value_ST_TextDirection_tbRlV">tbRlV</value> + <value tokenid="ooxml:Value_ST_TextDirection_tbRlV">rlV</value> <!-- Strict --> <value tokenid="ooxml:Value_ST_TextDirection_tbLrV">tbLrV</value> + <value tokenid="ooxml:Value_ST_TextDirection_tbLrV">lrV</value> <!-- Strict --> </resource> <resource name="CT_TextDirection" resource="Value"> <attribute name="val" tokenid="ooxml:CT_TextDirection_val" action="setValue"/>