sw/qa/extras/ooxmlexport/ooxmlexport14.cxx |    3 +++
 sw/source/writerfilter/ooxml/model.xml     |   11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

New commits:
commit 4a120f4f557b99bb8371474a4e7fdaf52b148143
Author:     Justin Luth <justin.l...@collabora.com>
AuthorDate: Wed Apr 17 16:11:56 2024 -0400
Commit:     Miklos Vajna <vmik...@collabora.com>
CommitDate: Fri Apr 19 14:20:58 2024 +0200

    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 <jl...@mail.com>
    Reviewed-by: Miklos Vajna <vmik...@collabora.com>

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"/>

Reply via email to