summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2015-07-06 09:23:40 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-07-06 11:57:11 +0200
commit519b34300f73b1e08f6194d6ba49d4fc010cf186 (patch)
treef2fbb7c3245d80020ed9118ee03f306492ed202d /sw
parent29fbe4bb7c28184721fa718393b2454437076940 (diff)
tdf#90611 DOCX import: fix missing paragraph style on footnotes
One one hand, a problem since commit 330b860205c7ba69dd6603f65324d0f89ad9cd5f (fdo#68787 DOCX import: handle when w:separator is missing for footnotes, 2013-09-04) was that the type attribute from <w:footnote w:type="separator"> resulted in two ooxml:CT_FtnEdn_type tokens, ignoring too many paragraph ends for footnotes, which resulted in missing paragraph style on footnotes. On the other hand, fixing the first problem showed that it wasn't correct that commit 9389cf78e304a5a99bcf1745b9388e14ac36281a (cp#1000018 RTF import: empty para at the end of footnote text got lost, 2013-11-15) unconditionally removed the RemoveLastParagraph() call in DomainMapper_Impl::PopFootOrEndnote(). It turns out that RTF and DOCX have different semantics here, the footnote is always within a <p></p> pair in DOCX, while in RTF a \par at the end of a footnote means an empty paragraph. Fix that by conditionally restoring the removed RemoveLastParagraph() call. Change-Id: I33020ac761c94addfec8164a17863565e4453b07
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/extras/ooxmlimport/data/tdf90611.docxbin0 -> 14706 bytes
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx10
2 files changed, 10 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/tdf90611.docx b/sw/qa/extras/ooxmlimport/data/tdf90611.docx
new file mode 100644
index 000000000000..ac54feedd05f
--- /dev/null
+++ b/sw/qa/extras/ooxmlimport/data/tdf90611.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index a1a2dfc2d48a..afc1f0231e8e 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -2724,6 +2724,16 @@ DECLARE_OOXMLIMPORT_TEST(testTdf87460, "tdf87460.docx")
CPPUNIT_ASSERT_EQUAL(static_cast<sal_Int32>(1), xEndnotes->getCount());
}
+DECLARE_OOXMLIMPORT_TEST(testTdf90611, "tdf90611.docx")
+{
+ uno::Reference<text::XFootnotesSupplier> xFootnotesSupplier(mxComponent, uno::UNO_QUERY);
+ uno::Reference<container::XIndexAccess> xFootnotes(xFootnotesSupplier->getFootnotes(), uno::UNO_QUERY);
+ uno::Reference<text::XText> xFootnoteText;
+ xFootnotes->getByIndex(0) >>= xFootnoteText;
+ // This was 11.
+ CPPUNIT_ASSERT_EQUAL(10.f, getProperty<float>(getParagraphOfText(1, xFootnoteText), "CharHeight"));
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();