improve usage of TempFile in SVGExport

TempFile already handles the stream. And not touching the URL
means we stay on the fast path for temp files.

Change-Id: I1c239c90901af4450ba10e0d1505bb982cdce41c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140116
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2022-09-18 13:53:57 +02:00
committed by Noel Grandin
parent aace38f9bf
commit 8ed50c16a4

View File

@@ -2505,16 +2505,18 @@ void SVGFilter::implCreateObjectsFromBackground( const Reference< css::drawing::
utl::TempFile aFile;
aFile.EnableKillingFile();
SvStream* pStream = aFile.GetStream(StreamMode::READWRITE);
Sequence< PropertyValue > aDescriptor{
comphelper::makePropertyValue("FilterName", OUString( "SVM" )),
comphelper::makePropertyValue("URL", aFile.GetURL()),
comphelper::makePropertyValue("OutputStream", uno::Reference<XOutputStream>(new utl::OOutputStreamWrapper(*pStream))),
comphelper::makePropertyValue("ExportOnlyBackground", true)
};
xExporter->setSourceDocument( Reference< XComponent >( rxDrawPage, UNO_QUERY ) );
xExporter->filter( aDescriptor );
SvmReader aReader( *aFile.GetStream( StreamMode::READ ) );
pStream->Seek(0);
SvmReader aReader( *pStream );
aReader.Read( aMtf );
bool bIsBitmap = false;