summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-02-02 17:30:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-02-02 22:57:31 +0100
commit573a473275ad7c76d0cada9b7e73d4923e7a79d5 (patch)
treec298dd2de8019accefbae94794aae1821bf46e4c /sc
parent70459f7bb7f7a214991e56e7ae6c83cbacf5a643 (diff)
set parent for ascii import options dialog in calc
Change-Id: I039ac4bfda4b36f76b66f043187beada4af0cacd Reviewed-on: https://gerrit.libreoffice.org/67294 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/inc/filtuno.hxx6
-rw-r--r--sc/source/ui/unoobj/filtuno.cxx12
2 files changed, 17 insertions, 1 deletions
diff --git a/sc/inc/filtuno.hxx b/sc/inc/filtuno.hxx
index dd6b55950d09..fc3d3981b126 100644
--- a/sc/inc/filtuno.hxx
+++ b/sc/inc/filtuno.hxx
@@ -24,6 +24,7 @@
#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
#include <com/sun/star/document/XImporter.hpp>
#include <com/sun/star/document/XExporter.hpp>
+#include <com/sun/star/lang/XInitialization.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <cppuhelper/implbase.hxx>
@@ -36,6 +37,7 @@ class ScFilterOptionsObj : public ::cppu::WeakImplHelper<
css::ui::dialogs::XExecutableDialog,
css::document::XImporter,
css::document::XExporter,
+ css::lang::XInitialization,
css::lang::XServiceInfo >
{
private:
@@ -43,6 +45,7 @@ private:
OUString aFilterName;
OUString aFilterOptions;
css::uno::Reference< css::io::XInputStream > xInputStream;
+ css::uno::Reference< css::awt::XWindow > xDialogParent;
bool bExport;
public:
@@ -65,6 +68,9 @@ public:
// XExporter
virtual void SAL_CALL setSourceDocument( const css::uno::Reference< css::lang::XComponent >& xDoc ) override;
+ // XInitialization
+ virtual void SAL_CALL initialize(const css::uno::Sequence<css::uno::Any>& rArguments) override;
+
// XServiceInfo
virtual OUString SAL_CALL getImplementationName() override;
virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
diff --git a/sc/source/ui/unoobj/filtuno.cxx b/sc/source/ui/unoobj/filtuno.cxx
index 73f319263992..947f59869903 100644
--- a/sc/source/ui/unoobj/filtuno.cxx
+++ b/sc/source/ui/unoobj/filtuno.cxx
@@ -40,6 +40,7 @@
#include <optutil.hxx>
#include <com/sun/star/uno/Any.hxx>
#include <com/sun/star/uno/Sequence.hxx>
+#include <comphelper/namedvaluecollection.hxx>
#include <comphelper/propertysequence.hxx>
#include <memory>
@@ -208,7 +209,7 @@ sal_Int16 SAL_CALL ScFilterOptionsObj::execute()
{
// HTML import.
ScopedVclPtr<AbstractScTextImportOptionsDlg> pDlg(
- pFact->CreateScTextImportOptionsDlg(nullptr));
+ pFact->CreateScTextImportOptionsDlg(Application::GetFrameWeld(xDialogParent)));
if (pDlg->Execute() == RET_OK)
{
@@ -354,4 +355,13 @@ void SAL_CALL ScFilterOptionsObj::setSourceDocument( const uno::Reference<lang::
bExport = true;
}
+// XInitialization
+
+void SAL_CALL ScFilterOptionsObj::initialize(const uno::Sequence<uno::Any>& rArguments)
+{
+ ::comphelper::NamedValueCollection aProperties(rArguments);
+ if (aProperties.has("ParentWindow"))
+ aProperties.get("ParentWindow") >>= xDialogParent;
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */