summaryrefslogtreecommitdiff
path: root/dbaccess
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 /dbaccess
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 'dbaccess')
-rw-r--r--dbaccess/qa/unit/dbtest_base.cxx6
-rw-r--r--dbaccess/qa/unit/embeddeddb_performancetest.cxx2
-rw-r--r--dbaccess/qa/unit/hsql_binary_import.cxx2
-rw-r--r--dbaccess/qa/unit/tdf119625.cxx2
-rw-r--r--dbaccess/qa/unit/tdf126268.cxx2
-rw-r--r--dbaccess/source/core/dataaccess/ModelImpl.cxx2
-rw-r--r--dbaccess/source/ui/misc/TableCopyHelper.cxx2
7 files changed, 9 insertions, 9 deletions
diff --git a/dbaccess/qa/unit/dbtest_base.cxx b/dbaccess/qa/unit/dbtest_base.cxx
index b5a3bd31cf90..6a2bbb2ef706 100644
--- a/dbaccess/qa/unit/dbtest_base.cxx
+++ b/dbaccess/qa/unit/dbtest_base.cxx
@@ -30,7 +30,7 @@ class DBTestBase
public:
DBTestBase() : UnoApiTest("dbaccess/qa/unit/data") {};
- utl::TempFile createTempCopy(std::u16string_view pathname);
+ utl::TempFileNamed createTempCopy(std::u16string_view pathname);
uno::Reference< XOfficeDatabaseDocument >
getDocumentForFileName(std::u16string_view sFileName);
@@ -42,10 +42,10 @@ public:
uno::Reference< XOfficeDatabaseDocument > const & xDocument);
};
-utl::TempFile DBTestBase::createTempCopy(std::u16string_view pathname) {
+utl::TempFileNamed DBTestBase::createTempCopy(std::u16string_view pathname) {
OUString url;
createFileURL(pathname, url);
- utl::TempFile tmp;
+ utl::TempFileNamed tmp;
tmp.EnableKillingFile();
auto const e = osl::File::copy(url, tmp.GetURL());
CPPUNIT_ASSERT_EQUAL_MESSAGE(
diff --git a/dbaccess/qa/unit/embeddeddb_performancetest.cxx b/dbaccess/qa/unit/embeddeddb_performancetest.cxx
index 17eaa52aeb9d..600704ef787d 100644
--- a/dbaccess/qa/unit/embeddeddb_performancetest.cxx
+++ b/dbaccess/qa/unit/embeddeddb_performancetest.cxx
@@ -195,7 +195,7 @@ void EmbeddedDBPerformanceTest::doPerformanceTestOnODB(
std::u16string_view rDBName,
const bool bUsePreparedStatement)
{
- ::utl::TempFile aFile;
+ ::utl::TempFileNamed aFile;
aFile.EnableKillingFile();
{
diff --git a/dbaccess/qa/unit/hsql_binary_import.cxx b/dbaccess/qa/unit/hsql_binary_import.cxx
index 4eac0cdc4130..c77d9e5328d3 100644
--- a/dbaccess/qa/unit/hsql_binary_import.cxx
+++ b/dbaccess/qa/unit/hsql_binary_import.cxx
@@ -46,7 +46,7 @@ void HsqlBinaryImportTest::testBinaryImport()
}
// the migration requires the file to be writable
- utl::TempFile const temp(createTempCopy(u"hsqldb_migration_test.odb"));
+ utl::TempFileNamed const temp(createTempCopy(u"hsqldb_migration_test.odb"));
uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
diff --git a/dbaccess/qa/unit/tdf119625.cxx b/dbaccess/qa/unit/tdf119625.cxx
index 22fb5849305e..267730286561 100644
--- a/dbaccess/qa/unit/tdf119625.cxx
+++ b/dbaccess/qa/unit/tdf119625.cxx
@@ -66,7 +66,7 @@ void Tdf119625Test::testTime()
}
// the migration requires the file to be writable
- utl::TempFile const temp(createTempCopy(u"tdf119625.odb"));
+ utl::TempFileNamed const temp(createTempCopy(u"tdf119625.odb"));
uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
diff --git a/dbaccess/qa/unit/tdf126268.cxx b/dbaccess/qa/unit/tdf126268.cxx
index a4ed9dc3b868..b325d8dc1f62 100644
--- a/dbaccess/qa/unit/tdf126268.cxx
+++ b/dbaccess/qa/unit/tdf126268.cxx
@@ -60,7 +60,7 @@ void Tdf126268Test::testNumbers()
}
// the migration requires the file to be writable
- utl::TempFile const temp(createTempCopy(u"tdf126268.odb"));
+ utl::TempFileNamed const temp(createTempCopy(u"tdf126268.odb"));
uno::Reference<XOfficeDatabaseDocument> const xDocument = getDocumentForUrl(temp.GetURL());
uno::Reference<XConnection> xConnection = getConnectionForDocument(xDocument);
diff --git a/dbaccess/source/core/dataaccess/ModelImpl.cxx b/dbaccess/source/core/dataaccess/ModelImpl.cxx
index 3db610503313..3e21289dbe9a 100644
--- a/dbaccess/source/core/dataaccess/ModelImpl.cxx
+++ b/dbaccess/source/core/dataaccess/ModelImpl.cxx
@@ -836,7 +836,7 @@ bool ODatabaseModelImpl::commitEmbeddedStorage( bool _bPreventRootCommits )
bool ODatabaseModelImpl::commitStorageIfWriteable_ignoreErrors( const Reference< XStorage >& _rxStorage )
{
bool bTryToPreserveScriptSignature = false;
- utl::TempFile aTempFile;
+ utl::TempFileNamed aTempFile;
aTempFile.EnableKillingFile();
OUString sTmpFileUrl = aTempFile.GetURL();
SignatureState aSignatureState = getScriptingSignatureState();
diff --git a/dbaccess/source/ui/misc/TableCopyHelper.cxx b/dbaccess/source/ui/misc/TableCopyHelper.cxx
index 77aa33472921..c69c04699769 100644
--- a/dbaccess/source/ui/misc/TableCopyHelper.cxx
+++ b/dbaccess/source/ui/misc/TableCopyHelper.cxx
@@ -269,7 +269,7 @@ bool OTableCopyHelper::copyTagTable(const TransferableDataHelper& _aDroppedData
if ( bRet )
{
// now we need to copy the stream
- ::utl::TempFile aTmp;
+ ::utl::TempFileNamed aTmp;
_rAsyncDrop.aUrl = aTmp.GetURL();
::tools::SvRef<SotTempStream> aNew = new SotTempStream( aTmp.GetFileName() );
_rAsyncDrop.aHtmlRtfStorage->Seek(STREAM_SEEK_TO_BEGIN);