diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2022-09-21 20:54:00 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-29 09:11:18 +0200 |
commit | 4b95451f859bac8e05956ce12df17f1ee410032d (patch) | |
tree | 2ebe03c8ecbba3c9179d33c346774e037fcfc224 /connectivity | |
parent | a08468c1a5255d3fb04cd8a0dc627acdea40426a (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 'connectivity')
4 files changed, 7 insertions, 7 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index e19abc6ed1f3..e194b6a222df 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -2478,13 +2478,13 @@ OUString ODbaseTable::createTempFile() aIdent += "/"; OUString sExt("." + m_pConnection->getExtension()); - TempFile aTempFile(m_Name, true, sExt, &aIdent); - if(!aTempFile.IsValid()) + OUString aTempFileURL = utl::CreateTempURL(m_Name, true, sExt, &aIdent); + if(aTempFileURL.isEmpty()) getConnection()->throwGenericSQLException(STR_COULD_NOT_ALTER_TABLE, *this); INetURLObject aURL; aURL.SetSmartProtocol(INetProtocol::File); - aURL.SetURL(aTempFile.GetURL()); + aURL.SetURL(aTempFileURL); OUString sNewName(aURL.getName().copy(0, aURL.getName().getLength() - sExt.getLength())); diff --git a/connectivity/source/drivers/firebird/Connection.cxx b/connectivity/source/drivers/firebird/Connection.cxx index 9230eb22f13b..e673d3f9fbff 100644 --- a/connectivity/source/drivers/firebird/Connection.cxx +++ b/connectivity/source/drivers/firebird/Connection.cxx @@ -161,7 +161,7 @@ void Connection::construct(const OUString& url, const Sequence< PropertyValue >& bIsNewDatabase = !m_xEmbeddedStorage->hasElements(); - m_pDatabaseFileDir.reset(new ::utl::TempFile(nullptr, true)); + m_pDatabaseFileDir.reset(new ::utl::TempFileNamed(nullptr, true)); m_pDatabaseFileDir->EnableKillingFile(); m_sFirebirdURL = m_pDatabaseFileDir->GetFileName() + "/firebird.fdb"; m_sFBKPath = m_pDatabaseFileDir->GetFileName() + "/firebird.fbk"; diff --git a/connectivity/source/drivers/firebird/Connection.hxx b/connectivity/source/drivers/firebird/Connection.hxx index 9fdb0d4d3320..fa896439c9e7 100644 --- a/connectivity/source/drivers/firebird/Connection.hxx +++ b/connectivity/source/drivers/firebird/Connection.hxx @@ -104,7 +104,7 @@ namespace connectivity::firebird * The extracted .fbk is written in firebird.fbk, the temporary * .fdb is stored as firebird.fdb. */ - std::unique_ptr< ::utl::TempFile > m_pDatabaseFileDir; + std::unique_ptr< ::utl::TempFileNamed > m_pDatabaseFileDir; /** * Path for our extracted .fbk file. * diff --git a/connectivity/source/drivers/firebird/Driver.hxx b/connectivity/source/drivers/firebird/Driver.hxx index 06841d937e70..d884b5008d6a 100644 --- a/connectivity/source/drivers/firebird/Driver.hxx +++ b/connectivity/source/drivers/firebird/Driver.hxx @@ -45,8 +45,8 @@ namespace connectivity::firebird { private: css::uno::Reference<css::uno::XComponentContext> m_aContext; - ::utl::TempFile m_firebirdTMPDirectory; - ::utl::TempFile m_firebirdLockDirectory; + ::utl::TempFileNamed m_firebirdTMPDirectory; + ::utl::TempFileNamed m_firebirdLockDirectory; protected: ::osl::Mutex m_aMutex; // mutex is need to control member access |