From c5c3ce5e625a31d78a21fbbc339ee30ba99f3044 Mon Sep 17 00:00:00 2001 From: Miklos Vajna Date: Mon, 11 Jun 2012 11:19:19 +0200 Subject: fdo#49659 fix RTF import of pictures with inner groups One would think that with {\pict{\foo1}}, the inner group has no effect in the outer group, but this turns out to be valid, so we should handle it as well. Change-Id: I64b933ad1cd5946f22d27669e9240d9e1875bde3 --- writerfilter/source/rtftok/rtfdocumentimpl.cxx | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'writerfilter/source/rtftok') diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index b2a69622863e..c2c1b604e2b7 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -620,6 +620,10 @@ int RTFDocumentImpl::resolvePict(bool bInline) else pStream = m_pBinaryData.get(); + if (!pStream->Tell()) + // No destination text? Then we'll get it later. + return 0; + // Store, and get its URL. pStream->Seek(0); uno::Reference xInputStream(new utl::OInputStreamWrapper(pStream)); @@ -3529,6 +3533,8 @@ int RTFDocumentImpl::popState() if (aState.nFieldStatus == FIELD_INSTRUCTION) singleChar(0x15); } + else if (m_aStates.size() && m_aStates.top().nDestinationState == DESTINATION_PICT) + m_aStates.top().aPicture = aState.aPicture; else if (bPopShapeProperties) { m_aStates.top().aShape = aShape; -- cgit