diff options
author | Justin Luth <justin.luth@collabora.com> | 2024-04-17 16:11:56 -0400 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2024-04-19 14:20:58 +0200 |
commit | 4a120f4f557b99bb8371474a4e7fdaf52b148143 (patch) | |
tree | d2a692f8df5fd28b8c0b58e76d985f75de7bfa9d | |
parent | 91bdf6c3ad57a0cc74aad64aa9828ba6b95468b7 (diff) |
tdf#140616 writerfilter: recognize style rPr under pPr
Although it is completely NOT normal to put any rPr's
in the style's pPr (since they normally just go
into a stand-alone rPr), MSO is able to read and apply
those - while LO just ignored them (as misplaced properties).
It seems harmless to me to import it this way as well.
make CppunitTest_sw_ooxmlexport14 \
CPPUNIT_TEST_NAME=testHighlightEdit_numbering
Change-Id: Ie4a6c4c91a8214f40e34dc58c47b0bb9381bac1f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/166189
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport14.cxx | 3 | ||||
-rw-r--r-- | sw/source/writerfilter/ooxml/model.xml | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx index c33275b62394..6528b093fd57 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport14.cxx @@ -963,6 +963,9 @@ CPPUNIT_TEST_FIXTURE(Test, testHighlightEdit_numbering) assertXPath(pXmlDoc, "//w:body/w:p[2]/w:pPr/w:rPr/w:highlight"_ostr, "val"_ostr, "none"); // Visually, the "none" highlight means the bullet point should not have a character background. + xmlDocUniquePtr pXmlStyles = parseExport("word/styles.xml"); + assertXPath(pXmlStyles, "//w:style[@w:styleId='CustomParaStyleHighlightGreen']/w:rPr/w:highlight"_ostr, "val"_ostr, "green"); + if (bWasExportToShade) { officecfg::Office::Common::Filter::Microsoft::Export::CharBackgroundToHighlighting::set(false, batch); diff --git a/sw/source/writerfilter/ooxml/model.xml b/sw/source/writerfilter/ooxml/model.xml index 2f84e72c0615..c99eb836ffe6 100644 --- a/sw/source/writerfilter/ooxml/model.xml +++ b/sw/source/writerfilter/ooxml/model.xml @@ -12620,6 +12620,12 @@ <ref name="CT_Cnf"/> </element> </define> + <define name="CT_Style_pPr"> + <ref name="CT_PPrBase"/> + <element name="rPr"> + <ref name="CT_ParaRPr"/> + </element> + </define> <define name="CT_PPr"> <ref name="CT_PPrBase"/> <element name="rPr"> @@ -16226,7 +16232,7 @@ <ref name="CT_LongHexNumber"/> </element> <element name="pPr"> - <ref name="CT_PPrBase"/> + <ref name="CT_Style_pPr"/> </element> <element name="rPr"> <ref name="EG_RPrBase"/> @@ -17739,6 +17745,9 @@ <element name="divId" tokenid="ooxml:CT_PPrBase_divId"/> <element name="cnfStyle" tokenid="ooxml:CT_PPrBase_cnfStyle"/> </resource> + <resource name="CT_Style_pPr" resource="Properties"> + <element name="rPr" tokenid="ooxml:CT_PPr_rPr"/> + </resource> <resource name="CT_PPr" resource="Properties"> <element name="rPr" tokenid="ooxml:CT_PPr_rPr"/> <element name="sectPr" tokenid="ooxml:CT_PPr_sectPr"/> |