sw/source/filter/ww8/docxattributeoutput.cxx | 16 +++++++++++++--- sw/source/filter/ww8/ww8atr.cxx | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-)
New commits: commit a072b3533f44730565f42b45cfd9f77f44f506a9 Author: Eilidh McAdam <eilidh.mca...@itomig.de> Date: Tue Dec 9 19:53:56 2014 +0000 fdo#59886 export fixed date and time fields to docx. Fixed date and time fields are supported in OOXML by adding the attribute fldLock="true" to the fldChar element. This applies only to the first instance of fldChar in a field (i.e. when fldCharType is "begin"). Change-Id: Ibb84503b942ca20b53fe476e5006d64b2f3112e5 Reviewed-on: https://gerrit.libreoffice.org/13429 Reviewed-by: Miklos Vajna <vmik...@collabora.co.uk> Tested-by: Miklos Vajna <vmik...@collabora.co.uk> diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx index 4386d5b..87c193b 100644 --- a/sw/source/filter/ww8/docxattributeoutput.cxx +++ b/sw/source/filter/ww8/docxattributeoutput.cxx @@ -1443,9 +1443,19 @@ void DocxAttributeOutput::StartField_Impl( FieldInfos& rInfos, bool bWriteRun ) else { // Write the field start - m_pSerializer->startElementNS( XML_w, XML_fldChar, - FSNS( XML_w, XML_fldCharType ), "begin", - FSEND ); + if ( rInfos.pField && rInfos.pField->GetSubType() & FIXEDFLD ) + { + m_pSerializer->startElementNS( XML_w, XML_fldChar, + FSNS( XML_w, XML_fldCharType ), "begin", + FSNS( XML_w, XML_fldLock ), "true", + FSEND ); + } + else + { + m_pSerializer->startElementNS( XML_w, XML_fldChar, + FSNS( XML_w, XML_fldCharType ), "begin", + FSEND ); + } if ( rInfos.pFieldmark ) WriteFFData( rInfos ); diff --git a/sw/source/filter/ww8/ww8atr.cxx b/sw/source/filter/ww8/ww8atr.cxx index 4b7907f..be73977 100644 --- a/sw/source/filter/ww8/ww8atr.cxx +++ b/sw/source/filter/ww8/ww8atr.cxx @@ -2861,7 +2861,7 @@ void AttributeOutputBase::TextField( const SwFmtFld& rField ) case RES_DATETIMEFLD: { OUString sStr; - if (FIXEDFLD & nSubType || !GetExport().GetNumberFmt(*pFld, sStr)) + if (!GetExport().GetNumberFmt(*pFld, sStr)) bWriteExpand = true; else { _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits