diff options
Diffstat (limited to 'sw')
36 files changed, 83 insertions, 91 deletions
diff --git a/sw/qa/core/draw/draw.cxx b/sw/qa/core/draw/draw.cxx index feb347adc8d4..25f7e1bd442d 100644 --- a/sw/qa/core/draw/draw.cxx +++ b/sw/qa/core/draw/draw.cxx @@ -111,7 +111,7 @@ CPPUNIT_TEST_FIXTURE(SwCoreDrawTest, testTdf107727FrameBorder) // Export to RTF and reload uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("Rich Text Format"); diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx index 3e4dfd697206..e880e428fc34 100644 --- a/sw/qa/core/filters-test.cxx +++ b/sw/qa/core/filters-test.cxx @@ -117,7 +117,7 @@ bool SwFiltersTest::filter(const OUString &rFilter, const OUString &rURL, bool bSaved; { - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); SfxMedium aDstMed(aTempFile.GetURL(), StreamMode::STD_WRITE); aDstMed.SetFilter(pExportFilter); diff --git a/sw/qa/core/filters-test2.cxx b/sw/qa/core/filters-test2.cxx index 965645c3be57..08736b962a85 100644 --- a/sw/qa/core/filters-test2.cxx +++ b/sw/qa/core/filters-test2.cxx @@ -111,7 +111,7 @@ bool SwFiltersTest2::filter(const OUString& rFilter, const OUString& rURL, if (bLoaded) xDocShRef->ResetError(); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); SfxMedium aDstMed(aTempFile.GetURL(), StreamMode::STD_WRITE); aDstMed.SetFilter(pExportFilter); diff --git a/sw/qa/core/macros-test.cxx b/sw/qa/core/macros-test.cxx index 0df5ea55a44f..f02bd34d91be 100644 --- a/sw/qa/core/macros-test.cxx +++ b/sw/qa/core/macros-test.cxx @@ -383,7 +383,7 @@ void SwMacrosTest::testFdo68983() loadFromDesktop(aFileName, "com.sun.star.text.TextDocument"); Reference< frame::XStorable > xDocStorable(xComponent, UNO_QUERY_THROW); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); Sequence<beans::PropertyValue> desc( comphelper::InitPropertySequence({ { "FilterName", Any(OUString("writer8")) } @@ -415,7 +415,7 @@ void SwMacrosTest::testFdo87530() Reference<css::lang::XComponent> xComponent = loadFromDesktop("private:factory/swriter", "com.sun.star.text.TextDocument"); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); Sequence<beans::PropertyValue> desc( comphelper::InitPropertySequence({ diff --git a/sw/qa/core/uwriter.cxx b/sw/qa/core/uwriter.cxx index 7b6089b50641..a51a472ec7bc 100644 --- a/sw/qa/core/uwriter.cxx +++ b/sw/qa/core/uwriter.cxx @@ -196,7 +196,7 @@ void SwDocTest::testFileNameFields() { //Here's a file name with some chars in it that will be %% encoded, when expanding //SwFileNameFields we want to restore the original readable filename - utl::TempFile aTempFile(u"demo [name]"); + utl::TempFileNamed aTempFile(u"demo [name]"); aTempFile.EnableKillingFile(); INetURLObject aTempFileURL(aTempFile.GetURL()); diff --git a/sw/qa/extras/globalfilter/globalfilter.cxx b/sw/qa/extras/globalfilter/globalfilter.cxx index 850df79be627..228c5dc0a234 100644 --- a/sw/qa/extras/globalfilter/globalfilter.cxx +++ b/sw/qa/extras/globalfilter/globalfilter.cxx @@ -114,7 +114,7 @@ void Test::testEmbeddedGraphicRoundtrip() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -182,7 +182,7 @@ void Test::testLinkedGraphicRT() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -248,7 +248,7 @@ void Test::testImageWithSpecialID() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -343,7 +343,7 @@ void Test::testGraphicShape() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -447,7 +447,7 @@ void Test::testMultipleIdenticalGraphics() // Export the document and import again for a check utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); @@ -505,7 +505,7 @@ void Test::testCharHighlightBody() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -601,7 +601,7 @@ void Test::testCharStyleHighlight() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -675,7 +675,7 @@ void Test::testCharHighlightODF() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer8"); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); @@ -790,7 +790,7 @@ void Test::testMSCharBackgroundEditing() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -854,7 +854,7 @@ void Test::testCharBackgroundToHighlighting() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -1064,7 +1064,7 @@ void Test::testNestedFieldmark() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName.first; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); mxComponent->dispose(); @@ -1133,7 +1133,7 @@ void Test::testODF13() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer8"); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; uno::Reference<frame::XStorable> const xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); @@ -1169,7 +1169,7 @@ void Test::testODF13() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer8"); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; uno::Reference<frame::XStorable> const xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); @@ -1205,7 +1205,7 @@ void Test::testODF13() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= OUString("writer8"); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; uno::Reference<frame::XStorable> const xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); @@ -1268,7 +1268,7 @@ void Test::testRedlineFlags() utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); @@ -1351,7 +1351,7 @@ void Test::testBulletAsImage() aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference<lang::XComponent> xComponent(xStorable, uno::UNO_QUERY); @@ -1440,7 +1440,7 @@ void Test::testTextFormField() uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -1503,7 +1503,7 @@ void Test::testCheckBoxFormField() uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -1566,7 +1566,7 @@ void Test::testDropDownFormField() uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -1651,7 +1651,7 @@ void Test::testDateFormField() uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); @@ -1845,7 +1845,7 @@ void Test::testDateFormFieldCharacterFormatting() uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); utl::MediaDescriptor aMediaDescriptor; aMediaDescriptor["FilterName"] <<= rFilterName; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); xStorable->storeToURL(aTempFile.GetURL(), aMediaDescriptor.getAsConstPropertyValueList()); uno::Reference< lang::XComponent > xComponent(xStorable, uno::UNO_QUERY); diff --git a/sw/qa/extras/htmlexport/htmlexport.cxx b/sw/qa/extras/htmlexport/htmlexport.cxx index 3a212d2242f5..38ee565cbd14 100644 --- a/sw/qa/extras/htmlexport/htmlexport.cxx +++ b/sw/qa/extras/htmlexport/htmlexport.cxx @@ -1217,7 +1217,7 @@ CPPUNIT_TEST_FIXTURE(SwHtmlDomExportTest, testReqifOle1PDF) mxComponent.clear(); ImportFromReqif(maTempFile.GetURL()); uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); uno::Sequence<beans::PropertyValue> aStoreProperties = { comphelper::makePropertyValue("FilterName", OUString("writer8")), diff --git a/sw/qa/extras/layout/layout.cxx b/sw/qa/extras/layout/layout.cxx index 0536a54d8b7e..feda2a494469 100644 --- a/sw/qa/extras/layout/layout.cxx +++ b/sw/qa/extras/layout/layout.cxx @@ -3376,7 +3376,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf109137) { createSwDoc(DATA_DIRECTORY, "tdf109137.docx"); uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); uno::Sequence<beans::PropertyValue> aDescriptor(comphelper::InitPropertySequence({ { "FilterName", uno::Any(OUString("writer8")) }, @@ -3538,7 +3538,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf117188) { createSwDoc(DATA_DIRECTORY, "tdf117188.docx"); uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); uno::Sequence<beans::PropertyValue> aDescriptor(comphelper::InitPropertySequence({ { "FilterName", uno::Any(OUString("writer8")) }, @@ -3788,7 +3788,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, testTdf122607_regression) uno::Sequence<beans::PropertyValue> props(comphelper::InitPropertySequence({ { "FilterName", uno::Any(OUString("writer_pdf_Export")) }, })); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), props); @@ -3832,7 +3832,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter, TestTdf150616) uno::Sequence<beans::PropertyValue> props(comphelper::InitPropertySequence({ { "FilterName", uno::Any(OUString("writer_pdf_Export")) }, })); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), props); diff --git a/sw/qa/extras/layout/layout2.cxx b/sw/qa/extras/layout/layout2.cxx index ac783be344fd..4ba57e79f336 100644 --- a/sw/qa/extras/layout/layout2.cxx +++ b/sw/qa/extras/layout/layout2.cxx @@ -740,7 +740,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTableCellInvalidate) uno::Sequence<beans::PropertyValue> props(comphelper::InitPropertySequence({ { "FilterName", uno::Any(OUString("writer_pdf_Export")) }, })); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), props); @@ -2233,7 +2233,7 @@ CPPUNIT_TEST_FIXTURE(SwLayoutWriter2, testTdf121509) CPPUNIT_ASSERT(pTriangleShapeFormat->SetFormatAttr(aNewAnch)); // Reload (docx) - auto aTemp = utl::TempFile(); + utl::TempFileNamed aTemp; save("Office Open XML Text", aTemp); // The second part: check if the reloaded doc has flys inside a fly diff --git a/sw/qa/extras/mailmerge/mailmerge.cxx b/sw/qa/extras/mailmerge/mailmerge.cxx index 8d024194c985..41e1862ff509 100644 --- a/sw/qa/extras/mailmerge/mailmerge.cxx +++ b/sw/qa/extras/mailmerge/mailmerge.cxx @@ -84,7 +84,7 @@ public: header(); preTest(filename); - utl::TempFile aTempDir(nullptr, true); + utl::TempFileNamed aTempDir(nullptr, true); aTempDir.EnableKillingFile(); const OUString aWorkDir = aTempDir.GetURL(); const OUString aURI( m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(datasource) ); diff --git a/sw/qa/extras/mailmerge/mailmerge2.cxx b/sw/qa/extras/mailmerge/mailmerge2.cxx index af49344e52b9..cc8bf1c7be15 100644 --- a/sw/qa/extras/mailmerge/mailmerge2.cxx +++ b/sw/qa/extras/mailmerge/mailmerge2.cxx @@ -84,7 +84,7 @@ public: header(); preTest(filename); - utl::TempFile aTempDir(nullptr, true); + utl::TempFileNamed aTempDir(nullptr, true); aTempDir.EnableKillingFile(); const OUString aWorkDir = aTempDir.GetURL(); const OUString aURI( m_directories.getURLFromSrc(mpTestDocumentPath) + OUString::createFromAscii(datasource) ); diff --git a/sw/qa/extras/odfexport/odfexport.cxx b/sw/qa/extras/odfexport/odfexport.cxx index 9c723e240380..b07249cc7d77 100644 --- a/sw/qa/extras/odfexport/odfexport.cxx +++ b/sw/qa/extras/odfexport/odfexport.cxx @@ -901,7 +901,7 @@ CPPUNIT_TEST_FIXTURE(Test, testFdo58949) * and replacement image) OLE objects using UNO, so we'll check the zip file directly. */ - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; save("writer8", aTempFile); uno::Sequence<uno::Any> aArgs{ uno::Any(aTempFile.GetURL()) }; diff --git a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx index 79dd0dc7e540..000f4a607ae5 100644 --- a/sw/qa/extras/ooxmlexport/ooxmllinks.cxx +++ b/sw/qa/extras/ooxmlexport/ooxmllinks.cxx @@ -45,7 +45,7 @@ CPPUNIT_ASSERT(!sFileName.isEmpty()); \ \ /* Get temp path */ \ - OUString sTempDir = utl::TempFile::GetTempNameBaseDirectory(); \ + OUString sTempDir = utl::GetTempNameBaseDirectory(); \ \ /* Create & apply new URL */ \ OUString sOriginalFileInTempDir = sTempDir + sFileName; \ diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx index c69c88227f2f..a147f2f9a0c7 100644 --- a/sw/qa/extras/uiwriter/uiwriter.cxx +++ b/sw/qa/extras/uiwriter/uiwriter.cxx @@ -83,7 +83,7 @@ public: std::unique_ptr<SwTextBlocks> SwUiWriterTest::readDOCXAutotext(std::u16string_view sFileName, bool bEmpty) { - utl::TempFile tmp; + utl::TempFileNamed tmp; tmp.EnableKillingFile(); OUString rURL = tmp.GetURL(); CPPUNIT_ASSERT_EQUAL( diff --git a/sw/qa/extras/uiwriter/uiwriter4.cxx b/sw/qa/extras/uiwriter/uiwriter4.cxx index b37c18b672f5..1a7549506bf0 100644 --- a/sw/qa/extras/uiwriter/uiwriter4.cxx +++ b/sw/qa/extras/uiwriter/uiwriter4.cxx @@ -646,7 +646,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testBookmarkCollapsed) CPPUNIT_ASSERT(pDoc); // save original document - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; save("writer8", aTempFile); // load only content.xml from the resaved document @@ -722,7 +722,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkText) } // save document - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; save("writer8", aTempFile); // load only content.xml from the resaved document @@ -825,7 +825,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkTextAndAddNew) } // save document - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; save("writer8", aTempFile); // load only content.xml from the resaved document @@ -891,7 +891,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest4, testRemoveBookmarkTextAndAddNewAfterReload } // save original document - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; save("writer8", aTempFile); // load only content.xml from the resaved document diff --git a/sw/qa/extras/uiwriter/uiwriter6.cxx b/sw/qa/extras/uiwriter/uiwriter6.cxx index 7ef3ad0df433..0159c5bf07ed 100644 --- a/sw/qa/extras/uiwriter/uiwriter6.cxx +++ b/sw/qa/extras/uiwriter/uiwriter6.cxx @@ -688,7 +688,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testTdf115013) { const OUString sColumnName("Name with spaces, \"quotes\" and \\backslashes"); - utl::TempFile aTempDir(nullptr, true); + utl::TempFileNamed aTempDir(nullptr, true); aTempDir.EnableKillingFile(); const OUString aWorkDir = aTempDir.GetURL(); @@ -1078,7 +1078,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testFontEmbedding) xmlDocUniquePtr pXmlDoc; uno::Sequence<beans::PropertyValue> aDescriptor; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); // Get document settings @@ -1301,7 +1301,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest6, testInconsistentBookmark) // save document and verify the bookmark scoup { // save document - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; save("writer8", aTempFile); // load only content.xml diff --git a/sw/qa/extras/uiwriter/uiwriter7.cxx b/sw/qa/extras/uiwriter/uiwriter7.cxx index a24201b78b2f..816bdcd766a6 100644 --- a/sw/qa/extras/uiwriter/uiwriter7.cxx +++ b/sw/qa/extras/uiwriter/uiwriter7.cxx @@ -110,7 +110,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testExportToPicture) uno::Sequence<beans::PropertyValue> aDescriptor(comphelper::InitPropertySequence( { { "FilterName", uno::Any(OUString("writer_png_Export")) }, { "FilterData", uno::Any(aFilterData) } })); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), aDescriptor); bool extchk = aTempFile.IsValid(); @@ -1290,7 +1290,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf74230) createSwDoc(); //exporting the empty document to ODT via TempFile uno::Sequence<beans::PropertyValue> aDescriptor; - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); xStorable->storeToURL(aTempFile.GetURL(), aDescriptor); CPPUNIT_ASSERT(aTempFile.IsValid()); @@ -2765,7 +2765,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest7, testTdf149184) uno::Sequence<beans::PropertyValue> aStoreProps = comphelper::InitPropertySequence({ { "FilterName", uno::Any(OUString("MS Word 97")) }, }); - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); // Without the fix in place, the test fails with: diff --git a/sw/qa/extras/uiwriter/uiwriter8.cxx b/sw/qa/extras/uiwriter/uiwriter8.cxx index 55edd0ff6963..76262c6a0354 100644 --- a/sw/qa/extras/uiwriter/uiwriter8.cxx +++ b/sw/qa/extras/uiwriter/uiwriter8.cxx @@ -2241,7 +2241,7 @@ CPPUNIT_TEST_FIXTURE(SwUiWriterTest8, testTdf128106) SwWrtShell* pWrtShell = createSwDoc(DATA_DIRECTORY, "cross_reference_demo_bmk.odt")->GetDocShell()->GetWrtShell(); - utl::TempFile tempDir(nullptr, true); + utl::TempFileNamed tempDir(nullptr, true); const auto aPropertyValues = comphelper::InitPropertySequence( { { "FileName", css::uno::Any(tempDir.GetURL() + "/test.odm") } }); diff --git a/sw/qa/inc/swmodeltestbase.hxx b/sw/qa/inc/swmodeltestbase.hxx index 19255e6b3751..ccf8d8ac6ae6 100644 --- a/sw/qa/inc/swmodeltestbase.hxx +++ b/sw/qa/inc/swmodeltestbase.hxx @@ -110,7 +110,7 @@ protected: const char* mpFilter; sal_uInt32 mnStartTime; - utl::TempFile maTempFile; + utl::TempFileNamed maTempFile; SvMemoryStream maMemory; ///< Underlying memory for parsed PDF files. bool mbExported; ///< Does maTempFile already contain something useful? bool mbFontNameWYSIWYG; @@ -338,7 +338,7 @@ protected: void reload(const char* pFilter, const char* filename, const char* pPassword = nullptr); /// Save the loaded document to a tempfile. Can be used to check the resulting docx/odt directly as a ZIP file. - void save(const OUString& aFilterName, utl::TempFile& rTempFile); + void save(const OUString& aFilterName, utl::TempFileNamed& rTempFile); /// Combines load() and save(). void loadAndSave(const char* pName); diff --git a/sw/qa/uibase/uiview/uiview.cxx b/sw/qa/uibase/uiview/uiview.cxx index 6b608e0ae309..9ab34e995812 100644 --- a/sw/qa/uibase/uiview/uiview.cxx +++ b/sw/qa/uibase/uiview/uiview.cxx @@ -39,7 +39,7 @@ class SwUibaseUiviewTest : public SwModelTestBase CPPUNIT_TEST_FIXTURE(SwUibaseUiviewTest, testUpdateAllObjectReplacements) { // Make a temporary copy of the test document - utl::TempFile tmp; + utl::TempFileNamed tmp; tmp.EnableKillingFile(); OUString sTempCopy = tmp.GetURL(); CPPUNIT_ASSERT_EQUAL(osl::FileBase::E_None, diff --git a/sw/qa/unit/swmodeltestbase.cxx b/sw/qa/unit/swmodeltestbase.cxx index 963d1f2d49f4..a526f4901331 100644 --- a/sw/qa/unit/swmodeltestbase.cxx +++ b/sw/qa/unit/swmodeltestbase.cxx @@ -626,7 +626,7 @@ void SwModelTestBase::reload(const char* pFilter, const char* filename, const ch calcLayout(); } -void SwModelTestBase::save(const OUString& aFilterName, utl::TempFile& rTempFile) +void SwModelTestBase::save(const OUString& aFilterName, utl::TempFileNamed& rTempFile) { rTempFile.EnableKillingFile(); uno::Reference<frame::XStorable> xStorable(mxComponent, uno::UNO_QUERY); diff --git a/sw/source/core/doc/docglbl.cxx b/sw/source/core/doc/docglbl.cxx index ea0fd1453aef..f5c716ff0301 100644 --- a/sw/source/core/doc/docglbl.cxx +++ b/sw/source/core/doc/docglbl.cxx @@ -240,7 +240,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, OUString sLeading(aEntry.GetBase()); aEntry.removeSegment(); OUString sPath = aEntry.GetMainURL( INetURLObject::DecodeMechanism::NONE ); - utl::TempFile aTemp(sLeading, true, sExt, &sPath); + utl::TempFileNamed aTemp(sLeading, true, sExt, &sPath); aTemp.EnableKillingFile(); DateTime aTmplDate( DateTime::SYSTEM ); @@ -315,8 +315,7 @@ bool SwDoc::SplitDoc( sal_uInt16 eDocType, const OUString& rPath, bool bOutline, pDoc->GetNodes().GetEndOfContent().GetIndex() ) pDoc->GetNodes().Delete( aIdx ); - utl::TempFile aTempFile2(sLeading, true, sExt, &sPath); - sFileName = aTempFile2.GetURL(); + sFileName = utl::CreateTempURL(sLeading, true, sExt, &sPath); SfxMedium* pTmpMed = new SfxMedium( sFileName, StreamMode::STD_READWRITE ); pTmpMed->SetFilter( pFilter ); diff --git a/sw/source/filter/html/wrthtml.cxx b/sw/source/filter/html/wrthtml.cxx index 2889ab268ff8..35d94b86f5e7 100644 --- a/sw/source/filter/html/wrthtml.cxx +++ b/sw/source/filter/html/wrthtml.cxx @@ -159,7 +159,7 @@ SwHTMLWriter::SwHTMLWriter( const OUString& rBaseURL, std::u16string_view rFilte if (rBaseURL.isEmpty()) { // Paste: set base URL to a tempfile, so images are not lost. - mpTempBaseURL.reset(new utl::TempFile()); + mpTempBaseURL.reset(new utl::TempFileNamed()); mpTempBaseURL->EnableKillingFile(); SetBaseURL(mpTempBaseURL->GetURL()); } diff --git a/sw/source/filter/html/wrthtml.hxx b/sw/source/filter/html/wrthtml.hxx index bbec1a1b424a..8dbcb9781e52 100644 --- a/sw/source/filter/html/wrthtml.hxx +++ b/sw/source/filter/html/wrthtml.hxx @@ -63,7 +63,7 @@ class SwHTMLPosFlyFrames; class SwTextFootnote; enum class HtmlPosition; enum class HtmlTokenId : sal_Int16; -namespace utl { class TempFile; } +namespace utl { class TempFileNamed; } extern SwAttrFnTab aHTMLAttrFnTab; @@ -405,7 +405,7 @@ public: bool mbSkipHeaderFooter : 1; bool mbEmbedImages : 1; /// Temporary base URL for paste of images. - std::unique_ptr<utl::TempFile> mpTempBaseURL; + std::unique_ptr<utl::TempFileNamed> mpTempBaseURL; /// If XHTML markup should be written instead of HTML. bool mbXHTML = false; /// XML namespace, in case of XHTML. diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx index 1d401de0bbf3..47bbcaaa0a19 100644 --- a/sw/source/filter/ww8/wrtww8.cxx +++ b/sw/source/filter/ww8/wrtww8.cxx @@ -3478,12 +3478,9 @@ ErrCode WW8Export::ExportDocument_Impl() Strm().SetEndian( SvStreamEndian::LITTLE ); - utl::TempFile aTempMain; - aTempMain.EnableKillingFile(); - utl::TempFile aTempTable; - aTempTable.EnableKillingFile(); - utl::TempFile aTempData; - aTempData.EnableKillingFile(); + utl::TempFileFast aTempMain; + utl::TempFileFast aTempTable; + utl::TempFileFast aTempData; msfilter::MSCodec_Std97 aCtx; bool bEncrypt = GetWriter().InitStd97CodecUpdateMedium(aCtx); diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx index 82dec7f3105d..7d9c80a68481 100644 --- a/sw/source/filter/ww8/ww8par.cxx +++ b/sw/source/filter/ww8/ww8par.cxx @@ -5571,10 +5571,9 @@ ErrCode SwWW8ImplReader::SetSubStreams(tools::SvRef<SotStorageStream> &rTableStr namespace { - SvStream* MakeTemp(std::optional<utl::TempFile>& roTempFile) + SvStream* MakeTemp(std::optional<utl::TempFileFast>& roTempFile) { roTempFile.emplace(); - roTempFile->EnableKillingFile(); return roTempFile->GetStream(StreamMode::READWRITE | StreamMode::SHARE_DENYWRITE); } @@ -5803,9 +5802,9 @@ ErrCode SwWW8ImplReader::LoadThroughDecryption(WW8Glossary *pGloss) if (!nErrRet) nErrRet = SetSubStreams(xTableStream, xDataStream); - std::optional<utl::TempFile> oTempMain; - std::optional<utl::TempFile> oTempTable; - std::optional<utl::TempFile> oTempData; + std::optional<utl::TempFileFast> oTempMain; + std::optional<utl::TempFileFast> oTempTable; + std::optional<utl::TempFileFast> oTempData; SvStream* pDecryptMain = nullptr; SvStream* pDecryptTable = nullptr; SvStream* pDecryptData = nullptr; diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index 947955516c22..9cb433974baa 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -370,7 +370,7 @@ IMPL_LINK_NOARG(SwAddressListDialog, CreateHdl_Impl, weld::Button&, void) OUString sTmpName; { OUString sHomePath(SvtPathOptions().GetWorkPath()); - utl::TempFile aTempFile(sFind, true, u".odb", &sHomePath); + utl::TempFileNamed aTempFile(sFind, true, u".odb", &sHomePath); aTempFile.EnableKillingFile(); sTmpName = aTempFile.GetURL(); } diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index 10845d1aa67a..2e01e49ec90a 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -95,9 +95,9 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage(weld::Container* pPage, SwMailMerge //creating with extension is not supported by a static method :-( OUString const sExt( comphelper::string::stripStart(pSfxFlt->GetDefaultExtension(),'*')); - utl::TempFile aTempFile( u"", true, sExt ); - m_sExampleURL = aTempFile.GetURL(); + utl::TempFileNamed aTempFile( u"", true, sExt ); aTempFile.EnableKillingFile(); + m_sExampleURL = aTempFile.GetURL(); } SwView* pView = m_pWizard->GetSwView(); // Don't save embedded data set! It would steal it from current document. diff --git a/sw/source/ui/dbui/mmresultdialogs.cxx b/sw/source/ui/dbui/mmresultdialogs.cxx index 9ff6315eefb0..d34f97d856c4 100644 --- a/sw/source/ui/dbui/mmresultdialogs.cxx +++ b/sw/source/ui/dbui/mmresultdialogs.cxx @@ -609,7 +609,7 @@ IMPL_LINK_NOARG(SwMMResultSaveDialog, SaveOutputHdl_Impl, weld::Button&, void) else { OUString sTargetTempURL = URIHelper::SmartRel2Abs( - INetURLObject(), utl::TempFile::CreateTempName(), + INetURLObject(), utl::CreateTempName(), URIHelper::GetMaybeFileHdl()); std::shared_ptr<const SfxFilter> pSfxFlt = SwIoSystem::GetFilterOfFormat( FILTER_XML, @@ -1082,7 +1082,7 @@ IMPL_LINK_NOARG(SwMMResultEmailDialog, SendDocumentsHdl_Impl, weld::Button&, voi sFilterOptions = "EmbedImages"; } OUString sTargetTempURL = URIHelper::SmartRel2Abs( - INetURLObject(), utl::TempFile::CreateTempName(), + INetURLObject(), utl::CreateTempName(), URIHelper::GetMaybeFileHdl()); std::shared_ptr<const SfxFilter> pTargetSfxFlt = SwIoSystem::GetFilterOfFormat( FILTER_XML, @@ -1134,7 +1134,7 @@ IMPL_LINK_NOARG(SwMMResultEmailDialog, SendDocumentsHdl_Impl, weld::Button&, voi //then save it SfxStringItem aName(SID_FILE_NAME, URIHelper::SmartRel2Abs( - INetURLObject(), utl::TempFile::CreateTempName(), + INetURLObject(), utl::CreateTempName(), URIHelper::GetMaybeFileHdl()) ); { diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index 703b31b3a810..5e88c4871ee9 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -76,7 +76,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(weld::Window * pParent, INetURLObject aTempURL(rPathArr[i]); const OUString sPath = aTempURL.GetMainURL(INetURLObject::DecodeMechanism::WithCharset ); sal_uInt32 nCaseReadonly = 0; - utl::TempFile aTempFile(&sPath); + utl::TempFileNamed aTempFile(sPath); aTempFile.EnableKillingFile(); if(!aTempFile.IsValid()) nCaseReadonly |= PATH_READONLY; diff --git a/sw/source/uibase/app/docsh2.cxx b/sw/source/uibase/app/docsh2.cxx index d683185f657a..8813828b5969 100644 --- a/sw/source/uibase/app/docsh2.cxx +++ b/sw/source/uibase/app/docsh2.cxx @@ -704,7 +704,7 @@ void SwDocShell::Execute(SfxRequest& rReq) bSetModified = IsModified() || pSrcView->IsModified(); if(pSrcView->IsModified()||pSrcView->HasSourceSaved()) { - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); pSrcView->SaveContent(aTempFile.GetURL()); bDone = true; diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx index ac6aa2df1e6b..2ce2dc911c9a 100644 --- a/sw/source/uibase/dbui/dbmgr.cxx +++ b/sw/source/uibase/dbui/dbmgr.cxx @@ -775,7 +775,7 @@ static void lcl_SaveDebugDoc( SfxObjectShell *xTargetDocShell, if( sTempDirURL.isEmpty() ) { SvtPathOptions aPathOpt; - utl::TempFile aTempDir( &aPathOpt.GetTempPath(), true ); + utl::TempFileNamed aTempDir( &aPathOpt.GetTempPath(), true ); if( aTempDir.IsValid() ) { INetURLObject aTempDirURL( aTempDir.GetURL() ); @@ -790,7 +790,7 @@ static void lcl_SaveDebugDoc( SfxObjectShell *xTargetDocShell, if (no > 0) basename += OUString::number(no) + "-"; // aTempFile is not deleted, but that seems to be intentional - utl::TempFile aTempFile( basename, true, u".odt", &sTempDirURL ); + utl::TempFileNamed aTempFile( basename, true, u".odt", &sTempDirURL ); INetURLObject aTempFileURL( aTempFile.GetURL() ); auto pDstMed = std::make_unique<SfxMedium>( aTempFileURL.GetMainURL( INetURLObject::DecodeMechanism::NONE ), @@ -1180,7 +1180,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, SwDoc* pTargetDoc = nullptr; SfxObjectShellRef xTargetDocShell; - std::unique_ptr< utl::TempFile > aTempFile; + std::unique_ptr< utl::TempFileNamed > aTempFile; sal_uInt16 nStartingPageNo = 0; std::shared_ptr<weld::GenericDialogController> xProgressDlg; @@ -1323,7 +1323,7 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell, } OUString sExt(comphelper::string::stripStart(pStoreToFilter->GetDefaultExtension(), '*')); - aTempFile.reset( new utl::TempFile(sLeading, sColumnData.isEmpty(), sExt, &sPrefix, true) ); + aTempFile.reset( new utl::TempFileNamed(sLeading, sColumnData.isEmpty(), sExt, &sPrefix, true) ); if( !aTempFile->IsValid() ) { ErrorHandler::HandleError( ERRCODE_IO_NOTSUPPORTED ); @@ -2743,8 +2743,7 @@ OUString LoadAndRegisterDataSource_Impl(DBConnURIType type, const uno::Reference { // Cannot embed, as embedded data source would need the URL of the parent document. OUString sHomePath(SvtPathOptions().GetWorkPath()); - utl::TempFile aTempFile(sNewName, true, u".odb", pDestDir ? pDestDir : &sHomePath); - const OUString& sTmpName = aTempFile.GetURL(); + const OUString sTmpName = utl::CreateTempURL(sNewName, true, u".odb", pDestDir ? pDestDir : &sHomePath); xStore->storeAsURL(sTmpName, uno::Sequence<beans::PropertyValue>()); } else diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index cd00b2698032..496d0c8903ef 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -738,8 +738,7 @@ bool SwTransferable::WriteObject( tools::SvRef<SotTempStream>& xStream, SfxObjectShell* pEmbObj = static_cast<SfxObjectShell*>(pObject); try { - ::utl::TempFile aTempFile; - aTempFile.EnableKillingFile(); + ::utl::TempFileFast aTempFile; SvStream* pTempStream = aTempFile.GetStream(StreamMode::READWRITE); uno::Reference< embed::XStorage > xWorkStore = ::comphelper::OStorageHelper::GetStorageFromStream( new utl::OStreamWrapper(*pTempStream), embed::ElementModes::READWRITE ); diff --git a/sw/source/uibase/misc/glosdoc.cxx b/sw/source/uibase/misc/glosdoc.cxx index 5e187e0431dc..e9e99377f838 100644 --- a/sw/source/uibase/misc/glosdoc.cxx +++ b/sw/source/uibase/misc/glosdoc.cxx @@ -78,7 +78,7 @@ OUString lcl_CheckFileName( const OUString& rNewFilePath, } //generate generic name - utl::TempFile aTemp(u"group", true, SwGlossaries::GetExtension(), &rNewFilePath); + utl::TempFileNamed aTemp(u"group", true, SwGlossaries::GetExtension(), &rNewFilePath); aTemp.EnableKillingFile(); INetURLObject aTempURL( aTemp.GetURL() ); diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index a143493fe384..b9f9d821826f 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -794,7 +794,7 @@ void SwSrcView::Load(SwDocShell* pDocShell) } else { - utl::TempFile aTempFile; + utl::TempFileNamed aTempFile; aTempFile.EnableKillingFile(); const OUString sFileURL( aTempFile.GetURL() ); diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index e5875417e778..83c37bc9d338 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -767,8 +767,7 @@ uno::Any SAL_CALL SwXMailMerge::execute( FILTER_XML, SwDocShell::Factory().GetFilterContainer() ); OUString aExtension(comphelper::string::stripStart(pSfxFlt->GetDefaultExtension(), '*')); - utl::TempFile aTempFile( u"SwMM", true, aExtension ); - m_aTmpFileName = aTempFile.GetURL(); + m_aTmpFileName = utl::CreateTempURL( u"SwMM", true, aExtension ); Reference< XStorable > xStorable( xCurModel, UNO_QUERY ); bool bStoredAsTemporary = false; |