diff options
Diffstat (limited to 'writerfilter/source/rtftok/rtfdocumentimpl.cxx')
-rw-r--r-- | writerfilter/source/rtftok/rtfdocumentimpl.cxx | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/writerfilter/source/rtftok/rtfdocumentimpl.cxx b/writerfilter/source/rtftok/rtfdocumentimpl.cxx index 9559e8d832f0..01ad171601c2 100644 --- a/writerfilter/source/rtftok/rtfdocumentimpl.cxx +++ b/writerfilter/source/rtftok/rtfdocumentimpl.cxx @@ -790,6 +790,24 @@ void RTFDocumentImpl::resolvePict(bool const bInline, uno::Reference<drawing::XS // No destination text? Then we'll get it later. return; + SvMemoryStream aDIBStream; + if (m_aStates.top().aPicture.eStyle == RTFBmpStyle::DIBITMAP) + { + // Construct a BITMAPFILEHEADER structure before the real data. + SvStream& rBodyStream = *pStream; + aDIBStream.WriteChar('B'); + aDIBStream.WriteChar('M'); + // The size of the real data. + aDIBStream.WriteUInt32(rBodyStream.Tell()); + // Reserved. + aDIBStream.WriteUInt32(0); + // The offset of the real data, i.e. the size of the header, including this number. + aDIBStream.WriteUInt32(14); + rBodyStream.Seek(0); + aDIBStream.WriteStream(rBodyStream); + pStream = &aDIBStream; + } + // Store, and get its URL. pStream->Seek(0); uno::Reference<io::XInputStream> xInputStream(new utl::OInputStreamWrapper(pStream)); @@ -4871,6 +4889,9 @@ RTFError RTFDocumentImpl::dispatchValue(RTFKeyword nKeyword, int nParam) } } break; + case RTF_DIBITMAP: + m_aStates.top().aPicture.eStyle = RTFBmpStyle::DIBITMAP; + break; default: { SAL_INFO("writerfilter", "TODO handle value '" << lcl_RtfToString(nKeyword) << "'"); |