sw/source/filter/ww8/rtfattributeoutput.cxx | 37 +--------------------------- 1 file changed, 2 insertions(+), 35 deletions(-)
New commits: commit 906377ef12bcf75da871b0c3dab1decaf5b20b32 Author: Vasily Melenchuk <vasily.melenc...@cib.de> AuthorDate: Thu Oct 26 17:09:44 2023 +0300 Commit: Thorsten Behrens <thorsten.behr...@allotropia.de> CommitDate: Sat Nov 11 21:44:11 2023 +0100 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.melenc...@cib.de> Signed-off-by: Xisco Fauli <xiscofa...@libreoffice.org> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159313 Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de> diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index 5c20be552480..c8ac5b4cadf4 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -4459,21 +4459,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 @@ -4566,27 +4553,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);