sw/qa/core/data/rtf/pass/kde52609.rtf | 8 ++++++++ writerfilter/source/rtftok/rtfdocumentimpl.cxx | 16 ++++++++++++++++ 2 files changed, 24 insertions(+)
New commits: commit e1cbaebe7fe36690e192778c87b5eb63790017d7 Author: Miklos Vajna <[email protected]> Date: Tue Oct 7 18:06:26 2014 +0200 kde#52609 RTF import: fix memory leak This is similar to f7ef84640258e4ee6ddc4cc5cbf58a2d89860afa (abi#2128 RTF import: fix memory leak, 2013-11-28). Change-Id: Id57320466e6fb302ec8616ccc9f4f9429b8eff21 diff --git a/sw/qa/core/data/rtf/pass/kde52609.rtf b/sw/qa/core/data/rtf/pass/kde52609.rtf new file mode 100644 index 0000000..d222c38 --- /dev/null +++ b/sw/qa/core/data/rtf/pass/kde52609.rtf @@ -0,0 +1,8 @@ +{\rtf1 +{\headerl +} +{\footerl +} +first line\par +second line\par +} diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 1c07fb8..3caef99 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -4892,6 +4892,22 @@ int RTFDocumentImpl::popState() RTFParserState aState(m_aStates.top()); m_bWasInFrame = aState.aFrame.inFrame(); + // dmapper expects some content in header/footer, so if there would be nothing, add an empty paragraph. + if (m_pTokenizer->getGroup() == 1 && m_bFirstRun) + { + switch (m_nStreamType) + { + case NS_ooxml::LN_headerl: + case NS_ooxml::LN_headerr: + case NS_ooxml::LN_headerf: + case NS_ooxml::LN_footerl: + case NS_ooxml::LN_footerr: + case NS_ooxml::LN_footerf: + dispatchSymbol(RTF_PAR); + break; + } + } + switch (aState.nDestinationState) { case DESTINATION_FONTTABLE: _______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
