diff options
author | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2023-10-26 17:09:44 +0300 |
---|---|---|
committer | Vasily Melenchuk <vasily.melenchuk@cib.de> | 2023-11-02 09:38:05 +0100 |
commit | 24ee09ab41924fd339835cbc7a54a5ba27f5c67e (patch) | |
tree | 0e2359b543793cb74ad5edc33593ac4bbd7b1377 /sw | |
parent | 08d74d8980d19c7f524c8f60de5c033d026d1c94 (diff) |
tdf#104288: rtf export: drop \nonshppict on export
- these days hard to find a reader not able to read shapes
- RTF file will became compact without pictures duplication
- WordPad nowadays is able to display shape pict, no reason
for fallback
- Fixing possible rtf file bloat on exporting some WMFs
Change-Id: Icc8b60da6541acef939f42021d8d5e81bbcd1ae4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158507
Tested-by: Jenkins
Reviewed-by: Vasily Melenchuk <vasily.melenchuk@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index afcdbdf0e761..baefd752e1c0 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -4461,21 +4461,8 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat } } - /* - If the graphic is not of type WMF then we will have to store two - graphics, one in the native format wrapped in shppict, and the other in - the wmf format wrapped in nonshppict, so as to keep wordpad happy. If it's - a wmf already then we don't need any such wrapping - */ - bool bIsWMF = pBLIPType && std::strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE) == 0; const SwAttrSet* pAttrSet = pGrfNode->GetpSwAttrSet(); - if (!pFrame || pFrame->IsInline()) - { - if (!bIsWMF) - m_rExport.Strm().WriteOString( - "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT); - } - else + if (pFrame && !pFrame->IsInline()) { m_rExport.Strm().WriteOString( "{" OOO_STRING_SVTOOLS_RTF_SHP @@ -4568,27 +4555,7 @@ void RtfAttributeOutput::FlyFrameGraphic(const SwFlyFrameFormat* pFlyFrameFormat m_rExport, &m_rExport.Strm(), bWritePicProp, pAttrSet); } - if (!pFrame || pFrame->IsInline()) - { - if (!bIsWMF) - { - m_rExport.Strm().WriteOString("}" - "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT); - - aStream.Seek(0); - if (GraphicConverter::Export(aStream, rGraphic, ConvertDataFormat::WMF) != ERRCODE_NONE) - SAL_WARN("sw.rtf", "failed to export the graphic"); - pBLIPType = OOO_STRING_SVTOOLS_RTF_WMETAFILE; - nSize = aStream.TellEnd(); - pGraphicAry = static_cast<sal_uInt8 const*>(aStream.GetData()); - - ExportPICT(pFlyFrameFormat, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, - nSize, m_rExport, &m_rExport.Strm()); - - m_rExport.Strm().WriteChar('}'); - } - } - else + if (pFrame && !pFrame->IsInline()) m_rExport.Strm().WriteOString("}}}}"); // Close SV, SP, SHPINST and SHP. m_rExport.Strm().WriteOString(SAL_NEWLINE_STRING); |