summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCédric Bosdonnat <cedric.bosdonnat@free.fr>2012-08-21 07:02:46 +0200
committerPetr Mladek <pmladek@suse.cz>2012-08-21 15:36:11 +0200
commit636e8f07d17f33e3b67137be805f8a0fdf3e0299 (patch)
treeaae05570bdddc8f3c1544a3b768d17218674a6d7
parent59bf2b14da0be958ded27ba7c5f180290cb53489 (diff)
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 (cherry picked from commit c1c2688912e769dfd7654e11e87dae380a8ce1eb) Signed-off-by: Miklos Vajna <vmiklos@suse.cz> Signed-off-by: Petr Mladek <pmladek@suse.cz> Signed-off-by: Michael Stahl <mstahl@redhat.com>
-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 71d39af70793..34e383cc2ae6 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -573,6 +573,7 @@ void DocxAttributeOutput::EndRun()
m_pSerializer->startElementNS( XML_w, XML_hyperlink, xAttrList );
m_pHyperlinkAttrList = NULL;
+ m_startedHyperlink = true;
}
DoWriteBookmarks( );
@@ -588,16 +589,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();
@@ -4375,6 +4381,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 788905f00183..db78516c38c9 100644
--- a/sw/source/filter/ww8/docxattributeoutput.hxx
+++ b/sw/source/filter/ww8/docxattributeoutput.hxx
@@ -590,6 +590,7 @@ private:
// close of hyperlink needed
bool m_closeHyperlinkInThisRun;
bool m_closeHyperlinkInPreviousRun;
+ bool m_startedHyperlink;
struct PostponedGraphic
{