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

Miklos Vajna vmiklos at collabora.co.uk
Mon Nov 23 09:12:45 PST 2015


 sw/qa/extras/ooxmlimport/data/tdf83300.docx     |binary
 sw/qa/extras/ooxmlimport/ooxmlimport.cxx        |    6 ++++++
 writerfilter/source/dmapper/StyleSheetTable.cxx |    1 -
 3 files changed, 6 insertions(+), 1 deletion(-)

New commits:
commit 0750162d3dbdd1bbd01ad01c383a26199e58419a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Mon Nov 16 20:41:32 2015 +0100

    tdf#83300 DOCX import: 'TOC Heading' should not be 'keep with next' by default
    
    On one hand, neither our binary DOC import, nor Word maps the "TOC
    Heading" style to something special, and that's how the DOCX import
    added that property to some paragraphs in the document, moving the
    as-char picture from the first to the second page.
    
    OTOH, the DOCX export filter has a lcl_guessQFormat() function that
    explicitly assumes that such a style name exists in Writer document
    models, so again it doesn't make sense to handle this style name with
    special care.
    
    Change-Id: I3af548930f9683695fc3ad56b486e013f107d61a
    (cherry picked from commit 70f3c595cae858e97616bf1f23adea8a75e42d4b)
    Reviewed-on: https://gerrit.libreoffice.org/20037
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/qa/extras/ooxmlimport/data/tdf83300.docx b/sw/qa/extras/ooxmlimport/data/tdf83300.docx
new file mode 100644
index 0000000..aa3ad22
Binary files /dev/null and b/sw/qa/extras/ooxmlimport/data/tdf83300.docx differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index d463bf4..c56ed5e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2836,6 +2836,12 @@ DECLARE_OOXMLIMPORT_TEST(testTdf94374, "hello.docx")
     CPPUNIT_ASSERT(paste("tdf94374.docx", xEnd));
 }
 
+DECLARE_OOXMLIMPORT_TEST(testTdf83300, "tdf83300.docx")
+{
+    // This was 'Contents Heading', which (in the original document) implied 'keep with next' on unexpected paragraphs.
+    CPPUNIT_ASSERT_EQUAL(OUString("TOC Heading"), getProperty<OUString>(getParagraph(1), "ParaStyleName"));
+}
+
 DECLARE_OOXMLIMPORT_TEST(testTdf85232, "tdf85232.docx")
 {
     uno::Reference<drawing::XShapes> xShapes(getShapeByName("Group 219"), uno::UNO_QUERY);
diff --git a/writerfilter/source/dmapper/StyleSheetTable.cxx b/writerfilter/source/dmapper/StyleSheetTable.cxx
index 211d2a0..e95e755 100644
--- a/writerfilter/source/dmapper/StyleSheetTable.cxx
+++ b/writerfilter/source/dmapper/StyleSheetTable.cxx
@@ -1359,7 +1359,6 @@ static const sal_Char* const aStyleNamePairs[] =
     "TOC 7",                     "Contents 7",
     "TOC 8",                     "Contents 8",
     "TOC 9",                     "Contents 9",
-    "TOC Heading",               "Contents Heading",
     "TOCHeading",                "Contents Heading",
     "toc 1",                     "Contents 1",
     "toc 2",                     "Contents 2",


More information about the Libreoffice-commits mailing list