summaryrefslogtreecommitdiff
path: root/svx/qa/unit
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2022-09-21 20:54:00 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-09-29 09:11:18 +0200
commit4b95451f859bac8e05956ce12df17f1ee410032d (patch)
tree2ebe03c8ecbba3c9179d33c346774e037fcfc224 /svx/qa/unit
parenta08468c1a5255d3fb04cd8a0dc627acdea40426a (diff)
split utl::TempFile into fast and named variants
which makes it easier to know what each variant requires to stay on it's happy path Change-Id: I3275a2543573367714bc78092e882f6535507285 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140469 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/qa/unit')
-rw-r--r--svx/qa/unit/XTableImportExportTest.cxx2
-rw-r--r--svx/qa/unit/core.cxx2
-rw-r--r--svx/qa/unit/customshapes.cxx10
-rw-r--r--svx/qa/unit/gallery/test_gallery.cxx40
-rw-r--r--svx/qa/unit/unodraw.cxx2
-rw-r--r--svx/qa/unit/xoutdev.cxx4
6 files changed, 30 insertions, 30 deletions
diff --git a/svx/qa/unit/XTableImportExportTest.cxx b/svx/qa/unit/XTableImportExportTest.cxx
index b97a7c50bc6b..cfab5c47c58f 100644
--- a/svx/qa/unit/XTableImportExportTest.cxx
+++ b/svx/qa/unit/XTableImportExportTest.cxx
@@ -35,7 +35,7 @@ public:
CPPUNIT_TEST_FIXTURE(XTableImportExportTest, testImportExport)
{
- utl::TempFile aTempFile(nullptr, true);
+ utl::TempFileNamed aTempFile(nullptr, true);
aTempFile.EnableKillingFile();
OUString aTempURL = aTempFile.GetURL();
BitmapChecksum aChecksum(0);
diff --git a/svx/qa/unit/core.cxx b/svx/qa/unit/core.cxx
index 3966010012e6..de0264555617 100644
--- a/svx/qa/unit/core.cxx
+++ b/svx/qa/unit/core.cxx
@@ -64,7 +64,7 @@ CPPUNIT_TEST_FIXTURE(Test, testChartExportToPdf)
uno::Reference<drawing::XShape> xShape(xDrawPage->getByIndex(0), uno::UNO_QUERY);
// When exporting that chart to PDF:
- utl::TempFile aTempFile;
+ utl::TempFileNamed aTempFile;
GraphicHelper::SaveShapeAsGraphicToPath(getComponent(), xShape, "application/pdf",
aTempFile.GetURL());
diff --git a/svx/qa/unit/customshapes.cxx b/svx/qa/unit/customshapes.cxx
index 39478fd92772..72920aab2933 100644
--- a/svx/qa/unit/customshapes.cxx
+++ b/svx/qa/unit/customshapes.cxx
@@ -179,7 +179,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145700_3D_NonUI)
// Generate bitmap from shape
uno::Reference<drawing::XShape> xShape = getShape(0);
- utl::TempFile aTempFile;
+ utl::TempFileNamed aTempFile;
aTempFile.EnableKillingFile();
GraphicHelper::SaveShapeAsGraphicToPath(mxComponent, xShape, "image/png", aTempFile.GetURL());
@@ -218,7 +218,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145700_3D_FrontLightDim)
// Generate bitmap from shape
uno::Reference<drawing::XShape> xShape = getShape(0);
- utl::TempFile aTempFile;
+ utl::TempFileNamed aTempFile;
aTempFile.EnableKillingFile();
GraphicHelper::SaveShapeAsGraphicToPath(mxComponent, xShape, "image/png", aTempFile.GetURL());
@@ -251,7 +251,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf145700_3D_FirstLightHarsh)
// Generate bitmap from shape
uno::Reference<drawing::XShape> xShape = getShape(0);
- utl::TempFile aTempFile;
+ utl::TempFileNamed aTempFile;
aTempFile.EnableKillingFile();
GraphicHelper::SaveShapeAsGraphicToPath(mxComponent, xShape, "image/png", aTempFile.GetURL());
@@ -1234,7 +1234,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf136176)
// Save 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("draw8");
@@ -1276,7 +1276,7 @@ CPPUNIT_TEST_FIXTURE(CustomshapesTest, testTdf148501_OctagonBevel)
// Generate bitmap from shape
uno::Reference<drawing::XShape> xShape = getShape(0);
- utl::TempFile aTempFile;
+ utl::TempFileNamed aTempFile;
aTempFile.EnableKillingFile();
GraphicHelper::SaveShapeAsGraphicToPath(mxComponent, xShape, "image/png", aTempFile.GetURL());
diff --git a/svx/qa/unit/gallery/test_gallery.cxx b/svx/qa/unit/gallery/test_gallery.cxx
index da224b439f3b..6a4c4965bbf3 100644
--- a/svx/qa/unit/gallery/test_gallery.cxx
+++ b/svx/qa/unit/gallery/test_gallery.cxx
@@ -57,8 +57,8 @@ public:
void GalleryObjTest::TestCreateTheme()
{
// Create theme
- std::unique_ptr<utl::TempFile> pTempDir;
- pTempDir.reset(new utl::TempFile(nullptr, true));
+ std::unique_ptr<utl::TempFileNamed> pTempDir;
+ pTempDir.reset(new utl::TempFileNamed(nullptr, true));
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
pTempDir->EnableKillingFile();
const OUString aGalleryURL = pTempDir->GetURL();
@@ -86,8 +86,8 @@ void GalleryObjTest::TestCreateTheme()
void GalleryObjTest::TestDeleteTheme()
{
// Create theme
- std::unique_ptr<utl::TempFile> pTempDir;
- pTempDir.reset(new utl::TempFile(nullptr, true));
+ std::unique_ptr<utl::TempFileNamed> pTempDir;
+ pTempDir.reset(new utl::TempFileNamed(nullptr, true));
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
pTempDir->EnableKillingFile();
const OUString aGalleryURL = pTempDir->GetURL();
@@ -122,8 +122,8 @@ void GalleryObjTest::TestDeleteTheme()
void GalleryObjTest::TestSetThemeName()
{
// Create theme
- std::unique_ptr<utl::TempFile> pTempDir;
- pTempDir.reset(new utl::TempFile(nullptr, true));
+ std::unique_ptr<utl::TempFileNamed> pTempDir;
+ pTempDir.reset(new utl::TempFileNamed(nullptr, true));
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
pTempDir->EnableKillingFile();
const OUString aGalleryURL = pTempDir->GetURL();
@@ -153,8 +153,8 @@ void GalleryObjTest::TestSetThemeName()
void GalleryObjTest::TestThemeURLCase()
{
// Create theme
- std::unique_ptr<utl::TempFile> pTempDir;
- pTempDir.reset(new utl::TempFile(nullptr, true));
+ std::unique_ptr<utl::TempFileNamed> pTempDir;
+ pTempDir.reset(new utl::TempFileNamed(nullptr, true));
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
pTempDir->EnableKillingFile();
const OUString aGalleryURL = pTempDir->GetURL();
@@ -191,8 +191,8 @@ void GalleryObjTest::TestThemeURLCase()
void GalleryObjTest::TestThemeCount()
{
- std::unique_ptr<utl::TempFile> pTempDir;
- pTempDir.reset(new utl::TempFile(nullptr, true));
+ std::unique_ptr<utl::TempFileNamed> pTempDir;
+ pTempDir.reset(new utl::TempFileNamed(nullptr, true));
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
pTempDir->EnableKillingFile();
const OUString aGalleryURL = pTempDir->GetURL();
@@ -232,8 +232,8 @@ void GalleryObjTest::TestThemeCount()
void GalleryObjTest::TestGalleryThemeEntry()
{
// Create theme
- std::unique_ptr<utl::TempFile> pTempDir;
- pTempDir.reset(new utl::TempFile(nullptr, true));
+ std::unique_ptr<utl::TempFileNamed> pTempDir;
+ pTempDir.reset(new utl::TempFileNamed(nullptr, true));
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
pTempDir->EnableKillingFile();
const OUString aGalleryURL = pTempDir->GetURL();
@@ -286,8 +286,8 @@ void GalleryObjTest::TestGalleryThemeEntry()
void GalleryObjTest::TestInsertGalleryObject()
{
// Create theme
- std::unique_ptr<utl::TempFile> pTempDir;
- pTempDir.reset(new utl::TempFile(nullptr, true));
+ std::unique_ptr<utl::TempFileNamed> pTempDir;
+ pTempDir.reset(new utl::TempFileNamed(nullptr, true));
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
pTempDir->EnableKillingFile();
const OUString aGalleryURL = pTempDir->GetURL();
@@ -331,8 +331,8 @@ void GalleryObjTest::TestInsertGalleryObject()
void GalleryObjTest::TestRemoveGalleryObject()
{
// Create theme
- std::unique_ptr<utl::TempFile> pTempDir;
- pTempDir.reset(new utl::TempFile(nullptr, true));
+ std::unique_ptr<utl::TempFileNamed> pTempDir;
+ pTempDir.reset(new utl::TempFileNamed(nullptr, true));
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
pTempDir->EnableKillingFile();
const OUString aGalleryURL = pTempDir->GetURL();
@@ -386,8 +386,8 @@ void GalleryObjTest::TestRemoveGalleryObject()
void GalleryObjTest::TestChangePositionGalleryObject()
{
// Create theme
- std::unique_ptr<utl::TempFile> pTempDir;
- pTempDir.reset(new utl::TempFile(nullptr, true));
+ std::unique_ptr<utl::TempFileNamed> pTempDir;
+ pTempDir.reset(new utl::TempFileNamed(nullptr, true));
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
pTempDir->EnableKillingFile();
const OUString aGalleryURL = pTempDir->GetURL();
@@ -448,8 +448,8 @@ void GalleryObjTest::TestChangePositionGalleryObject()
void GalleryObjTest::TestGetThemeNameFromGalleryTheme()
{
// Create theme
- std::unique_ptr<utl::TempFile> pTempDir;
- pTempDir.reset(new utl::TempFile(nullptr, true));
+ std::unique_ptr<utl::TempFileNamed> pTempDir;
+ pTempDir.reset(new utl::TempFileNamed(nullptr, true));
CPPUNIT_ASSERT_MESSAGE("Could not create valid temporary directory", pTempDir->IsValid());
pTempDir->EnableKillingFile();
const OUString aGalleryURL = pTempDir->GetURL();
diff --git a/svx/qa/unit/unodraw.cxx b/svx/qa/unit/unodraw.cxx
index d026e07bc076..a1c8fd9d6249 100644
--- a/svx/qa/unit/unodraw.cxx
+++ b/svx/qa/unit/unodraw.cxx
@@ -87,7 +87,7 @@ CPPUNIT_TEST_FIXTURE(UnodrawTest, testWriterGraphicExport)
// picture.
xExportFilter->setSourceDocument(xShape);
- utl::TempFile aTempFile;
+ utl::TempFileNamed aTempFile;
aTempFile.EnableKillingFile();
uno::Sequence<beans::PropertyValue> aProperties(
comphelper::InitPropertySequence({ { "URL", uno::Any(aTempFile.GetURL()) },
diff --git a/svx/qa/unit/xoutdev.cxx b/svx/qa/unit/xoutdev.cxx
index f805f868207e..83f7c2801b06 100644
--- a/svx/qa/unit/xoutdev.cxx
+++ b/svx/qa/unit/xoutdev.cxx
@@ -67,7 +67,7 @@ CPPUNIT_TEST_FIXTURE(XOutdevTest, testPdfGraphicExport)
GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aURL, aStream));
// Export it.
- utl::TempFile aTempFile;
+ utl::TempFileNamed aTempFile;
aTempFile.EnableKillingFile();
XOutFlags const eFlags = XOutFlags::DontExpandFilename | XOutFlags::DontAddExtension
| XOutFlags::UseNativeIfPossible;
@@ -96,7 +96,7 @@ CPPUNIT_TEST_FIXTURE(XOutdevTest, testTdf60684)
GraphicFilter::GetGraphicFilter().ImportGraphic(aGraphic, aURL, aStream));
// Export it.
- utl::TempFile aTempFile;
+ utl::TempFileNamed aTempFile;
aTempFile.EnableKillingFile();
XOutFlags const eFlags = XOutFlags::DontExpandFilename | XOutFlags::DontAddExtension
| XOutFlags::UseNativeIfPossible;