[Libreoffice-commits] .: Branch 'libreoffice-3-6' - sw/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Tue Aug 21 00:26:30 PDT 2012


 sw/source/filter/ww8/docxattributeoutput.cxx |   17 ++++++++++++-----
 sw/source/filter/ww8/docxattributeoutput.hxx |    1 +
 2 files changed, 13 insertions(+), 5 deletions(-)

New commits:
commit f672ba611a8cef83acad3233d27dc6414b463a42
Author: Cédric Bosdonnat <cedric.bosdonnat at free.fr>
Date:   Tue Aug 21 07:02:46 2012 +0200

    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 at suse.cz>

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 71d39af..34e383c 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 788905f..db78516 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
     {


More information about the Libreoffice-commits mailing list