summaryrefslogtreecommitdiffstats
path: root/forms
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-08-16 20:23:50 +0100
committerMiklos Vajna <vmiklos@collabora.com>2019-08-29 09:40:09 +0200
commita7035eb87aef491b52fae83675dd4d1a9877de4a (patch)
tree37d6ee480beb5128deadaa23b479a5ed22ee4b89 /forms
parentUpdate git submodules (diff)
downloadcore-a7035eb87aef491b52fae83675dd4d1a9877de4a.tar.gz
core-a7035eb87aef491b52fae83675dd4d1a9877de4a.zip
tdf#125340 transport preferred dialog parent down the migration dialog
Change-Id: Icb7bab35eac3ae08fb82d73f559ef161dd1820c3 Reviewed-on: https://gerrit.libreoffice.org/77638 Tested-by: Jenkins Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Diffstat (limited to 'forms')
-rw-r--r--forms/source/component/DatabaseForm.cxx23
1 files changed, 22 insertions, 1 deletions
diff --git a/forms/source/component/DatabaseForm.cxx b/forms/source/component/DatabaseForm.cxx
index 2367a06b5441..3f7c04ea8121 100644
--- a/forms/source/component/DatabaseForm.cxx
+++ b/forms/source/component/DatabaseForm.cxx
@@ -2718,6 +2718,21 @@ void ODatabaseForm::stopSharingConnection( )
}
}
+namespace
+{
+ Reference<css::awt::XWindow> GetDialogParentWindow(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;
+ return xFrame->getContainerWindow();
+ }
+}
bool ODatabaseForm::implEnsureConnection()
{
@@ -2759,9 +2774,15 @@ bool ODatabaseForm::implEnsureConnection()
if (m_xAggregateSet.is())
{
+ //Dig out a suitable parent for any warning dialogs
+ Reference<css::awt::XWindow> m_xDialogParent;
+ Reference<XChild> xParent(m_xParent, UNO_QUERY);
+ if (xParent.is())
+ m_xDialogParent = GetDialogParentWindow(getXModel(xParent->getParent()));
+
Reference< XConnection > xConnection = connectRowset(
Reference<XRowSet> (m_xAggregate, UNO_QUERY),
- m_xContext
+ m_xContext, m_xDialogParent
);
return xConnection.is();
}