diff options
author | Justin Luth <justin.luth@collabora.com> | 2018-10-10 12:01:04 +0300 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2018-10-13 20:44:09 +0200 |
commit | ff2067b3d5149c35de17bf1939a34849ae6608aa (patch) | |
tree | c673bb70db68278155322a0fea324813bf2f9122 | |
parent | 55728c04006b791a5380e9a4145c593287ec33ca (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>
(cherry picked from commit 0a452b5005744d96f37fcb29b37a84e23a04bf8e)
-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 20a43e27cd30..9361943a7636 100644 --- a/sw/source/filter/ww8/wrtw8nds.cxx +++ b/sw/source/filter/ww8/wrtw8nds.cxx @@ -2406,8 +2406,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 ) @@ -2470,8 +2473,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 ) { |