[Libreoffice-commits] core.git: Branch 'libreoffice-6-1' - dbaccess/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 29 09:21:16 UTC 2018


 dbaccess/source/core/dataaccess/datasource.cxx |   19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

New commits:
commit 4d40c1afd98cd30a0ab59da6cbd4a8dadb1027fa
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Aug 23 15:13:16 2018 +0100
Commit:     Miklos Vajna <vmiklos at collabora.co.uk>
CommitDate: Wed Aug 29 11:20:48 2018 +0200

    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 at collabora.co.uk>

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)


More information about the Libreoffice-commits mailing list