summaryrefslogtreecommitdiff
path: root/writerfilter/source/rtftok/rtfdocumentimpl.cxx
diff options
context:
space:
mode:
authorLászló Németh <nemeth@numbertext.org>2019-11-11 10:05:12 +0100
committerLászló Németh <nemeth@numbertext.org>2019-11-11 11:38:36 +0100
commit24f17f0336badfbba276c1e6713a89b4f9bb7cb8 (patch)
tree186b623027bc0edca336ae448716904b8c6436e8 /writerfilter/source/rtftok/rtfdocumentimpl.cxx
parent5e279f175289234b91f272bbbf48e70315fff5ac (diff)
tdf#128428 RTF: clean-up for longer space sequence mode
Fix regressions from commit 24b04db5a63b57a74e58a7616091437ad68548ac (tdf#123703 RTF import: fix length of space character sequence). It seems, longer space sequence is an obsolete RTF-only feature, eg. new RTF documents created in MSO don't use it, but old RTF documents still keep their layout (only in RTF). - Only old-style (without \stshfdbch) or compatible (\stshfdbch31505) RTF documents get longer space sequences using a one-time conversion; - because Writer always exports old-style RTF documents, to avoid of enlargement of space sequences of new-style RTF documents later, RTF import doesn't modify the RTF documents saved in Writer (checking \generator); - text in monospaced font "Courier New" doesn't get longer space sequence (despite its \prq2 (not monospaced) font setting). Change-Id: I308ab06db57a2db5deec1d4c4573da3317cad8e9 Reviewed-on: https://gerrit.libreoffice.org/82145 Tested-by: Jenkins Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.cxx')
-rw-r--r--writerfilter/source/rtftok/rtfdocumentimpl.cxx6
1 files changed, 6 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
index 5a9d71d1b9e5..d92730f0fe28 100644
--- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx
+++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx
@@ -1467,6 +1467,12 @@ void RTFDocumentImpl::text(OUString& rString)
case Destination::STATICVAL:
m_aStates.top().appendDestinationText(rString);
break;
+ case Destination::GENERATOR:
+ // don't enlarge space sequences again, if the document was saved in LibreOffice
+ if (rString.indexOf("LibreOffice") != -1)
+ m_aSettingsTableSprms.set(NS_ooxml::LN_CT_Settings_longerSpaceSequence,
+ new RTFValue(0));
+ break;
default:
bRet = false;
break;