[Libreoffice-commits] .: 2 commits - sw/source

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Aug 5 16:54:04 PDT 2011


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

New commits:
commit 17cfd534d10d7394679978e04a95543793f99e99
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Sat Aug 6 01:52:19 2011 +0200

    Add a comment based on the Caolan's explanation.

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index a1045c4..608c443 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -808,6 +808,8 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos )
         m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
 
         String sExpand( rInfos.pField->ExpandField( true ) );
+        // newlines embedded in fields are 0x0B in MSO and 0x0A for us
+        // [maybe this is not necessary in docx, but safer to do]
         sExpand.SearchAndReplaceAll( 0x0A, 0x0B );
         RunText( sExpand );
 
commit 607f7c2dd2549e979087f026da03a3310292f374
Author: Troy Rollo <libreoffice at troy.rollo.name>
Date:   Sat Jul 23 00:18:43 2011 +1000

    Fix field values in export to docx
    
    Prior to this patch, fields were being exported to docx file with the
    field value being the name of the field. This patch changes it to
    export the field value as the field value.

diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index b978394..a1045c4 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -807,8 +807,10 @@ void DocxAttributeOutput::EndField_Impl( FieldInfos& rInfos )
         // Write the Field latest value
         m_pSerializer->startElementNS( XML_w, XML_r, FSEND );
 
-        // Find another way for hyperlinks
-        RunText( rInfos.pField->GetFieldName() );
+        String sExpand( rInfos.pField->ExpandField( true ) );
+        sExpand.SearchAndReplaceAll( 0x0A, 0x0B );
+        RunText( sExpand );
+
         m_pSerializer->endElementNS( XML_w, XML_r );
     }
 


More information about the Libreoffice-commits mailing list