diff options
author | Michael Stahl <mstahl@redhat.com> | 2017-03-29 16:43:23 +0200 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-04-04 12:19:42 +0200 |
commit | 5b6fd648f020a9e84d1b68491ca06aa2e8fb86e2 (patch) | |
tree | 11fb55e7650d40b42da2b6ba8a3b0433cef9b672 /sw | |
parent | ec52c2f4b7090ced1810b23fd6cc5fb2db4215d2 (diff) |
sw: plain-text ASCII export: filter out all CH_TXT_ATR_*
These control characters are Writer implementation details and should
not be available via public interfaces.
This filter is also used by SwXTextRange::getString().
Change-Id: If656ee3d451dbefe2f7a905e8b63a44cdb787809
(cherry picked from commit ab4f53eaad0c064d9b2ff1c2cb20560f81ade1f7)
Reviewed-on: https://gerrit.libreoffice.org/35862
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
(cherry picked from commit 5254a7d1cbf3f62c6664299752d2788bb4f2a0b4)
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ascii/ascatr.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/filter/ascii/ascatr.cxx b/sw/source/filter/ascii/ascatr.cxx index 4c0037a992c7..01c1caf673f7 100644 --- a/sw/source/filter/ascii/ascatr.cxx +++ b/sw/source/filter/ascii/ascatr.cxx @@ -206,6 +206,18 @@ static Writer& OutASC_SwTextNode( Writer& rWrt, SwContentNode& rNode ) if ( !bExportSoftHyphens ) aOutStr = aOutStr.replaceAll(OUStringLiteral1(CHAR_SOFTHYPHEN), ""); + // all INWORD/BREAKWORD should be already removed by OutAttr + // but the field-marks are not attributes so filter those + static sal_Unicode const forbidden [] = { + CH_TXT_ATR_INPUTFIELDSTART, + CH_TXT_ATR_INPUTFIELDEND, + CH_TXT_ATR_FORMELEMENT, + CH_TXT_ATR_FIELDSTART, + CH_TXT_ATR_FIELDEND, + 0 + }; + aOutStr = comphelper::string::removeAny(aOutStr, forbidden); + rWrt.Strm().WriteUnicodeOrByteText( aOutStr ); } nStrPos = nNextAttr; |