[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - sw/qa writerfilter/source

László Németh (via logerrit) logerrit at kemper.freedesktop.org
Tue Oct 15 13:48:18 UTC 2019


 sw/qa/extras/ooxmlexport/data/tdf127814.docx    |binary
 sw/qa/extras/ooxmlexport/ooxmlexport6.cxx       |    9 +++++++++
 writerfilter/source/dmapper/StyleSheetTable.cxx |    5 +++++
 3 files changed, 14 insertions(+)

New commits:
commit be9f9630a7a394521e56cc1247ce2463e15fa796
Author:     László Németh <nemeth at numbertext.org>
AuthorDate: Tue Oct 8 13:25:10 2019 +0200
Commit:     Michael Stahl <michael.stahl at cib.de>
CommitDate: Tue Oct 15 15:47:25 2019 +0200

    tdf#127814 DOCX: fix default paragraph margin in table cells
    
    when the table is started on a new page. Undefined
    w:before in w:docDefaults/w:pPrDefault resulted 0.5 cm
    paragraph top margin instead of 0 cm.
    
    Change-Id: I94a2aa9e9c5fcee6443b74bb261c300c6a8e1303
    Reviewed-on: https://gerrit.libreoffice.org/80445
    Tested-by: Jenkins
    Reviewed-by: László Németh <nemeth at numbertext.org>
    (cherry picked from commit 88ddeed17d5a7caca407f892a094a3dcb0aff501)
    Reviewed-on: https://gerrit.libreoffice.org/80599
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>

diff --git a/sw/qa/extras/ooxmlexport/data/tdf127814.docx b/sw/qa/extras/ooxmlexport/data/tdf127814.docx
new file mode 100644
index 000000000000..10ed2348f166
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf127814.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
index 2a2a82df7b74..a2dcf0fabfde 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport6.cxx
@@ -450,6 +450,15 @@ DECLARE_OOXMLEXPORT_TEST(testTableFloatingMargins, "table-floating-margins.docx"
     assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "after", "0");
 }
 
+DECLARE_OOXMLEXPORT_TEST(testTdf127814, "tdf127814.docx")
+{
+    // Paragraph top margin was 0 in a table started on a new page
+    xmlDocPtr pXmlDoc = parseExport();
+    if (!pXmlDoc)
+        return;
+    assertXPath(pXmlDoc, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:p/w:pPr/w:spacing", "before", "0");
+}
+
 DECLARE_OOXMLEXPORT_TEST(testFdo69636, "fdo69636.docx")
 {
     /*
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index a3fc9945e1c9..2c6de04a011a 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -689,6 +689,11 @@ void StyleSheetTable::lcl_sprm(Sprm & rSprm)
         case NS_ooxml::LN_CT_DocDefaults_pPrDefault:
             m_pImpl->m_rDMapper.PushStyleSheetProperties( m_pImpl->m_pDefaultParaProps );
             resolveSprmProps( m_pImpl->m_rDMapper, rSprm );
+            if ( nSprmId == NS_ooxml::LN_CT_DocDefaults_pPrDefault && m_pImpl->m_pDefaultParaProps.get() &&
+                !m_pImpl->m_pDefaultParaProps->isSet( PROP_PARA_TOP_MARGIN ) )
+            {
+                m_pImpl->m_pDefaultParaProps->Insert( PROP_PARA_TOP_MARGIN, uno::makeAny( sal_Int32(0) ) );
+            }
             m_pImpl->m_rDMapper.PopStyleSheetProperties();
             applyDefaults( true );
             m_pImpl->m_bHasImportedDefaultParaProps = true;


More information about the Libreoffice-commits mailing list