summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--dbaccess/Library_dba.mk1
-rw-r--r--dbaccess/Library_dbu.mk1
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx22
-rw-r--r--dbaccess/source/core/dataaccess/datasource.hxx4
-rw-r--r--dbaccess/source/core/inc/migrwarndlg.hxx (renamed from dbaccess/source/ui/inc/migrwarndlg.hxx)2
-rw-r--r--dbaccess/source/core/misc/migrwarndlg.cxx (renamed from dbaccess/source/ui/dlg/migrwarndlg.cxx)2
-rw-r--r--dbaccess/source/ui/misc/datasourceconnector.cxx7
-rw-r--r--offapi/com/sun/star/sdbc/XDataSource.idl5
-rw-r--r--offapi/type_reference/offapi.idl2
9 files changed, 18 insertions, 28 deletions
diff --git a/dbaccess/Library_dba.mk b/dbaccess/Library_dba.mk
index 52eae77d8d78..fe80f157887b 100644
--- a/dbaccess/Library_dba.mk
+++ b/dbaccess/Library_dba.mk
@@ -117,6 +117,7 @@ $(eval $(call gb_Library_add_exception_objects,dba,\
dbaccess/source/core/misc/DatabaseDataProvider \
dbaccess/source/core/misc/dsntypes \
dbaccess/source/core/misc/objectnameapproval \
+ dbaccess/source/core/misc/migrwarndlg \
dbaccess/source/core/misc/PropertyForward \
dbaccess/source/core/misc/sdbcoretools \
dbaccess/source/core/misc/services \
diff --git a/dbaccess/Library_dbu.mk b/dbaccess/Library_dbu.mk
index b8ff06ecbf7f..908c1cf9471f 100644
--- a/dbaccess/Library_dbu.mk
+++ b/dbaccess/Library_dbu.mk
@@ -151,7 +151,6 @@ $(eval $(call gb_Library_add_exception_objects,dbu,\
dbaccess/source/ui/dlg/textconnectionsettings \
dbaccess/source/ui/dlg/UserAdmin \
dbaccess/source/ui/dlg/UserAdminDlg \
- dbaccess/source/ui/dlg/migrwarndlg \
dbaccess/source/ui/misc/asyncmodaldialog \
dbaccess/source/ui/misc/charsets \
dbaccess/source/ui/misc/controllerframe \
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index 135d5964df25..19a91e6143c6 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -29,6 +29,7 @@
#include <OAuthenticationContinuation.hxx>
#include <hsqlimport.hxx>
+#include <migrwarndlg.hxx>
#include <com/sun/star/beans/NamedValue.hpp>
#include <com/sun/star/beans/PropertyAttribute.hpp>
@@ -574,11 +575,6 @@ void ODatabaseSource::disposing()
m_pImpl.clear();
}
-OUString SAL_CALL ODatabaseSource::getConnectionUrl()
-{
- return m_pImpl->m_sConnectURL;
-}
-
Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString& _rUid, const OUString& _rPwd)
{
Reference< XConnection > xReturn;
@@ -588,8 +584,20 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
OUString sMigrEnvVal;
osl_getEnvironment(OUString("DBACCESS_HSQL_MIGRATION").pData,
&sMigrEnvVal.pData);
- bool bNeedMigration = m_pImpl->m_sConnectURL == "sdbc:embedded:hsqldb" &&
- (m_bMigationNeeded || !sMigrEnvVal.isEmpty());
+ 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")
+ bNeedMigration = true;
+ else
+ {
+ MigrationWarnDialog aWarnDlg{nullptr};
+ bNeedMigration = aWarnDlg.run() == RET_OK;
+ }
+ }
if(bNeedMigration)
m_pImpl->m_sConnectURL = "sdbc:embedded:firebird";
diff --git a/dbaccess/source/core/dataaccess/datasource.hxx b/dbaccess/source/core/dataaccess/datasource.hxx
index faa7b9901221..815b662506fe 100644
--- a/dbaccess/source/core/dataaccess/datasource.hxx
+++ b/dbaccess/source/core/dataaccess/datasource.hxx
@@ -83,7 +83,6 @@ private:
using ODatabaseSource_Base::rBHelper;
// note: this thing uses the ref-count of "this", see OBookmarkContainer::acquire!
OBookmarkContainer m_Bookmarks;
- bool m_bMigationNeeded = false;
::comphelper::OInterfaceContainerHelper2 m_aFlushListeners;
private:
@@ -162,9 +161,6 @@ public:
virtual css::uno::Reference< css::sdbc::XConnection > SAL_CALL getConnection( const OUString& user, const OUString& password ) override;
virtual void SAL_CALL setLoginTimeout( sal_Int32 seconds ) override;
virtual sal_Int32 SAL_CALL getLoginTimeout( ) override;
- virtual void SAL_CALL setMigrationNeeded( sal_Bool bNeeded ) override { m_bMigationNeeded = bNeeded; }
- virtual sal_Bool SAL_CALL getMigrationNeeded() override { return m_bMigationNeeded; }
- virtual OUString SAL_CALL getConnectionUrl() override;
//::css::sdb::XBookmarksSupplier
virtual css::uno::Reference< css::container::XNameAccess > SAL_CALL getBookmarks( ) override;
diff --git a/dbaccess/source/ui/inc/migrwarndlg.hxx b/dbaccess/source/core/inc/migrwarndlg.hxx
index 25e31046ce57..3e0935bd732c 100644
--- a/dbaccess/source/ui/inc/migrwarndlg.hxx
+++ b/dbaccess/source/core/inc/migrwarndlg.hxx
@@ -11,7 +11,7 @@
#include <vcl/weld.hxx>
-namespace dbaui
+namespace dbaccess
{
class MigrationWarnDialog : public weld::MessageDialogController
{
diff --git a/dbaccess/source/ui/dlg/migrwarndlg.cxx b/dbaccess/source/core/misc/migrwarndlg.cxx
index ef3fa007303c..cbbe6e3ca90c 100644
--- a/dbaccess/source/ui/dlg/migrwarndlg.cxx
+++ b/dbaccess/source/core/misc/migrwarndlg.cxx
@@ -9,7 +9,7 @@
#include <migrwarndlg.hxx>
-namespace dbaui
+namespace dbaccess
{
MigrationWarnDialog::MigrationWarnDialog(weld::Window* pParent)
: MessageDialogController(pParent, "dbaccess/ui/migrwarndlg.ui", "MigrationWarnDialog")
diff --git a/dbaccess/source/ui/misc/datasourceconnector.cxx b/dbaccess/source/ui/misc/datasourceconnector.cxx
index 406575239f68..664e7bf20601 100644
--- a/dbaccess/source/ui/misc/datasourceconnector.cxx
+++ b/dbaccess/source/ui/misc/datasourceconnector.cxx
@@ -40,7 +40,6 @@
#include <cppuhelper/exc_hlp.hxx>
#include <strings.hrc>
#include <strings.hxx>
-#include <migrwarndlg.hxx>
namespace dbaui
{
@@ -114,12 +113,6 @@ namespace dbaui
DBG_UNHANDLED_EXCEPTION("dbaccess");
}
- if(_xDataSource->getConnectionUrl().startsWithIgnoreAsciiCase("sdbc:embedded:hsqldb"))
- {
- MigrationWarnDialog aWarnDlg{m_pErrorMessageParent->GetFrameWeld()};
- _xDataSource->setMigrationNeeded(aWarnDlg.run() == RET_OK);
- }
-
// try to connect
SQLExceptionInfo aInfo;
try
diff --git a/offapi/com/sun/star/sdbc/XDataSource.idl b/offapi/com/sun/star/sdbc/XDataSource.idl
index f8b5bda8b553..c169b8972031 100644
--- a/offapi/com/sun/star/sdbc/XDataSource.idl
+++ b/offapi/com/sun/star/sdbc/XDataSource.idl
@@ -34,11 +34,6 @@
*/
published interface XDataSource: com::sun::star::uno::XInterface
{
- /** indicates whether database migration is needed or not.
- */
- [attribute] boolean MigrationNeeded;
-
- string getConnectionUrl();
/** attempts to establish a database connection.
@param user
diff --git a/offapi/type_reference/offapi.idl b/offapi/type_reference/offapi.idl
index 1c534cb024d9..337a45812b29 100644
--- a/offapi/type_reference/offapi.idl
+++ b/offapi/type_reference/offapi.idl
@@ -10212,8 +10212,6 @@ module com {
};
module sdbc {
published interface XDataSource {
- [attribute] boolean MigrationNeeded;
- string getConnectionUrl();
interface ::com::sun::star::uno::XInterface;
::com::sun::star::sdbc::XConnection getConnection([in] string user, [in] string password) raises (::com::sun::star::sdbc::SQLException);
void setLoginTimeout([in] long seconds) raises (::com::sun::star::sdbc::SQLException);