diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-25 10:30:56 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-25 13:24:11 +0200 |
commit | b0cc179a728603d62fd62595f039d2d856f8c9c3 (patch) | |
tree | dae6ad2f37a41a2b8adc28aa81ac3cd50bb077d5 /sw/source/uibase | |
parent | 11b06f0e00fc21654384e2816842ab101e15010e (diff) |
add XInitialization to allow setting explicit dialog parent
Change-Id: Icc2626b6b3defeb6c02a43cee14cdb97dc573870
Reviewed-on: https://gerrit.libreoffice.org/76290
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/uiview/uivwimp.cxx | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sw/source/uibase/uiview/uivwimp.cxx b/sw/source/uibase/uiview/uivwimp.cxx index 01a48a3cba35..7b2130939798 100644 --- a/sw/source/uibase/uiview/uivwimp.cxx +++ b/sw/source/uibase/uiview/uivwimp.cxx @@ -24,6 +24,7 @@ #include <com/sun/star/scanner/XScannerManager2.hpp> #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp> +#include <comphelper/propertysequence.hxx> #include <vcl/weld.hxx> #include <vcl/svapp.hxx> #include <vcl/wrkwin.hxx> @@ -128,6 +129,19 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq ) { Reference< XEventListener > xLstner = &rListener; ScannerContext aContext( aContexts.getConstArray()[ 0 ] ); + + Reference<lang::XInitialization> xInit(xScanMgr, UNO_QUERY); + if (xInit.is()) + { + // initialize dialog + weld::Window* pWindow = rReq.GetFrameWeld(); + uno::Sequence<uno::Any> aSeq(comphelper::InitAnyPropertySequence( + { + {"ParentWindow", pWindow ? uno::Any(pWindow->GetXWindow()) : uno::Any(Reference<awt::XWindow>())} + })); + xInit->initialize( aSeq ); + } + bDone = xScanMgr->configureScannerAndScan( aContext, xLstner ); } } @@ -170,7 +184,7 @@ void SwView_Impl::ExecuteScan( SfxRequest& rReq ) if( !bDone ) { - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(nullptr, + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(rReq.GetFrameWeld(), VclMessageType::Info, VclButtonsType::Ok, SwResId(STR_SCAN_NOSOURCE))); xBox->run(); |