diff options
author | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-07-12 08:34:34 +0100 |
---|---|---|
committer | Andrzej J.R. Hunt <andrzej@ahunt.org> | 2013-07-16 16:40:13 +0200 |
commit | 25772a93fa8a3a8378fdc44178b5d37a4962cca9 (patch) | |
tree | 8c2c0f06a59711bdc1a12c701e441cf04bd565d2 | |
parent | 34d60277c2e7a82bdbb45b6d2db8d9ba2b78263a (diff) |
Make db location a static member variable.
Change-Id: I138c18839f2816baae24ef84eb08dbb71cce2948
-rw-r--r-- | connectivity/source/drivers/firebird/FConnection.cxx | 11 | ||||
-rw-r--r-- | connectivity/source/drivers/firebird/FConnection.hxx | 2 |
2 files changed, 6 insertions, 7 deletions
diff --git a/connectivity/source/drivers/firebird/FConnection.cxx b/connectivity/source/drivers/firebird/FConnection.cxx index 3f0f070b3be3..f9192762aa95 100644 --- a/connectivity/source/drivers/firebird/FConnection.cxx +++ b/connectivity/source/drivers/firebird/FConnection.cxx @@ -81,6 +81,8 @@ using namespace com::sun::star::lang; using namespace com::sun::star::sdbc; using namespace com::sun::star::uno; +const OUString OConnection::sDBLocation( "firebird.fdb" ); + OConnection::OConnection(FirebirdDriver* _pDriver) :OMetaConnection_BASE(m_aMutex), OSubComponent<OConnection, OConnection_BASE>((::cppu::OWeakObject*)_pDriver, this), @@ -173,7 +175,6 @@ void OConnection::construct(const ::rtl::OUString& url, const Sequence< Property bIsNewDatabase = !m_xEmbeddedStorage->hasElements(); - const OUString sDBName( "firebird.fdb" ); // Location within .odb container m_aURL = utl::TempFile::CreateTempName() + ".fdb"; SAL_INFO("connectivity.firebird", "Temporary .fdb location: " @@ -181,14 +182,14 @@ void OConnection::construct(const ::rtl::OUString& url, const Sequence< Property if (!bIsNewDatabase) { SAL_INFO("connectivity.firebird", "Extracting .fdb from .odb" ); - if (!m_xEmbeddedStorage->isStreamElement(sDBName)) + if (!m_xEmbeddedStorage->isStreamElement(sDBLocation)) { ::connectivity::SharedResources aResources; const OUString sMessage = aResources.getResourceString(STR_ERROR_NEW_VERSION); ::dbtools::throwGenericSQLException(sMessage ,*this); } - Reference< XStream > xDBStream(m_xEmbeddedStorage->openStreamElement(sDBName, + Reference< XStream > xDBStream(m_xEmbeddedStorage->openStreamElement(sDBLocation, ElementModes::READ)); uno::Reference< ucb::XSimpleFileAccess2 > xFileAccess( @@ -554,11 +555,9 @@ void SAL_CALL OConnection::documentEventOccured( const DocumentEvent& _Event ) { if ( m_bIsEmbedded && m_xEmbeddedStorage.is() ) { - const OUString sDBName( "firebird.fdb" ); // Location within .odb container - SAL_INFO("connectivity.firebird", "Writing .fdb into .odb" ); - Reference< XStream > xDBStream(m_xEmbeddedStorage->openStreamElement(sDBName, + Reference< XStream > xDBStream(m_xEmbeddedStorage->openStreamElement(sDBLocation, ElementModes::WRITE)); using namespace ::comphelper; diff --git a/connectivity/source/drivers/firebird/FConnection.hxx b/connectivity/source/drivers/firebird/FConnection.hxx index d8338b3992a9..543b4b0362a8 100644 --- a/connectivity/source/drivers/firebird/FConnection.hxx +++ b/connectivity/source/drivers/firebird/FConnection.hxx @@ -82,7 +82,7 @@ namespace connectivity friend class connectivity::firebird::OSubComponent<OConnection, OConnection_BASE>; protected: - + static const OUString sDBLocation; // Location within .odb container rtl_TextEncoding m_nTextEncoding; // the encoding which is used for all text conversions //==================================================================== // Data attributes |