summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-05-25 11:06:46 +0100
committerCaolán McNamara <caolanm@redhat.com>2015-05-25 12:32:54 +0100
commit3185b6c8caf97afa602c864f588d079cbbe04038 (patch)
treefb645822ce5ccf1c16b584ddb017fa7c352d4d86
parentacad8441cc40b7b0f91681d6827f8364de05046e (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.odtbin0 -> 15543 bytes
-rw-r--r--sw/qa/extras/ooxmlexport/ooxmlexport5.cxx8
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx10
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
new file mode 100644
index 000000000000..0c265cf71855
--- /dev/null
+++ b/sw/qa/extras/ooxmlexport/data/hyperlink-field.odt
Binary files differ
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;
}