Kaydet (Commit) e1cbaebe authored tarafından Miklos Vajna's avatar Miklos Vajna

kde#52609 RTF import: fix memory leak

This is similar to f7ef8464 (abi#2128
RTF import: fix memory leak, 2013-11-28).

Change-Id: Id57320466e6fb302ec8616ccc9f4f9429b8eff21
üst 153af847
{\rtf1
{\headerl
}
{\footerl
}
first line\par
second line\par
}
...@@ -4892,6 +4892,22 @@ int RTFDocumentImpl::popState() ...@@ -4892,6 +4892,22 @@ int RTFDocumentImpl::popState()
RTFParserState aState(m_aStates.top()); RTFParserState aState(m_aStates.top());
m_bWasInFrame = aState.aFrame.inFrame(); 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) switch (aState.nDestinationState)
{ {
case DESTINATION_FONTTABLE: case DESTINATION_FONTTABLE:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment