diff options
author | Miklos Vajna <vmiklos@suse.cz> | 2012-03-05 09:44:48 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@suse.cz> | 2012-03-05 10:09:26 +0100 |
commit | 622ce4681dbcddfdd5cbcd95ebbf1f14e93489ed (patch) | |
tree | edfada7a5338a087fd914878aa3db274a71e1782 /sw | |
parent | 9b6e7eb1bad4344be0e766f4c05f0a3f28cb737d (diff) |
i#118986 RTF: reduce memory usage when exporting large graphics
Delay the call to FlyFrameGraphic() till we can write the result to the
stream without buffering in memory; 1.048GB -> 330.1MB memory usage with
the bugdoc.
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/ww8/rtfattributeoutput.cxx | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sw/source/filter/ww8/rtfattributeoutput.cxx b/sw/source/filter/ww8/rtfattributeoutput.cxx index eaf9ee313717..a0c3b0ba37a6 100644 --- a/sw/source/filter/ww8/rtfattributeoutput.cxx +++ b/sw/source/filter/ww8/rtfattributeoutput.cxx @@ -1538,7 +1538,7 @@ void RtfAttributeOutput::OutputFlyFrame_Impl( const sw::Frame& rFrame, const Poi } if ( pGrfNode ) - FlyFrameGraphic( dynamic_cast<const SwFlyFrmFmt*>( &rFrame.GetFrmFmt() ), pGrfNode ); + m_aRunText.append(dynamic_cast<const SwFlyFrmFmt*>( &rFrame.GetFrmFmt() ), pGrfNode); break; case sw::Frame::eDrawing: { @@ -3455,10 +3455,10 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const S */ bool bIsWMF = std::strcmp(pBLIPType, OOO_STRING_SVTOOLS_RTF_WMETAFILE) == 0; if (!bIsWMF) - m_aRunText->append("{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT); + m_rExport.Strm() << "{" OOO_STRING_SVTOOLS_RTF_IGNORE OOO_STRING_SVTOOLS_RTF_SHPPICT; if (pBLIPType) - m_aRunText->append(ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport )); + ExportPICT( pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport, &m_rExport.Strm() ); else { aStream.Seek(0); @@ -3468,12 +3468,12 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const S nSize = aStream.Tell(); pGraphicAry = (sal_uInt8*)aStream.GetData(); - m_aRunText->append(ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport )); + ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport, &m_rExport.Strm() ); } if (!bIsWMF) { - m_aRunText->append("}" "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT); + m_rExport.Strm() << "}" "{" OOO_STRING_SVTOOLS_RTF_NONSHPPICT; aStream.Seek(0); GraphicConverter::Export(aStream, aGraphic, CVT_WMF); @@ -3482,12 +3482,12 @@ void RtfAttributeOutput::FlyFrameGraphic( const SwFlyFrmFmt* pFlyFrmFmt, const S nSize = aStream.Tell(); pGraphicAry = (sal_uInt8*)aStream.GetData(); - m_aRunText->append(ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport )); + ExportPICT(pFlyFrmFmt, aSize, aRendered, aMapped, rCr, pBLIPType, pGraphicAry, nSize, m_rExport, &m_rExport.Strm() ); - m_aRunText->append('}'); + m_rExport.Strm() << '}'; } - m_aRunText->append(m_rExport.sNewLine); + m_rExport.Strm() << m_rExport.sNewLine; } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |