diff options
author | Rene Engelhard <rene@debian.org> | 2018-05-07 15:20:01 +0000 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-05-11 10:15:44 +0200 |
commit | 752a1e27246e768984fed43153f3327379b76c99 (patch) | |
tree | 48d1c44655f258c6e4afb9ee9923d196ea8b24c6 /dbaccess/source | |
parent | e57462cd7b08df2794b1c81e7bb15ed96afef1f1 (diff) |
(try to) fix dbaccess firebird-related tests
after 1c5c9b84df270e41c68e68bb69fbf183fc20eed2
Move headless check into test and add missing component file for firebird...
Also check for ENABLE_FIREBIRD_SDBC...
Change-Id: I27ea9fb08ebcce701a54686a8986e5071a8bcf96
Reviewed-on: https://gerrit.libreoffice.org/53940
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Michael Stahl <Michael.Stahl@cib.de>
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/core/dataaccess/datasource.cxx | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx index 19a91e6143c6..ffe45b4521a0 100644 --- a/dbaccess/source/core/dataaccess/datasource.cxx +++ b/dbaccess/source/core/dataaccess/datasource.cxx @@ -74,6 +74,8 @@ #include <iterator> #include <set> +#include <config_firebird.h> + using namespace ::com::sun::star::sdbc; using namespace ::com::sun::star::sdbcx; using namespace ::com::sun::star::sdb; @@ -581,25 +583,24 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString Reference< XDriverManager > xManager; - OUString sMigrEnvVal; - osl_getEnvironment(OUString("DBACCESS_HSQL_MIGRATION").pData, - &sMigrEnvVal.pData); +#if ENABLE_FIREBIRD_SDBC bool bNeedMigration = false; if(m_pImpl->m_sConnectURL == "sdbc:embedded:hsqldb") { - OUString sSalUseVclplugin; - osl_getEnvironment(OUString("SAL_USE_VCLPLUGIN").pData, - &sSalUseVclplugin.pData); - if(!sMigrEnvVal.isEmpty() || sSalUseVclplugin == "svp") + OUString sMigrEnvVal; + osl_getEnvironment(OUString("DBACCESS_HSQL_MIGRATION").pData, + &sMigrEnvVal.pData); + if(!sMigrEnvVal.isEmpty()) bNeedMigration = true; else { MigrationWarnDialog aWarnDlg{nullptr}; bNeedMigration = aWarnDlg.run() == RET_OK; } + if (bNeedMigration) + m_pImpl->m_sConnectURL = "sdbc:embedded:firebird"; } - if(bNeedMigration) - m_pImpl->m_sConnectURL = "sdbc:embedded:firebird"; +#endif try { xManager.set( ConnectionPool::create( m_pImpl->m_aContext ), UNO_QUERY_THROW ); @@ -712,6 +713,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString throwGenericSQLException( sMessage, static_cast< XDataSource* >( this ), makeAny( aContext ) ); } +#if ENABLE_FIREBIRD_SDBC if( bNeedMigration ) { Reference< css::document::XDocumentSubStorageSupplier> xDocSup( @@ -720,6 +722,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString xDocSup->getDocumentSubStorage("database",ElementModes::READWRITE) ); importer.importHsqlDatabase(); } +#endif return xReturn; } |