[Libreoffice-commits] core.git: 2 commits - sw/qa sw/source writerfilter/source

Michael Stahl mstahl at redhat.com
Wed Mar 5 15:24:29 PST 2014


 sw/qa/extras/ooxmlimport/data/rhbz988516.docx |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx      |   12 ++++++++++++
 sw/source/core/unocore/unotext.cxx            |    2 ++
 writerfilter/source/ooxml/model.xml           |    4 +++-
 4 files changed, 17 insertions(+), 1 deletion(-)

New commits:
commit 2b78f2cd7b9e4bab0f3b3b9119238f36a1bbc7b2
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 5 23:29:06 2014 +0100

    rhbz#988516: DOCX import: fix context stack when importing header/footer
    
    When a header/footer substream is parsed, a ParagraphGroup is started,
    but not ended; so the properties of the last paragraph in the
    header/footer are applied to a paragraph in the body.
    
    The obvious fix to add a call to endParagraphGroup() at the end of w:p
    element breaks table cells.  So add a call to endParagraphGroup() at
    the end of the "hdr"/"ftr" element.
    
    (The problem in the bugdoc became much more visible with commit
    ca555c596043c88894b964ac5e21f5a7271d5f3b, but was there before)
    
    Change-Id: Ib054f1882793049b39424c1076ba5d4b319cd027

diff --git a/sw/qa/extras/ooxmlimport/data/rhbz988516.docx b/sw/qa/extras/ooxmlimport/data/rhbz988516.docx
new file mode 100644
index 0000000..38e2dcf
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/rhbz988516.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index 2392899..4f384d8 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -198,6 +198,18 @@ DECLARE_OOXMLIMPORT_TEST(testN757890, "n757890.docx")
     CPPUNIT_ASSERT_EQUAL(text::HoriOrientation::CENTER, nValue);
 }
 
+DECLARE_OOXMLIMPORT_TEST(testRhbz988516, "rhbz988516.docx")
+{
+    // The problem was that the list properties of the footer leaked into body
+    CPPUNIT_ASSERT_EQUAL(OUString(),
+            getProperty<OUString>(getParagraph(1), "NumberingStyleName"));
+    CPPUNIT_ASSERT_EQUAL(OUString("Enclosure 3"), getParagraph(2)->getString());
+    CPPUNIT_ASSERT_EQUAL(OUString(),
+            getProperty<OUString>(getParagraph(2), "NumberingStyleName"));
+    CPPUNIT_ASSERT_EQUAL(OUString(),
+            getProperty<OUString>(getParagraph(3), "NumberingStyleName"));
+}
+
 DECLARE_OOXMLIMPORT_TEST(testFdo49940, "fdo49940.docx")
 {
     uno::Reference<text::XTextDocument> xTextDocument(mxComponent, uno::UNO_QUERY);
diff --git a/writerfilter/source/ooxml/model.xml b/writerfilter/source/ooxml/model.xml
index 8739717..70289f5 100644
--- a/writerfilter/source/ooxml/model.xml
+++ b/writerfilter/source/ooxml/model.xml
@@ -24210,7 +24210,9 @@
       <element name="headerReference" tokenid="ooxml:EG_HdrFtrReferences_headerReference"/>
       <element name="footerReference" tokenid="ooxml:EG_HdrFtrReferences_footerReference"/>
     </resource>
-    <resource name="CT_HdrFtr" resource="Stream" tag="header"/>
+    <resource name="CT_HdrFtr" resource="Stream" tag="header">
+      <action name="end" action="endParagraphGroup"/>
+    </resource>
     <resource name="EG_SectPrContents" resource="Properties" tag="section">
       <element name="bidi" tokenid="ooxml:EG_SectPrContents_bidi"/>
       <element name="cols" tokenid="ooxml:EG_SectPrContents_cols"/>
commit d3fcaef7dce044b7e053278a7ea972dc957ca7e2
Author: Michael Stahl <mstahl at redhat.com>
Date:   Wed Mar 5 15:01:36 2014 +0100

    SwXText::convertToTable(): assert that SwTable is client of table format
    
    ... which is wild guessing related to crash in rhbz#1010982.
    
    Change-Id: Ifbd9309a5cff1fff3a8c6022d3a20b2b8c175dce

diff --git a/sw/source/core/unocore/unotext.cxx b/sw/source/core/unocore/unotext.cxx
index 88e596b..721dda0 100644
--- a/sw/source/core/unocore/unotext.cxx
+++ b/sw/source/core/unocore/unotext.cxx
@@ -2319,6 +2319,8 @@ throw (lang::IllegalArgumentException, uno::RuntimeException, std::exception)
     {
     }
 
+    assert(SwTable::FindTable(pTable->GetFrmFmt()) == pTable);
+    assert(pTable->GetFrmFmt() == pTextTable->GetFrmFmt());
     return xRet;
 }
 


More information about the Libreoffice-commits mailing list