diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2022-10-06 12:37:31 +0300 |
---|---|---|
committer | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2022-10-07 11:06:48 +0200 |
commit | 0d545f1f0afc93bd568f8172a134ab9196529809 (patch) | |
tree | 84a3464c086f6355b843a4fde3261d44ba64381b /writerfilter | |
parent | 0cf173ff4a53618e6ddd40a278f375680d92a71f (diff) |
tdf#151370: RTF import: docvar name/value can have several sequences
In case of unicode used there can be tokens, replacements, etc.
So it is better to collect and join all received strings, not
overwrite with just last received.
Change-Id: I2b6ce465d87db4ee30987cbe0ecce1470386242f
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141007
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@allotropia.de>
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 2 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.hxx | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 7fa664ea26b1..8a888d8348f6 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1503,7 +1503,7 @@ void RTFDocumentImpl::text(OUString& rString) break; case Destination::DOCVAR: { - m_aStates.top().setDocVar(rString); + m_aStates.top().appendDocVar(rString); } break; case Destination::FONTTABLE: diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.hxx b/writerfilter/source/rtftok/rtfdocumentimpl.hxx index 208812fd4237..ac1263a41531 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.hxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.hxx @@ -524,7 +524,7 @@ public: RTFInternalState getInternalState() const { return m_nInternalState; } RTFDocumentImpl* getDocumentImpl() { return m_pDocumentImpl; } OUString getDocVar() { return m_aDocVar; } - void setDocVar(OUString& aDocVar) { m_aDocVar = aDocVar; }; + void appendDocVar(OUString& aDocVar) { m_aDocVar += aDocVar; }; OUString getDocVarName() { return m_aDocVarName; } void setDocVarName(OUString& aDocVarName) { m_aDocVarName = aDocVarName; } void clearDocVarName() { m_aDocVarName = ""; } |