diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-12-01 20:05:17 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-12-02 09:52:47 +0100 |
commit | 16758bd6533f76e9e72775405ecfc9f38a659155 (patch) | |
tree | 78589f1e931ddca20871d522775f0d84bd85986f /forms | |
parent | ea2aeb6917a04401f95bab7aac37f4d070e07128 (diff) |
extract to a GetDialogParent method
Change-Id: Ibf7141fa916797d661f12bd60657df47903014f5
Reviewed-on: https://gerrit.libreoffice.org/84167
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'forms')
-rw-r--r-- | forms/source/runtime/formoperations.cxx | 30 | ||||
-rw-r--r-- | forms/source/runtime/formoperations.hxx | 3 |
2 files changed, 21 insertions, 12 deletions
diff --git a/forms/source/runtime/formoperations.cxx b/forms/source/runtime/formoperations.cxx index c26a758a2068..01107afd7e2c 100644 --- a/forms/source/runtime/formoperations.cxx +++ b/forms/source/runtime/formoperations.cxx @@ -1669,6 +1669,23 @@ namespace frm } } + css::uno::Reference<css::awt::XWindow> FormOperations::GetDialogParent() const + { + css::uno::Reference<css::awt::XWindow> xDialogParent; + + //tdf#122152 extract parent for dialog + if (m_xController.is()) + { + css::uno::Reference<css::awt::XControl> xContainerControl(m_xController->getContainer(), css::uno::UNO_QUERY); + if (xContainerControl.is()) + { + css::uno::Reference<css::awt::XWindowPeer> xContainerPeer = xContainerControl->getPeer(); + xDialogParent = css::uno::Reference<css::awt::XWindow>(xContainerPeer, css::uno::UNO_QUERY); + } + } + + return xDialogParent; + } void FormOperations::impl_executeFilterOrSort_throw( bool _bFilter ) const { @@ -1682,18 +1699,7 @@ namespace frm return; try { - css::uno::Reference<css::awt::XWindow> xDialogParent; - - //tdf#122152 extract parent for dialog - if (m_xController.is()) - { - css::uno::Reference<css::awt::XControl> xContainerControl(m_xController->getContainer(), css::uno::UNO_QUERY); - if (xContainerControl.is()) - { - css::uno::Reference<css::awt::XWindowPeer> xContainerPeer = xContainerControl->getPeer(); - xDialogParent = css::uno::Reference<css::awt::XWindow>(xContainerPeer, css::uno::UNO_QUERY); - } - } + css::uno::Reference<css::awt::XWindow> xDialogParent(GetDialogParent()); Reference< XExecutableDialog> xDialog; if ( _bFilter ) diff --git a/forms/source/runtime/formoperations.hxx b/forms/source/runtime/formoperations.hxx index ad1494fecf64..1e948953cf32 100644 --- a/forms/source/runtime/formoperations.hxx +++ b/forms/source/runtime/formoperations.hxx @@ -346,6 +346,9 @@ namespace frm FormOperations& operator=( const FormOperations& ) = delete; public: + + css::uno::Reference<css::awt::XWindow> GetDialogParent() const; + class MethodGuard { FormOperations& m_rOwner; |