[Libreoffice] [PATCH] Fix field values in export to docx

Lubos Lunak l.lunak at suse.cz
Thu Jul 28 08:14:27 PDT 2011


On Friday 22 of July 2011, Troy Rollo wrote:
> 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.
> ---
>  sw/source/filter/ww8/docxattributeoutput.cxx |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx
> b/sw/source/filter/ww8/docxattributeoutput.cxx index 6086213..390bd60
> 100644
> --- a/sw/source/filter/ww8/docxattributeoutput.cxx
> +++ b/sw/source/filter/ww8/docxattributeoutput.cxx
> @@ -806,8 +806,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 );

 This line looks strange. What is the reason for this?

> +        RunText( sExpand );
> +
>          m_pSerializer->endElementNS( XML_w, XML_r );
>      }

-- 
 Lubos Lunak
 l.lunak at suse.cz


More information about the LibreOffice mailing list