summaryrefslogtreecommitdiff
path: root/dbaccess
diff options
context:
space:
mode:
authorMaxim Monastirsky <momonasmon@gmail.com>2018-08-14 02:28:54 +0300
committerCaolán McNamara <caolanm@redhat.com>2018-08-15 11:57:45 +0200
commitd52f64b1ae7a95704ee9b17b034a43fcea05d1ea (patch)
tree5809587d7ef7f21ba959ae39099ac1cbc6f4e184 /dbaccess
parent24e3426546718a9df1c0066b1f955b1d0fe4d4ea (diff)
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@gmail.com> (cherry picked from commit ea77c31944c7ca8896e5e58f3f57d9a9cbe9b6bb) Reviewed-on: https://gerrit.libreoffice.org/59001 Tested-by: Xisco Faulí <xiscofauli@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/uno/dbinteraction.cxx10
-rw-r--r--dbaccess/source/ui/uno/dbinteraction.hxx7
2 files changed, 16 insertions, 1 deletions
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;