diff options
author | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-15 15:05:02 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.co.uk> | 2013-11-15 15:45:20 +0100 |
commit | 9389cf78e304a5a99bcf1745b9388e14ac36281a (patch) | |
tree | 68f528d4aaf725c6fb7dea4b2e49e5f10faa6845 /writerfilter | |
parent | b7f38c8f6d63798714b9881ac8ff2da11c72799b (diff) |
cp#1000018 RTF import: empty para at the end of footnote text got lost
Updated 3 testcases, in all cases first checked that the new behavior
matches what Word does.
Also added a new test, to check that empty para at footnote end is now
kept.
Change-Id: I96b8788feb4d730b5a64ba3a743311a0180ab41f
Diffstat (limited to 'writerfilter')
-rw-r--r-- | writerfilter/source/dmapper/DomainMapper_Impl.cxx | 1 | ||||
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 12 |
2 files changed, 2 insertions, 11 deletions
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx index 2bbff8193bd5..cc2486b9d184 100644 --- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx +++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx @@ -1625,7 +1625,6 @@ void DomainMapper_Impl::PushAnnotation() void DomainMapper_Impl::PopFootOrEndnote() { - RemoveLastParagraph(); if (!m_aTextAppendStack.empty()) m_aTextAppendStack.pop(); diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 6169f91ae31e..b77cbbb427b4 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -331,14 +331,6 @@ bool RTFDocumentImpl::isSubstream() const void RTFDocumentImpl::finishSubstream() { checkUnicode(/*bUnicode =*/ true, /*bHex =*/ true); - // At the end of a footnote stream, we need to emit a run break when importing from Word. - // We can't do so unconditionally, as Writer already writes a \par at the end of the footnote. - if (m_bNeedCr) - { - Mapper().startCharacterGroup(); - runBreak(); - Mapper().endCharacterGroup(); - } } void RTFDocumentImpl::setIgnoreFirst(OUString& rIgnoreFirst) @@ -529,7 +521,7 @@ void RTFDocumentImpl::sectBreak(bool bFinal = false) bool bContinuous = pBreak.get() && pBreak->getInt() == 0; // If there is no paragraph in this section, then insert a dummy one, as required by Writer, // unless this is the end of the doc, we had nothing since the last section break and this is not a continuous one. - if (m_bNeedPar && !(bFinal && !m_bNeedSect && !bContinuous)) + if (m_bNeedPar && !(bFinal && !m_bNeedSect && !bContinuous) && !isSubstream()) dispatchSymbol(RTF_PAR); // It's allowed to not have a non-table paragraph at the end of an RTF doc, add it now if required. if (m_bNeedFinalPar && bFinal) @@ -4517,7 +4509,7 @@ int RTFDocumentImpl::popState() // This is the end of the doc, see if we need to close the last section. if (m_pTokenizer->getGroup() == 1 && !m_bFirstRun) { - if (m_bNeedCr) + if (m_bNeedCr && !isSubstream()) dispatchSymbol(RTF_PAR); sectBreak(true); } |