summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sw/qa/extras/ooxmlexport/data/fdo77725.docxbin0 -> 295597 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport.cxx12
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx12
3 files changed, 20 insertions, 4 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/fdo77725.docx b/sw/qa/extras/ooxmlexport/data/fdo77725.docx
new file mode 100644
index 000000000000..7813459c60c2
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/fdo77725.docx
Binary files differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index b1bc8c227075..2edbd28cbc1a 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3185,6 +3185,18 @@ DECLARE_OOXMLEXPORT_TEST(testFDO75431, "fdo75431.docx")
assertXPath(pXmlDoc, "//w:p/w:pPr/w:sectPr/w:type", "val", "nextPage");
}
+DECLARE_OOXMLEXPORT_TEST(testFDO77725, "fdo77725.docx")
+{
+ xmlDocPtr pXmlFootnotes = parseExport("word/footnotes.xml");
+ if (!pXmlFootnotes)
+ return;
+
+ assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[1]", 0);
+ assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[2]", 0);
+ assertXPath(pXmlFootnotes, "//w:footnotes[1]/w:footnote[3]/w:p[3]/w:r[1]/w:br[3]", 0);
+
+}
+
DECLARE_OOXMLEXPORT_TEST(testContentTypeOLE, "fdo77759.docx")
{
xmlDocPtr pXmlDoc = parseExport("[Content_Types].xml");
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 1bc6305d33c3..7fd9a37eba7d 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1610,7 +1610,7 @@ void DocxAttributeOutput::FootnoteEndnoteRefTag()
1, meaning that it skips one character after the text. This is to make
the switch in DocxAttributeOutput::RunText() nicer ;-)
*/
-static void impl_WriteRunText( FSHelperPtr pSerializer, sal_Int32 nTextToken,
+static bool impl_WriteRunText( FSHelperPtr pSerializer, sal_Int32 nTextToken,
const sal_Unicode* &rBegin, const sal_Unicode* pEnd, bool bMove = true )
{
const sal_Unicode *pBegin = rBegin;
@@ -1620,7 +1620,7 @@ static void impl_WriteRunText( FSHelperPtr pSerializer, sal_Int32 nTextToken,
rBegin = pEnd + 1;
if ( pBegin >= pEnd )
- return; // we want to write at least one character
+ return false; // we want to write at least one character
// we have to add 'preserve' when starting/ending with space
if ( *pBegin == ' ' || *( pEnd - 1 ) == ' ' )
@@ -1633,6 +1633,8 @@ static void impl_WriteRunText( FSHelperPtr pSerializer, sal_Int32 nTextToken,
pSerializer->writeEscaped( OUString( pBegin, pEnd - pBegin ) );
pSerializer->endElementNS( XML_w, nTextToken );
+
+ return true;
}
void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCharSet*/ )
@@ -1660,8 +1662,10 @@ void DocxAttributeOutput::RunText( const OUString& rText, rtl_TextEncoding /*eCh
m_pSerializer->singleElementNS( XML_w, XML_tab, FSEND );
break;
case 0x0b: // line break
- impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt );
- m_pSerializer->singleElementNS( XML_w, XML_br, FSEND );
+ {
+ if (impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt ))
+ m_pSerializer->singleElementNS( XML_w, XML_br, FSEND );
+ }
break;
case 0x1E: //non-breaking hyphen
impl_WriteRunText( m_pSerializer, nTextToken, pBegin, pIt );