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

fdo#57708 fix RTF import of pictures right before text frames

Change-Id: Ibfeaadd5b48fd48c2c1f20de5dc272d9a326bfc4
üst b836bf38
......@@ -274,7 +274,8 @@ RTFDocumentImpl::RTFDocumentImpl(uno::Reference<uno::XComponentContext> const& x
m_aHexBuffer(),
m_bIgnoreNextContSectBreak(false),
m_bNeedSect(true),
m_bWasInFrame(false)
m_bWasInFrame(false),
m_bHadPicture(false)
{
OSL_ASSERT(xInputStream.is());
m_pInStream.reset(utl::UcbStreamHelper::CreateStream(xInputStream, sal_True));
......@@ -497,6 +498,8 @@ void RTFDocumentImpl::parBreak()
Mapper().endCharacterGroup();
Mapper().endParagraphGroup();
m_bHadPicture = false;
// start new one
Mapper().startParagraphGroup();
}
......@@ -813,6 +816,8 @@ int RTFDocumentImpl::resolvePict(bool bInline)
m_pCurrentBuffer->push_back(make_pair(BUFFER_PROPS, pValue));
}
// Make sure we don't loose these properties with a too early reset.
m_bHadPicture = true;
return 0;
}
......@@ -2055,6 +2060,8 @@ int RTFDocumentImpl::dispatchFlag(RTFKeyword nKeyword)
}
break;
case RTF_PARD:
if (m_bHadPicture)
dispatchSymbol(RTF_PAR);
m_aStates.top().aParagraphSprms = m_aDefaultState.aParagraphSprms;
m_aStates.top().aParagraphAttributes = m_aDefaultState.aParagraphAttributes;
m_aStates.top().resetFrame();
......
......@@ -587,6 +587,8 @@ namespace writerfilter {
bool m_bNeedSect;
/// If aFrame.inFrame() was true in the previous state.
bool m_bWasInFrame;
/// A picture was seen in the current paragraph.
bool m_bHadPicture;
};
} // namespace rtftok
} // namespace writerfilter
......
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