summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-08-23 15:13:16 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2018-08-29 11:20:48 +0200
commit4d40c1afd98cd30a0ab59da6cbd4a8dadb1027fa (patch)
treedd376e0a91bd3ff31d14e947fd8accdaf1819011 /dbaccess
parent89c4a0a60a711c67fa1e63c0fedf950265b84b3d (diff)
give the migration warn dialog a parent
Change-Id: Ie133c81464d87e5fbcfa9ff5d3c43f470b48d620 Reviewed-on: https://gerrit.libreoffice.org/59509 Tested-by: Jenkins Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/core/dataaccess/datasource.cxx19
1 files changed, 18 insertions, 1 deletions
diff --git a/dbaccess/source/core/dataaccess/datasource.cxx b/dbaccess/source/core/dataaccess/datasource.cxx
index 22c7f6685d1a..7943104ff0a5 100644
--- a/dbaccess/source/core/dataaccess/datasource.cxx
+++ b/dbaccess/source/core/dataaccess/datasource.cxx
@@ -578,6 +578,23 @@ void ODatabaseSource::disposing()
m_pImpl.clear();
}
+namespace
+{
+ weld::Window* GetFrameWeld(const Reference<XModel>& rModel)
+ {
+ if (!rModel.is())
+ return nullptr;
+ Reference<XController> xController(rModel->getCurrentController());
+ if (!xController.is())
+ return nullptr;
+ Reference<XFrame> xFrame(xController->getFrame());
+ if (!xFrame.is())
+ return nullptr;
+ Reference<css::awt::XWindow> xWindow(xFrame->getContainerWindow());
+ return Application::GetFrameWeld(xWindow);
+ }
+}
+
Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString& _rUid, const OUString& _rPwd)
{
Reference< XConnection > xReturn;
@@ -597,7 +614,7 @@ Reference< XConnection > ODatabaseSource::buildLowLevelConnection(const OUString
bNeedMigration = true;
else
{
- MigrationWarnDialog aWarnDlg{nullptr};
+ MigrationWarnDialog aWarnDlg(GetFrameWeld(m_pImpl->getModel_noCreate()));
bNeedMigration = aWarnDlg.run() == RET_OK;
}
if (bNeedMigration)