summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2017-03-29 16:43:23 +0200
committerMichael Stahl <mstahl@redhat.com>2017-03-29 17:31:49 +0200
commitab4f53eaad0c064d9b2ff1c2cb20560f81ade1f7 (patch)
treed034d50a5ea1972977cffc32007f534b408be647 /sw
parent30102ded91b9ecfea172ffc6443154230ee37cbd (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
Diffstat (limited to 'sw')
-rw-r--r--sw/source/filter/ascii/ascatr.cxx12
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;