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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Wed Aug 15 09:58:07 UTC 2018


 dbaccess/source/ui/uno/dbinteraction.cxx |   10 +++++++++-
 dbaccess/source/ui/uno/dbinteraction.hxx |    7 +++++++
 svx/source/form/formcontroller.cxx       |    3 ++-
 3 files changed, 18 insertions(+), 2 deletions(-)

New commits:
commit d52f64b1ae7a95704ee9b17b034a43fcea05d1ea
Author:     Maxim Monastirsky <momonasmon at gmail.com>
AuthorDate: Tue Aug 14 02:28:54 2018 +0300
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Wed Aug 15 11:57:45 2018 +0200

    tdf#119245 Set a parent for OParameterDialog
    
    Change-Id: I5a7f4b43027a72f049e12c06cd583c6545b028f5
    Reviewed-on: https://gerrit.libreoffice.org/58952
    Tested-by: Jenkins
    Reviewed-by: Maxim Monastirsky <momonasmon at gmail.com>
    (cherry picked from commit ea77c31944c7ca8896e5e58f3f57d9a9cbe9b6bb)
    Reviewed-on: https://gerrit.libreoffice.org/59001
    Tested-by: Xisco Faulí <xiscofauli at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/dbaccess/source/ui/uno/dbinteraction.cxx b/dbaccess/source/ui/uno/dbinteraction.cxx
index 930dd4bb1386..b8c6ad061e18 100644
--- a/dbaccess/source/ui/uno/dbinteraction.cxx
+++ b/dbaccess/source/ui/uno/dbinteraction.cxx
@@ -37,6 +37,8 @@
 #include <CollectionView.hxx>
 #include <UITools.hxx>
 #include <comphelper/processfactory.hxx>
+#include <comphelper/sequenceashashmap.hxx>
+#include <toolkit/helper/vclunohelper.hxx>
 
 extern "C" void createRegistryInfo_OInteractionHandler()
 {
@@ -63,6 +65,12 @@ namespace dbaui
             "BasicInteractionHandler::BasicInteractionHandler: enabling legacy behavior, there should be no clients of this anymore!" );
     }
 
+    void SAL_CALL BasicInteractionHandler::initialize(const Sequence<Any>& rArgs)
+    {
+        comphelper::SequenceAsHashMap aMap(rArgs);
+        m_xParentWindow.set(aMap.getValue("Parent"), UNO_QUERY);
+    }
+
     sal_Bool SAL_CALL BasicInteractionHandler::handleInteractionRequest( const Reference< XInteractionRequest >& i_rRequest )
     {
         return impl_handle_throw( i_rRequest );
@@ -124,7 +132,7 @@ namespace dbaui
             xParamCallback.set(_rContinuations[nParamPos], UNO_QUERY);
         OSL_ENSURE(xParamCallback.is(), "BasicInteractionHandler::implHandle(ParametersRequest): can't set the parameters without an appropriate interaction handler!s");
 
-        ScopedVclPtrInstance< OParameterDialog > aDlg(nullptr, _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext);
+        ScopedVclPtrInstance< OParameterDialog > aDlg(VCLUnoHelper::GetWindow(m_xParentWindow), _rParamRequest.Parameters, _rParamRequest.Connection, m_xContext);
         sal_Int16 nResult = aDlg->Execute();
         try
         {
diff --git a/dbaccess/source/ui/uno/dbinteraction.hxx b/dbaccess/source/ui/uno/dbinteraction.hxx
index 9bc5f365799a..e0c510cbc11a 100644
--- a/dbaccess/source/ui/uno/dbinteraction.hxx
+++ b/dbaccess/source/ui/uno/dbinteraction.hxx
@@ -24,6 +24,8 @@
 
 #include <apitools.hxx>
 
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
 #include <com/sun/star/lang/XServiceInfo.hpp>
 #include <com/sun/star/task/XInteractionHandler2.hpp>
 #include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -45,6 +47,7 @@ namespace dbaui
 
     // BasicInteractionHandler
     typedef ::cppu::WeakImplHelper<   css::lang::XServiceInfo
+                                  ,   css::lang::XInitialization
                                   ,   css::task::XInteractionHandler2
                                   >   BasicInteractionHandler_Base;
     /** implements an <type scope="com.sun.star.task">XInteractionHandler</type> for
@@ -61,6 +64,7 @@ namespace dbaui
     class BasicInteractionHandler
                 :public BasicInteractionHandler_Base
     {
+        css::uno::Reference< css::awt::XWindow > m_xParentWindow;
         const css::uno::Reference< css::uno::XComponentContext >
                             m_xContext;
         const bool          m_bFallbackToGeneric;
@@ -71,6 +75,9 @@ namespace dbaui
             const bool i_bFallbackToGeneric
         );
 
+        // XInitialization
+        virtual void SAL_CALL initialize( const css::uno::Sequence< css::uno::Any >& rArgs ) override;
+
         // XInteractionHandler2
         virtual sal_Bool SAL_CALL handleInteractionRequest( const css::uno::Reference< css::task::XInteractionRequest >& Request ) override;
 
diff --git a/svx/source/form/formcontroller.cxx b/svx/source/form/formcontroller.cxx
index 4691584d8b24..19b11f16caa1 100644
--- a/svx/source/form/formcontroller.cxx
+++ b/svx/source/form/formcontroller.cxx
@@ -4204,7 +4204,8 @@ bool FormController::ensureInteractionHandler()
         return false;
     m_bAttemptedHandlerCreation = true;
 
-    m_xInteractionHandler = InteractionHandler::createWithParent(m_xComponentContext, nullptr);
+    m_xInteractionHandler = InteractionHandler::createWithParent(m_xComponentContext,
+                                                                 VCLUnoHelper::GetInterface(getDialogParentWindow()));
     return m_xInteractionHandler.is();
 }
 


More information about the Libreoffice-commits mailing list