summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2015-06-18 00:13:57 +0200
committerMichael Stahl <mstahl@redhat.com>2015-06-18 00:36:29 +0200
commit84ea33ef9a86f097a248b526554cdc3581c8d725 (patch)
tree5c6a6bf11b5aaa53103768a3f0a4d16cde95002c
parent1f154e31bf609dc32001a271fa13f9302f18a207 (diff)
sw: DOCX export fix non-well-formed XML if hyperlink followed by ruby
If a hyperlink ends on the same position as a ruby starts, the hyperlink is not closed before the ruby so its end tag is written inside the ruby element. Example: fdo82849-1.odt Change-Id: I4531327ee23a99e366c2de5d9b08ddabb1be69c7
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index fd4af965e7f6..577fb3fa3988 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2131,6 +2131,12 @@ void DocxAttributeOutput::RawText( const OUString& /*rText*/, bool /*bForceUnico
void DocxAttributeOutput::StartRuby( const SwTextNode& rNode, sal_Int32 nPos, const SwFormatRuby& rRuby )
{
OSL_TRACE("TODO DocxAttributeOutput::StartRuby( const SwTextNode& rNode, const SwFormatRuby& rRuby )" );
+ if (m_closeHyperlinkInThisRun)
+ {
+ EndRun(); // end hyperlink before starting ruby to avoid overlap
+ assert(!m_closeHyperlinkInThisRun);
+ assert(!m_closeHyperlinkInPreviousRun);
+ }
m_pSerializer->startElementNS( XML_w, XML_ruby, FSEND );
m_pSerializer->startElementNS( XML_w, XML_rubyPr, FSEND );
// hps