diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2023-10-28 19:55:33 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2023-10-29 07:45:45 +0100 |
commit | f02cd897a4605192dd4034e4893ae9aedb9dad4f (patch) | |
tree | 153470bb7c29a9d14674324a3011bbc82b97173d /sw | |
parent | f8f8d5ec4568a10dc77144369f52b2dd165e66c5 (diff) |
use more TempFileFast in TestPDFExportFODT
Change-Id: I27bf3b3c15fccec80af322b3d4653c4b41ec80e9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158597
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/filter/xml/xmlimp.cxx | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx index 55415f12a6f4..81ddfbbb5ffa 100644 --- a/sw/source/filter/xml/xmlimp.cxx +++ b/sw/source/filter/xml/xmlimp.cxx @@ -1852,16 +1852,14 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestPDFExportFODT(SvStream &rStream) css::uno::Reference<css::frame::XController2> xController(xModel->createDefaultViewController(xTargetFrame), UNO_SET_THROW); utl::ConnectFrameControllerModel(xTargetFrame, xController, xModel); - utl::TempFileNamed aTempFile; - aTempFile.EnableKillingFile(); + utl::TempFileFast aTempFile; uno::Reference<document::XFilter> xPDFFilter( xMultiServiceFactory->createInstance("com.sun.star.document.PDFFilter"), uno::UNO_QUERY); uno::Reference<document::XExporter> xExporter(xPDFFilter, uno::UNO_QUERY); xExporter->setSourceDocument(xModel); - SvFileStream aOutputStream(aTempFile.GetURL(), StreamMode::WRITE); - uno::Reference<io::XOutputStream> xOutputStream(new utl::OStreamWrapper(aOutputStream)); + uno::Reference<io::XOutputStream> xOutputStream(new utl::OStreamWrapper(*aTempFile.GetStream(StreamMode::READWRITE))); // ofz#60533 fuzzer learned to use fo:font-size="842pt" which generate timeouts trying // to export thousands of pages from minimal input size @@ -1874,7 +1872,6 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestPDFExportFODT(SvStream &rStream) { "FilterData", uno::Any(aFilterData) } })); xPDFFilter->filter(aDescriptor); - aOutputStream.Close(); } css::uno::Reference<css::util::XCloseable> xClose(xModel, css::uno::UNO_QUERY); |