summaryrefslogtreecommitdiff
path: root/extensions/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-07-25 10:30:56 +0100
committerCaolán McNamara <caolanm@redhat.com>2019-07-25 13:24:11 +0200
commitb0cc179a728603d62fd62595f039d2d856f8c9c3 (patch)
treedae6ad2f37a41a2b8adc28aa81ac3cd50bb077d5 /extensions/source
parent11b06f0e00fc21654384e2816842ab101e15010e (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 'extensions/source')
-rw-r--r--extensions/source/scanner/scanner.cxx9
-rw-r--r--extensions/source/scanner/scanner.hxx7
-rw-r--r--extensions/source/scanner/scanunx.cxx4
3 files changed, 16 insertions, 4 deletions
diff --git a/extensions/source/scanner/scanner.cxx b/extensions/source/scanner/scanner.cxx
index e03cf30e9737..d51fca0b1ef9 100644
--- a/extensions/source/scanner/scanner.cxx
+++ b/extensions/source/scanner/scanner.cxx
@@ -20,7 +20,7 @@
#include "scanner.hxx"
#include <cppuhelper/supportsservice.hxx>
-
+#include <comphelper/namedvaluecollection.hxx>
Reference< XInterface > ScannerManager_CreateInstance( const Reference< css::lang::XMultiServiceFactory >& /*rxFactory*/ )
{
@@ -83,4 +83,11 @@ sal_Bool SAL_CALL ScannerManager::configureScanner( ScannerContext& rContext )
return configureScannerAndScan( rContext, nullptr );
}
+void SAL_CALL ScannerManager::initialize(const css::uno::Sequence<css::uno::Any>& rArguments)
+{
+ ::comphelper::NamedValueCollection aProperties(rArguments);
+ if (aProperties.has("ParentWindow"))
+ aProperties.get("ParentWindow") >>= mxDialogParent;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/extensions/source/scanner/scanner.hxx b/extensions/source/scanner/scanner.hxx
index 9ae7821af3c0..854bb07e8db4 100644
--- a/extensions/source/scanner/scanner.hxx
+++ b/extensions/source/scanner/scanner.hxx
@@ -26,6 +26,8 @@
#include <com/sun/star/uno/Reference.h>
#include <com/sun/star/uno/Sequence.h>
#include <com/sun/star/awt/XBitmap.hpp>
+#include <com/sun/star/awt/XWindow.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
#include <com/sun/star/lang/XEventListener.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
@@ -39,9 +41,10 @@ using namespace com::sun::star::scanner;
class ScannerManager final :
public cppu::WeakImplHelper<
- XScannerManager2, css::awt::XBitmap, css::lang::XServiceInfo>
+ XScannerManager2, css::awt::XBitmap, css::lang::XServiceInfo, css::lang::XInitialization>
{
osl::Mutex maProtector;
+ css::uno::Reference<css::awt::XWindow> mxDialogParent;
void* mpData;
static void AcquireData();
@@ -71,6 +74,8 @@ public:
css::uno::Sequence<OUString> SAL_CALL getSupportedServiceNames() override;
+ virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
+
// Misc
static OUString getImplementationName_Static() throw();
static Sequence< OUString > getSupportedServiceNames_Static() throw();
diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx
index dd439dc3c9bf..a9ee05e5164e 100644
--- a/extensions/source/scanner/scanunx.cxx
+++ b/extensions/source/scanner/scanunx.cxx
@@ -23,9 +23,9 @@
#include <sal/log.hxx>
#include <tools/solar.h>
#include <cppuhelper/queryinterface.hxx>
+#include <vcl/svapp.hxx>
#include <memory>
-
BitmapTransporter::BitmapTransporter()
{
SAL_INFO("extensions.scanner", "BitmapTransporter");
@@ -264,7 +264,7 @@ sal_Bool ScannerManager::configureScannerAndScan( ScannerContext& scanner_contex
);
pHolder->m_bBusy = true;
- SaneDlg aDlg(nullptr, pHolder->m_aSane, listener.is());
+ SaneDlg aDlg(Application::GetFrameWeld(mxDialogParent), pHolder->m_aSane, listener.is());
bRet = aDlg.run();
bScan = aDlg.getDoScan();
pHolder->m_bBusy = false;