[Libreoffice-commits] core.git: sw/source

Caolán McNamara caolanm at redhat.com
Tue Jun 2 09:40:32 PDT 2015


 sw/source/filter/ww8/docxattributeoutput.cxx |    8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

New commits:
commit 6d50c6ccdf85e7d01f16d3edb957eed2a4ad5e47
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Jun 2 16:00:59 2015 +0100

    move ++m_nFieldsInHyperlink from StartField_Impl to callers
    
    no logic change at all, justs makes it clear the dubiousness
    of this unconditional increment
    
    Change-Id: I32e3cb2c45b1b45826a59642c33ab850d698c206

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 8d7632a..16068b0 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -1058,6 +1058,9 @@ void DocxAttributeOutput::EndRun()
         {
             StartField_Impl( *pIt );
 
+            if (m_startedHyperlink)
+                ++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 ) )
@@ -1123,6 +1126,9 @@ void DocxAttributeOutput::EndRun()
         {
             StartField_Impl( *pIt, true );
 
+            if (m_startedHyperlink)
+                ++m_nFieldsInHyperlink;
+
             // Remove the field if no end needs to be written
             if ( !pIt->bClose ) {
                 pIt = m_Fields.erase( pIt );
@@ -1412,8 +1418,6 @@ void DocxAttributeOutput::WriteFFData(  const FieldInfos& rInfos )
 
 void DocxAttributeOutput::StartField_Impl( FieldInfos& rInfos, bool bWriteRun )
 {
-    if ( m_startedHyperlink )
-        ++m_nFieldsInHyperlink;
     if ( rInfos.pField && rInfos.eType == ww::eUNKNOWN )
     {
         // Expand unsupported fields


More information about the Libreoffice-commits mailing list