diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-09-04 16:08:49 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-09-04 16:44:51 +0200 |
commit | 330b860205c7ba69dd6603f65324d0f89ad9cd5f (patch) | |
tree | 39f845453bbf0c1cb6d2b7f0d7f95860b1a3f226 /sw/qa | |
parent | dc86610d16a561ff1a0455d5fef157431f9271e3 (diff) |
fdo#68787 DOCX import: handle when w:separator is missing for footnotes
There were two problems here:
1) OOXML has no way to explicitly disable the footnote separator, what
is does is that it omits the <w:separator/> element in that case. We
didn't parse that previously -- now we do, and if it's missing, the
separator is disabled.
2) The footnote stream isn't read by the importer, only when the main
stream references the footnote one, the relevant part of it is parsed.
At the moment we always parse the first (special, "separator") entry in
the footnote stream, that may be optimized later if it becomes a
bottleneck.
Change-Id: Ie588270a212fc90fc41095029a362cfd832b24f8
Diffstat (limited to 'sw/qa')
-rw-r--r-- | sw/qa/extras/ooxmlimport/data/fdo68787.docx | bin | 0 -> 14436 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlimport/ooxmlimport.cxx | 9 |
2 files changed, 9 insertions, 0 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo68787.docx b/sw/qa/extras/ooxmlimport/data/fdo68787.docx Binary files differnew file mode 100644 index 000000000000..c47b80995848 --- /dev/null +++ b/sw/qa/extras/ooxmlimport/data/fdo68787.docx diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx index 973f3b193db5..bfae9a30da3c 100644 --- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx +++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx @@ -131,6 +131,7 @@ public: void testTableStyleParprop(); void testTablePagebreak(); void testFdo68607(); + void testFdo68787(); CPPUNIT_TEST_SUITE(Test); #if !defined(MACOSX) && !defined(WNT) @@ -228,6 +229,7 @@ void Test::run() {"table-style-parprop.docx", &Test::testTableStyleParprop}, {"table-pagebreak.docx", &Test::testTablePagebreak}, {"fdo68607.docx", &Test::testFdo68607}, + {"fdo68787.docx", &Test::testFdo68787}, }; header(); for (unsigned int i = 0; i < SAL_N_ELEMENTS(aMethods); ++i) @@ -1540,6 +1542,13 @@ void Test::testFdo68607() CPPUNIT_ASSERT(getPages() > 1); } +void Test::testFdo68787() +{ + uno::Reference<beans::XPropertySet> xPageStyle(getStyles("PageStyles")->getByName(DEFAULT_STYLE), uno::UNO_QUERY); + // This was 25, the 'lack of w:separator' <-> '0 line width' mapping was missing. + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), getProperty<sal_Int32>(xPageStyle, "FootnoteLineRelativeWidth")); +} + CPPUNIT_TEST_SUITE_REGISTRATION(Test); CPPUNIT_PLUGIN_IMPLEMENT(); |