diff options
author | Michael Stahl <mstahl@redhat.com> | 2014-08-01 20:21:21 +0200 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2014-08-02 20:37:56 +0000 |
commit | d2dd174ac05d7c2844c5e60169128e2a02d4311b (patch) | |
tree | abdb8fb9f027c80fc16082fcee97619ad2bcbbb9 /writerfilter/source/rtftok/rtfdocumentimpl.cxx | |
parent | 22688ede28db14e5947cf73e85fcd2156e26ec5e (diff) |
writerfilter: RTF import: ignore content of \upr, except for \ud
The content of \upr and its nested \ud destination should be the same
modulo text encoding, so ignore the legacy one.
Change-Id: I007151e3075a9ac879a486ec3b5fb8549435dbba
(cherry picked from commit b46956e73b6daff2578110c0395fd80150dc0b0b)
Reviewed-on: https://gerrit.libreoffice.org/10699
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.cxx')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 2372a2920eb3..21708cc8553f 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -1450,7 +1450,14 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) setNeedSect(); checkUnicode(/*bUnicode =*/ true, /*bHex =*/ true); RTFSkipDestination aSkip(*this); - switch (nKeyword) + // special case \upr: ignore everything except nested \ud + if (DESTINATION_UPR == m_aStates.top().nDestinationState + && RTF_UD != nKeyword) + { + m_aStates.top().nDestinationState = DESTINATION_SKIP; + aSkip.setParsed(false); + } + else switch (nKeyword) { case RTF_RTF: break; @@ -1845,11 +1852,7 @@ int RTFDocumentImpl::dispatchDestination(RTFKeyword nKeyword) m_aStates.top().nDestinationState = DESTINATION_PARAGRAPHNUMBERING_TEXTBEFORE; break; case RTF_TITLE: - // \title inside \upr but outside \ud should be ignored. - if (m_aStates.top().nDestinationState != DESTINATION_UPR) - m_aStates.top().nDestinationState = DESTINATION_TITLE; - else - m_aStates.top().nDestinationState = DESTINATION_SKIP; + m_aStates.top().nDestinationState = DESTINATION_TITLE; break; case RTF_SUBJECT: m_aStates.top().nDestinationState = DESTINATION_SUBJECT; |