sw/source/filter/ww8/rtfattributeoutput.cxx |   37 +---------------------------
 1 file changed, 2 insertions(+), 35 deletions(-)

New commits:
commit 24ee09ab41924fd339835cbc7a54a5ba27f5c67e
Author:     Vasily Melenchuk <vasily.melenc...@cib.de>
AuthorDate: Thu Oct 26 17:09:44 2023 +0300
Commit:     Vasily Melenchuk <vasily.melenc...@cib.de>
CommitDate: Thu Nov 2 09:38:05 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>

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);

Reply via email to