diff options
author | Caolán McNamara <caolanm@redhat.com> | 2015-05-25 11:06:46 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-05-25 12:32:54 +0100 |
commit | 3185b6c8caf97afa602c864f588d079cbbe04038 (patch) | |
tree | fb645822ce5ccf1c16b584ddb017fa7c352d4d86 | |
parent | acad8441cc40b7b0f91681d6827f8364de05046e (diff) |
fix assert on export of ooo40760-1.sxw to docx
and a pile more
Change-Id: I7334233c789bb0ed7a60387ef7d84dd34ab5a187
-rw-r--r-- | sw/qa/extras/ooxmlexport/data/hyperlink-field.odt | bin | 0 -> 15543 bytes | |||
-rw-r--r-- | sw/qa/extras/ooxmlexport/ooxmlexport5.cxx | 8 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxattributeoutput.cxx | 10 |
3 files changed, 13 insertions, 5 deletions
diff --git a/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt b/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt Binary files differnew file mode 100644 index 000000000000..0c265cf71855 --- /dev/null +++ b/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx index 47589f6dafc0..f97d6a3a2329 100644 --- a/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmlexport5.cxx @@ -270,6 +270,14 @@ DECLARE_OOXMLEXPORT_TEST(testOldComplexMergeTableInTable, "ooo96040-2.odt") return; } +DECLARE_OOXMLEXPORT_TEST(testHyperlinkContainingPlaceholderField, "hyperlink-field.odt") +{ + xmlDocPtr pXmlDoc = parseExport("word/document.xml"); + + if (!pXmlDoc) + return; +} + DECLARE_OOXMLEXPORT_TEST(testTablePreferredWidth, "tablePreferredWidth.docx") { xmlDocPtr pXmlDoc = parseExport("word/document.xml"); diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 3694f3f09912..430025a42bbd 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1058,11 +1058,6 @@ void DocxAttributeOutput::EndRun() { StartField_Impl( *pIt ); - if ( m_pHyperlinkAttrList ) - { - m_nFieldsInHyperlink++; - } - // Remove the field from the stack if only the start has to be written // Unknown fields should be removed too if ( !pIt->bClose || ( pIt->eType == ww::eUNKNOWN ) ) @@ -1070,6 +1065,11 @@ void DocxAttributeOutput::EndRun() pIt = m_Fields.erase( pIt ); continue; } + + if ( m_pHyperlinkAttrList ) + { + m_nFieldsInHyperlink++; + } } ++pIt; } |