diff options
author | Justin Luth <justin.luth@collabora.com> | 2018-10-10 12:01:04 +0300 |
---|---|---|
committer | Justin Luth <justin_luth@sil.org> | 2018-10-12 05:56:58 +0200 |
commit | 0a452b5005744d96f37fcb29b37a84e23a04bf8e (patch) | |
tree | 855d95e24e88792b912be1a85e1ce4b9197c2d9a /sw | |
parent | 579c0749bef8c980507229439715e72060c1b077 (diff) |
tdf120224 docx export: don't double up field bookmarks
fields are internal bookmarks. When the exporter runs
through the bookmarks, it will already write out a bookmark
entry, so don't output a separate one for the fieldmark.
Change-Id: I84af2989035507ac745d028f1585d60d8823ff8b
Reviewed-on: https://gerrit.libreoffice.org/61616
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/wrtw8nds.cxx | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx index 32353635a075..533f787393a6 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2327,8 +2327,11 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) ::sw::mark::IFieldmark const * const pFieldmark = pMarkAccess->getFieldmarkFor( aPosition ); OSL_ENSURE( pFieldmark, "Looks like this doc is broken...; where is the Fieldmark for the FIELDSTART??" ); - if ( pFieldmark && pFieldmark->GetFieldname() == ODF_FORMTEXT ) - AppendBookmark( pFieldmark->GetName() ); + if ( pFieldmark && pFieldmark->GetFieldname() == ODF_FORMTEXT + && GetExportFormat() != MSWordExportBase::ExportFormat::DOCX ) + { + AppendBookmark( pFieldmark->GetName() ); + } ww::eField eFieldId = lcl_getFieldId( pFieldmark ); OUString sCode = lcl_getFieldCode( pFieldmark ); if ( pFieldmark && pFieldmark->GetFieldname() == ODF_UNHANDLED ) @@ -2391,8 +2394,11 @@ void MSWordExportBase::OutputTextNode( SwTextNode& rNode ) OutputField( nullptr, eFieldId, OUString(), FieldFlags::Close ); - if ( pFieldmark && pFieldmark->GetFieldname() == ODF_FORMTEXT ) + if ( pFieldmark && pFieldmark->GetFieldname() == ODF_FORMTEXT + && GetExportFormat() != MSWordExportBase::ExportFormat::DOCX ) + { AppendBookmark( pFieldmark->GetName() ); + } } else if ( ch == CH_TXT_ATR_FORMELEMENT ) { |