[Libreoffice-commits] core.git: svx/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Thu Mar 11 19:25:06 UTC 2021


 svx/source/form/fmvwimp.cxx |    9 +++++++--
 svx/source/inc/fmvwimp.hxx  |    2 ++
 2 files changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 7946225280bfac1a04d73c69ff3eda8ac8b4e820
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Thu Mar 11 10:51:48 2021 +0000
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Thu Mar 11 20:24:17 2021 +0100

    factor out a FmXFormView::GetParentWindow
    
    Change-Id: I35d5de294ac08e1ec6a597835b879dc1f377ef86
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/112332
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/svx/source/form/fmvwimp.cxx b/svx/source/form/fmvwimp.cxx
index 4bc1c96fb13c..f776d28ab4d7 100644
--- a/svx/source/form/fmvwimp.cxx
+++ b/svx/source/form/fmvwimp.cxx
@@ -1014,6 +1014,12 @@ void FmXFormView::breakCreateFormObject()
     m_xLastCreatedControlModel.clear();
 }
 
+Reference<XWindow> FmXFormView::GetParentWindow()
+{
+    const vcl::Window* pCurrentWindow = m_pView ? dynamic_cast<const vcl::Window*>(m_pView->GetActualOutDev()) : nullptr;
+    return VCLUnoHelper::GetInterface(const_cast<vcl::Window*>(pCurrentWindow));
+}
+
 IMPL_LINK_NOARG( FmXFormView, OnStartControlWizard, void*, void )
 {
     m_nControlWizardEvent = nullptr;
@@ -1051,8 +1057,7 @@ IMPL_LINK_NOARG( FmXFormView, OnStartControlWizard, void*, void )
         // build the argument list
         ::comphelper::NamedValueCollection aWizardArgs;
         aWizardArgs.put("ObjectModel", m_xLastCreatedControlModel);
-        const vcl::Window* pCurrentWindow = m_pView ? dynamic_cast<const vcl::Window*>(m_pView->GetActualOutDev()) : nullptr;
-        aWizardArgs.put("ParentWindow", VCLUnoHelper::GetInterface(const_cast<vcl::Window*>(pCurrentWindow)));
+        aWizardArgs.put("ParentWindow", GetParentWindow());
 
         // create the wizard object
         Reference< XExecutableDialog > xWizard;
diff --git a/svx/source/inc/fmvwimp.hxx b/svx/source/inc/fmvwimp.hxx
index 36f1dcda1883..62291ad8b195 100644
--- a/svx/source/inc/fmvwimp.hxx
+++ b/svx/source/inc/fmvwimp.hxx
@@ -172,6 +172,8 @@ class FmXFormView : public ::cppu::WeakImplHelper<
 
     FmFormShell* GetFormShell() const;
 
+    css::uno::Reference<css::awt::XWindow> GetParentWindow();
+
 protected:
     FmXFormView( FmFormView* _pView );
     virtual ~FmXFormView() override;


More information about the Libreoffice-commits mailing list