summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2013-09-04 17:19:47 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2013-09-04 17:34:45 +0200
commit3f2774c771fc54757364ed50fab9b4753d067371 (patch)
tree43fc1abdd08a04eabbff80a795a164f505c488a3
parent3a021c00d9b27e6bcafbfaf8bf7b36cdd40768e2 (diff)
fdo#68787 DOCX export: handle zero width footnote separator
Change-Id: Ieb1d8d1f8609558b4af06630b603a51da3e665f4
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo68787.docx (renamed from sw/qa/extras/ooxmlimport/data/fdo68787.docx)bin14436 -> 14436 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx9
-rw-r--r--sw/qa/extras/ooxmlimport/ooxmlimport.cxx9
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx12
4 files changed, 20 insertions, 10 deletions
diff --git a/sw/qa/extras/ooxmlimport/data/fdo68787.docx b/sw/qa/extras/ooxmlexport/data/fdo68787.docx
index c47b80995848..c47b80995848 100644
--- a/sw/qa/extras/ooxmlimport/data/fdo68787.docx
+++ b/sw/qa/extras/ooxmlexport/data/fdo68787.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 1445cccceb11..5dc83f5b2d1a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -115,6 +115,7 @@ public:
void testBnc834035();
void testFdo68418();
void testA4AndBorders();
+ void testFdo68787();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -206,6 +207,7 @@ void Test::run()
{"bnc834035.odt", &Test::testBnc834035},
{"fdo68418.docx", &Test::testFdo68418},
{"a4andborders.docx", &Test::testA4AndBorders},
+ {"fdo68787.docx", &Test::testFdo68787},
};
// Don't test the first import of these, for some reason those tests fail
const char* aBlacklist[] = {
@@ -1264,6 +1266,13 @@ void Test::testA4AndBorders()
CPPUNIT_ASSERT_EQUAL_MESSAGE("Incorrect Page Height (mm)", sal_Int32(297), getProperty<sal_Int32>(xPageStyle, "Height") / 100);
}
+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();
diff --git a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
index bfae9a30da3c..973f3b193db5 100644
--- a/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
+++ b/sw/qa/extras/ooxmlimport/ooxmlimport.cxx
@@ -131,7 +131,6 @@ public:
void testTableStyleParprop();
void testTablePagebreak();
void testFdo68607();
- void testFdo68787();
CPPUNIT_TEST_SUITE(Test);
#if !defined(MACOSX) && !defined(WNT)
@@ -229,7 +228,6 @@ 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)
@@ -1542,13 +1540,6 @@ 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();
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 342bd750215e..7f08f583b62b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -4340,7 +4340,17 @@ void DocxAttributeOutput::FootnotesEndnotes( bool bFootnotes )
FSEND );
m_pSerializer->startElementNS( XML_w, XML_p, FSEND );
m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
- m_pSerializer->singleElementNS( XML_w, XML_separator, FSEND );
+
+ bool bSeparator = true;
+ if (bFootnotes)
+ {
+ const SwPageFtnInfo& rFtnInfo = m_rExport.pDoc->GetPageDesc(0).GetFtnInfo();
+ // Request a separator only in case the width is larger than zero.
+ bSeparator = double(rFtnInfo.GetWidth()) > 0;
+ }
+
+ if (bSeparator)
+ m_pSerializer->singleElementNS( XML_w, XML_separator, FSEND );
m_pSerializer->endElementNS( XML_w, XML_r );
m_pSerializer->endElementNS( XML_w, XML_p );
m_pSerializer->endElementNS( XML_w, nItem );