summaryrefslogtreecommitdiff
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-08-21 05:02:46 (GMT)
committer Cédric Bosdonnat <cedric.bosdonnat@free.fr>2012-08-21 05:05:46 (GMT)
commitc1c2688912e769dfd7654e11e87dae380a8ce1eb (patch) (side-by-side diff)
tree9fcb9794bcba405462ff77bffc798d523b6d5a18
parenta873be622198c8a9ac59452e64d919d363e32d72 (diff)
downloadcore-c1c2688912e769dfd7654e11e87dae380a8ce1eb.zip
core-c1c2688912e769dfd7654e11e87dae380a8ce1eb.tar.gz
fdo#53175: Fixed the end of hyperlinks
This fixes the end of hyperlinks appearing after field ends (while the start of hyperlink is after field start too). Change-Id: If21b8973baaca183e0103e3a70ed98b99aa59392
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.cxx17
-rw-r--r--sw/source/filter/ww8/docxattributeoutput.hxx1
2 files changed, 13 insertions, 5 deletions
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index cbca1b6..71c1915 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -559,6 +559,7 @@ void DocxAttributeOutput::EndRun()
m_pSerializer->startElementNS( XML_w, XML_hyperlink, xAttrList );
m_pHyperlinkAttrList = NULL;
+ m_startedHyperlink = true;
}
DoWriteBookmarks( );
@@ -575,16 +576,21 @@ void DocxAttributeOutput::EndRun()
WritePostponedMath();
+ if ( m_closeHyperlinkInThisRun )
+ {
+ if ( m_startedHyperlink )
+ {
+ m_pSerializer->endElementNS( XML_w, XML_hyperlink );
+ m_startedHyperlink = false;
+ }
+ m_closeHyperlinkInThisRun = false;
+ }
+
while ( m_Fields.begin() != m_Fields.end() )
{
EndField_Impl( m_Fields.front( ) );
m_Fields.erase( m_Fields.begin( ) );
}
- if ( m_closeHyperlinkInThisRun )
- {
- m_pSerializer->endElementNS( XML_w, XML_hyperlink );
- m_closeHyperlinkInThisRun = false;
- }
// if there is some redlining in the document, output it
EndRedline();
@@ -4401,6 +4407,7 @@ DocxAttributeOutput::DocxAttributeOutput( DocxExport &rExport, FSHelperPtr pSeri
m_pParentFrame( NULL ),
m_closeHyperlinkInThisRun( false ),
m_closeHyperlinkInPreviousRun( false ),
+ m_startedHyperlink( false ),
m_postponedGraphic( NULL ),
m_postponedMath( NULL ),
m_postitFieldsMaxId( 0 ),
diff --git a/sw/source/filter/ww8/docxattributeoutput.hxx b/sw/source/filter/ww8/docxattributeoutput.hxx
index 24b6836..3a9c7cb 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -592,6 +592,7 @@ private:
// close of hyperlink needed
bool m_closeHyperlinkInThisRun;
bool m_closeHyperlinkInPreviousRun;
+ bool m_startedHyperlink;
struct PostponedGraphic
{