summaryrefslogtreecommitdiff
path: root/sfx2/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-04-04 14:33:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-04-06 16:48:12 +0200
commit8ed2fb306ffa8c7fef336b858fc5074c309c3c9f (patch)
tree8699322ccfd3bfef66af56437bb9dabfa249a719 /sfx2/source
parent79ae6cc6b3b19252473f6987106ea7d8aa17a5ea (diff)
weld linkeditdialog
which enables changing FileDialogHelper over to welded Change-Id: I988342a6574cb7ed09b2724929e8c7117474a56c Reviewed-on: https://gerrit.libreoffice.org/52388 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2/source')
-rw-r--r--sfx2/source/appl/appopen.cxx4
-rw-r--r--sfx2/source/appl/fileobj.cxx2
-rw-r--r--sfx2/source/appl/fileobj.hxx2
-rw-r--r--sfx2/source/appl/impldde.cxx82
-rw-r--r--sfx2/source/appl/impldde.hxx2
-rw-r--r--sfx2/source/appl/linksrc.cxx2
-rw-r--r--sfx2/source/appl/lnkbase2.cxx6
-rw-r--r--sfx2/source/appl/opengrf.cxx8
-rw-r--r--sfx2/source/appl/shutdownicon.cxx2
-rw-r--r--sfx2/source/dialog/filedlghelper.cxx45
-rw-r--r--sfx2/source/dialog/filedlgimpl.hxx12
-rw-r--r--sfx2/source/doc/docinsert.cxx8
-rw-r--r--sfx2/source/doc/guisaveas.cxx9
-rw-r--r--sfx2/source/doc/templatedlg.cxx2
14 files changed, 64 insertions, 122 deletions
diff --git a/sfx2/source/appl/appopen.cxx b/sfx2/source/appl/appopen.cxx
index e1cf3a6944a3..24bfc02def63 100644
--- a/sfx2/source/appl/appopen.cxx
+++ b/sfx2/source/appl/appopen.cxx
@@ -648,8 +648,8 @@ void SfxApplication::OpenDocExec_Impl( SfxRequest& rReq )
if ( pBlackListItem )
pBlackListItem->GetStringList( aBlackList );
-
- ErrCode nErr = sfx2::FileOpenDialog_Impl(GetTopWindow(),
+ vcl::Window* pTopWindow = GetTopWindow();
+ ErrCode nErr = sfx2::FileOpenDialog_Impl(pTopWindow ? pTopWindow->GetFrameWeld() : nullptr,
nDialogType,
eDialogFlags, aURLList,
aFilter, pSet, &aPath, nDialog, sStandardDir, aBlackList);
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx
index ebe5b37de43c..5918ba7a6c09 100644
--- a/sfx2/source/appl/fileobj.cxx
+++ b/sfx2/source/appl/fileobj.cxx
@@ -389,7 +389,7 @@ OUString impl_getFilter( const OUString& _rURL )
return sFilter;
}
-void SvFileObject::Edit(vcl::Window* pParent, sfx2::SvBaseLink* pLink, const Link<const OUString&, void>& rEndEditHdl)
+void SvFileObject::Edit(weld::Window* pParent, sfx2::SvBaseLink* pLink, const Link<const OUString&, void>& rEndEditHdl)
{
aEndEditLink = rEndEditHdl;
OUString sFile, sRange, sTmpFilter;
diff --git a/sfx2/source/appl/fileobj.hxx b/sfx2/source/appl/fileobj.hxx
index 1b735e0c4414..f55e7885713d 100644
--- a/sfx2/source/appl/fileobj.hxx
+++ b/sfx2/source/appl/fileobj.hxx
@@ -68,7 +68,7 @@ public:
bool bSynchron = false ) override;
virtual bool Connect( sfx2::SvBaseLink* ) override;
- virtual void Edit( vcl::Window *, sfx2::SvBaseLink *, const Link<const OUString&, void>& rEndEditHdl ) override;
+ virtual void Edit(weld::Window *, sfx2::SvBaseLink *, const Link<const OUString&, void>& rEndEditHdl) override;
// Ask whether you can access data directly or whether it has to be triggered
virtual bool IsPending() const override;
diff --git a/sfx2/source/appl/impldde.cxx b/sfx2/source/appl/impldde.cxx
index 280cd6da21c1..9280b36381c8 100644
--- a/sfx2/source/appl/impldde.cxx
+++ b/sfx2/source/appl/impldde.cxx
@@ -27,10 +27,7 @@
#include <comphelper/string.hxx>
#include <vcl/svapp.hxx>
-#include <vcl/fixed.hxx>
-#include <vcl/edit.hxx>
-#include <vcl/button.hxx>
-#include <vcl/dialog.hxx>
+#include <vcl/weld.hxx>
#include <sot/exchange.hxx>
#include <rtl/strbuf.hxx>
#include <rtl/ustring.hxx>
@@ -52,69 +49,52 @@ using namespace ::com::sun::star::uno;
namespace sfx2
{
-class SvDDELinkEditDialog : public ModalDialog
+class SvDDELinkEditDialog : public weld::GenericDialogController
{
- VclPtr<Edit> m_pEdDdeApp;
- VclPtr<Edit> m_pEdDdeTopic;
- VclPtr<Edit> m_pEdDdeItem;
- VclPtr<OKButton> m_pOKButton;
+ std::unique_ptr<weld::Entry> m_xEdDdeApp;
+ std::unique_ptr<weld::Entry> m_xEdDdeTopic;
+ std::unique_ptr<weld::Entry> m_xEdDdeItem;
+ std::unique_ptr<weld::Button> m_xOKButton;
- DECL_LINK( EditHdl_Impl, Edit&, void );
+ DECL_LINK(EditHdl_Impl, weld::Entry&, void);
public:
- SvDDELinkEditDialog( vcl::Window* pParent, SvBaseLink const * );
- virtual ~SvDDELinkEditDialog() override;
- virtual void dispose() override;
+ SvDDELinkEditDialog(weld::Window* pParent, SvBaseLink const*);
OUString GetCmd() const;
};
-SvDDELinkEditDialog::SvDDELinkEditDialog( vcl::Window* pParent, SvBaseLink const * pLink )
- : ModalDialog( pParent, "LinkEditDialog", "sfx/ui/linkeditdialog.ui" )
+SvDDELinkEditDialog::SvDDELinkEditDialog(weld::Window* pParent, SvBaseLink const * pLink)
+ : GenericDialogController(pParent, "sfx/ui/linkeditdialog.ui", "LinkEditDialog")
+ , m_xEdDdeApp(m_xBuilder->weld_entry("app"))
+ , m_xEdDdeTopic(m_xBuilder->weld_entry("file"))
+ , m_xEdDdeItem(m_xBuilder->weld_entry("category"))
+ , m_xOKButton(m_xBuilder->weld_button("ok"))
{
- get(m_pOKButton, "ok");
- get(m_pEdDdeApp, "app");
- get(m_pEdDdeTopic, "file");
- get(m_pEdDdeItem, "category");
-
OUString sServer, sTopic, sItem;
sfx2::LinkManager::GetDisplayNames( pLink, &sServer, &sTopic, &sItem );
- m_pEdDdeApp->SetText( sServer );
- m_pEdDdeTopic->SetText( sTopic );
- m_pEdDdeItem->SetText( sItem );
-
- m_pEdDdeApp->SetModifyHdl( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
- m_pEdDdeTopic->SetModifyHdl( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
- m_pEdDdeItem->SetModifyHdl( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
+ m_xEdDdeApp->set_text( sServer );
+ m_xEdDdeTopic->set_text( sTopic );
+ m_xEdDdeItem->set_text( sItem );
- m_pOKButton->Enable( !sServer.isEmpty() && !sTopic.isEmpty() && !sItem.isEmpty() );
-}
+ m_xEdDdeApp->connect_changed( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
+ m_xEdDdeTopic->connect_changed( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
+ m_xEdDdeItem->connect_changed( LINK( this, SvDDELinkEditDialog, EditHdl_Impl));
-SvDDELinkEditDialog::~SvDDELinkEditDialog()
-{
- disposeOnce();
-}
-
-void SvDDELinkEditDialog::dispose()
-{
- m_pEdDdeApp.clear();
- m_pEdDdeTopic.clear();
- m_pEdDdeItem.clear();
- m_pOKButton.clear();
- ModalDialog::dispose();
+ m_xOKButton->set_sensitive(!sServer.isEmpty() && !sTopic.isEmpty() && !sItem.isEmpty());
}
OUString SvDDELinkEditDialog::GetCmd() const
{
- OUString sCmd( m_pEdDdeApp->GetText() ), sRet;
- ::sfx2::MakeLnkName( sRet, &sCmd, m_pEdDdeTopic->GetText(), m_pEdDdeItem->GetText() );
+ OUString sCmd( m_xEdDdeApp->get_text() ), sRet;
+ ::sfx2::MakeLnkName( sRet, &sCmd, m_xEdDdeTopic->get_text(), m_xEdDdeItem->get_text() );
return sRet;
}
-IMPL_LINK_NOARG( SvDDELinkEditDialog, EditHdl_Impl, Edit&, void)
+IMPL_LINK_NOARG( SvDDELinkEditDialog, EditHdl_Impl, weld::Entry&, void)
{
- m_pOKButton->Enable( !m_pEdDdeApp->GetText().isEmpty() &&
- !m_pEdDdeTopic->GetText().isEmpty() &&
- !m_pEdDdeItem->GetText().isEmpty() );
+ m_xOKButton->set_sensitive(!m_xEdDdeApp->get_text().isEmpty() &&
+ !m_xEdDdeTopic->get_text().isEmpty() &&
+ !m_xEdDdeItem->get_text().isEmpty() );
}
SvDDEObject::SvDDEObject()
@@ -251,12 +231,12 @@ bool SvDDEObject::Connect( SvBaseLink * pSvLink )
return true;
}
-void SvDDEObject::Edit( vcl::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link<const OUString&, void>& rEndEditHdl )
+void SvDDEObject::Edit(weld::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link<const OUString&, void>& rEndEditHdl)
{
- ScopedVclPtrInstance< SvDDELinkEditDialog > aDlg(pParent, pBaseLink);
- if ( RET_OK == aDlg->Execute() && rEndEditHdl.IsSet() )
+ SvDDELinkEditDialog aDlg(pParent, pBaseLink);
+ if (RET_OK == aDlg.run() && rEndEditHdl.IsSet())
{
- OUString sCommand = aDlg->GetCmd();
+ OUString sCommand = aDlg.GetCmd();
rEndEditHdl.Call( sCommand );
}
}
diff --git a/sfx2/source/appl/impldde.hxx b/sfx2/source/appl/impldde.hxx
index d161a783fa61..68bb0cd113d2 100644
--- a/sfx2/source/appl/impldde.hxx
+++ b/sfx2/source/appl/impldde.hxx
@@ -58,7 +58,7 @@ public:
bool bSynchron = false ) override;
virtual bool Connect( SvBaseLink * ) override;
- virtual void Edit( vcl::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link<const OUString&, void>& rEndEditHdl ) override;
+ virtual void Edit(weld::Window* pParent, sfx2::SvBaseLink* pBaseLink, const Link<const OUString&, void>& rEndEditHdl) override;
virtual bool IsPending() const override;
virtual bool IsDataComplete() const override;
diff --git a/sfx2/source/appl/linksrc.cxx b/sfx2/source/appl/linksrc.cxx
index ca97b745a814..6d172d202f79 100644
--- a/sfx2/source/appl/linksrc.cxx
+++ b/sfx2/source/appl/linksrc.cxx
@@ -404,7 +404,7 @@ bool SvLinkSource::GetData( css::uno::Any &, const OUString &, bool )
return false;
}
-void SvLinkSource::Edit( vcl::Window *, SvBaseLink *, const Link<const OUString&, void>& )
+void SvLinkSource::Edit(weld::Window *, SvBaseLink *, const Link<const OUString&, void>&)
{
}
diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx
index 82c6129b11bf..1c5b6154db73 100644
--- a/sfx2/source/appl/lnkbase2.cxx
+++ b/sfx2/source/appl/lnkbase2.cxx
@@ -47,7 +47,7 @@ struct BaseLink_Impl
{
Link<SvBaseLink&,void> m_aEndEditLink;
LinkManager* m_pLinkMgr;
- VclPtr<vcl::Window> m_pParentWin;
+ weld::Window* m_pParentWin;
std::unique_ptr<FileDialogHelper>
m_pFileDlg;
bool m_bIsConnect;
@@ -447,7 +447,7 @@ SvBaseLink::UpdateResult SvBaseLink::DataChanged( const OUString &, const css::u
return SUCCESS;
}
-void SvBaseLink::Edit( vcl::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl )
+void SvBaseLink::Edit(weld::Window* pParent, const Link<SvBaseLink&,void>& rEndEditHdl )
{
pImpl->m_pParentWin = pParent;
pImpl->m_aEndEditLink = rEndEditHdl;
@@ -516,7 +516,7 @@ bool SvBaseLink::ExecuteEdit( const OUString& _rNewName )
else
return false;
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pImpl->m_pParentWin->GetFrameWeld(),
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(pImpl->m_pParentWin,
VclMessageType::Warning, VclButtonsType::Ok, sError));
xBox->run();
}
diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx
index a43d8eb53100..d1775a8a5940 100644
--- a/sfx2/source/appl/opengrf.cxx
+++ b/sfx2/source/appl/opengrf.cxx
@@ -70,7 +70,7 @@ const char* SvxOpenGrfErr2ResId( ErrCode err )
struct SvxOpenGrf_Impl
{
- SvxOpenGrf_Impl(const vcl::Window* pPreferredParent,
+ SvxOpenGrf_Impl(weld::Window* pPreferredParent,
sal_Int16 nDialogType);
sfx2::FileDialogHelper aFileDlg;
@@ -79,7 +79,7 @@ struct SvxOpenGrf_Impl
};
-SvxOpenGrf_Impl::SvxOpenGrf_Impl(const vcl::Window* pPreferredParent,
+SvxOpenGrf_Impl::SvxOpenGrf_Impl(weld::Window* pPreferredParent,
sal_Int16 nDialogType)
: aFileDlg(nDialogType, FileDialogFlags::Graphic, pPreferredParent)
{
@@ -88,13 +88,13 @@ SvxOpenGrf_Impl::SvxOpenGrf_Impl(const vcl::Window* pPreferredParent,
}
-SvxOpenGraphicDialog::SvxOpenGraphicDialog(const OUString& rTitle, const vcl::Window* pPreferredParent)
+SvxOpenGraphicDialog::SvxOpenGraphicDialog(const OUString& rTitle, weld::Window* pPreferredParent)
: mpImpl(new SvxOpenGrf_Impl(pPreferredParent, ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW))
{
mpImpl->aFileDlg.SetTitle(rTitle);
}
-SvxOpenGraphicDialog::SvxOpenGraphicDialog(const OUString& rTitle, const vcl::Window* pPreferredParent,
+SvxOpenGraphicDialog::SvxOpenGraphicDialog(const OUString& rTitle, weld::Window* pPreferredParent,
sal_Int16 nDialogType)
: mpImpl(new SvxOpenGrf_Impl(pPreferredParent, nDialogType))
{
diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx
index 60b279fe2d0a..be129dabac5f 100644
--- a/sfx2/source/appl/shutdownicon.cxx
+++ b/sfx2/source/appl/shutdownicon.cxx
@@ -329,7 +329,7 @@ void ShutdownIcon::StartFileDialog()
if ( !m_pFileDlg )
m_pFileDlg = new FileDialogHelper(
ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
- FileDialogFlags::MultiSelection, OUString(), SfxFilterFlags::NONE, SfxFilterFlags::NONE, static_cast<const vcl::Window*>(nullptr) );
+ FileDialogFlags::MultiSelection, OUString(), SfxFilterFlags::NONE, SfxFilterFlags::NONE, nullptr );
m_pFileDlg->StartExecuteModal( LINK( this, ShutdownIcon, DialogClosedHdl_Impl ) );
}
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index c8f2ad762e85..5e4055195eb5 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -851,8 +851,6 @@ css::uno::Reference<css::awt::XWindow> FileDialogHelper_Impl::GetFrameInterface(
{
if (mpFrameWeld)
return mpFrameWeld->GetXWindow();
- if (mpPreferredParentWindow)
- return VCLUnoHelper::GetInterface(mpPreferredParentWindow);
return css::uno::Reference<css::awt::XWindow>();
}
@@ -861,7 +859,6 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
sal_Int16 nDialogType,
FileDialogFlags nFlags,
sal_Int16 nDialog,
- const vcl::Window* pPreferredParentWindow,
weld::Window* pFrameWeld,
const OUString& sStandardDir,
const css::uno::Sequence< OUString >& rBlackList
@@ -891,7 +888,6 @@ FileDialogHelper_Impl::FileDialogHelper_Impl(
// create the file open dialog
// the flags can be SFXWB_INSERT or SFXWB_MULTISELECTION
- mpPreferredParentWindow = pPreferredParentWindow ? pPreferredParentWindow->GetSystemWindow() : nullptr;
mpFrameWeld = pFrameWeld;
mpAntiImpl = _pAntiImpl;
mbHasAutoExt = false;
@@ -1550,7 +1546,7 @@ ErrCode FileDialogHelper_Impl::execute( std::vector<OUString>& rpURLList,
}
catch( const IllegalArgumentException& )
{
- std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
+ std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(mpFrameWeld,
VclMessageType::Warning, VclButtonsType::Ok,
SfxResId(RID_SVXSTR_GPG_ENCRYPT_FAILURE)));
xBox->run();
@@ -2284,25 +2280,9 @@ FileDialogHelper::FileDialogHelper(
const OUString& rFact,
SfxFilterFlags nMust,
SfxFilterFlags nDont,
- const vcl::Window* pPreferredParent)
- : m_nError(0),
- mpImpl(new FileDialogHelper_Impl(this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, pPreferredParent, nullptr))
-{
-
- // create the list of filters
- mpImpl->addFilters(
- SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont );
-}
-
-FileDialogHelper::FileDialogHelper(
- sal_Int16 nDialogType,
- FileDialogFlags nFlags,
- const OUString& rFact,
- SfxFilterFlags nMust,
- SfxFilterFlags nDont,
weld::Window* pPreferredParent)
: m_nError(0),
- mpImpl(new FileDialogHelper_Impl(this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, nullptr, pPreferredParent))
+ mpImpl(new FileDialogHelper_Impl(this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, pPreferredParent))
{
// create the list of filters
@@ -2319,27 +2299,18 @@ FileDialogHelper::FileDialogHelper(
SfxFilterFlags nDont,
const OUString& rStandardDir,
const css::uno::Sequence< OUString >& rBlackList,
- const vcl::Window* pPreferredParent)
+ weld::Window* pPreferredParent)
: m_nError(0),
- mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, nDialog, pPreferredParent, nullptr, rStandardDir, rBlackList ) )
+ mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, nDialog, pPreferredParent, rStandardDir, rBlackList ) )
{
// create the list of filters
mpImpl->addFilters(
SfxObjectShell::GetServiceNameFromFactory(rFact), nMust, nDont );
}
-FileDialogHelper::FileDialogHelper(
- sal_Int16 nDialogType,
- FileDialogFlags nFlags,
- const vcl::Window* pPreferredParent )
- : m_nError(0),
- mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, pPreferredParent, nullptr ) )
-{
-}
-
FileDialogHelper::FileDialogHelper(sal_Int16 nDialogType, FileDialogFlags nFlags, weld::Window* pPreferredParent)
: m_nError(0),
- mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, nullptr, pPreferredParent ) )
+ mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, pPreferredParent ) )
{
}
@@ -2350,9 +2321,9 @@ FileDialogHelper::FileDialogHelper(
const OUString& aExtName,
const OUString& rStandardDir,
const css::uno::Sequence< OUString >& rBlackList,
- const vcl::Window* pPreferredParent )
+ weld::Window* pPreferredParent )
: m_nError(0),
- mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, pPreferredParent, nullptr, rStandardDir, rBlackList ) )
+ mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, pPreferredParent, rStandardDir, rBlackList ) )
{
// the wildcard here is expected in form "*.extension"
OUString aWildcard;
@@ -2661,7 +2632,7 @@ void FileDialogHelper::DialogClosed( const DialogClosedEvent& _rEvent )
m_aDialogClosedLink.Call( this );
}
-ErrCode FileOpenDialog_Impl( const vcl::Window* pParent,
+ErrCode FileOpenDialog_Impl( weld::Window* pParent,
sal_Int16 nDialogType,
FileDialogFlags nFlags,
std::vector<OUString>& rpURLList,
diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx
index 0d7de0b2cf22..f2313ebff134 100644
--- a/sfx2/source/dialog/filedlgimpl.hxx
+++ b/sfx2/source/dialog/filedlgimpl.hxx
@@ -52,7 +52,6 @@ namespace sfx2
SfxFilterMatcher* mpMatcher;
std::unique_ptr<GraphicFilter> mpGraphicFilter;
FileDialogHelper* mpAntiImpl;
- VclPtr<vcl::Window> mpPreferredParentWindow;
weld::Window* mpFrameWeld;
::std::vector< OUString > mlLastURLs;
@@ -172,7 +171,7 @@ namespace sfx2
const short nDialogType,
FileDialogFlags nFlags,
sal_Int16 nDialog,
- const vcl::Window* _pPreferredParentWindow, weld::Window* pFrameWeld,
+ weld::Window* pFrameWeld,
const OUString& sStandardDir = OUString(),
const css::uno::Sequence< OUString >& rBlackList = css::uno::Sequence< OUString >()
);
@@ -211,15 +210,6 @@ namespace sfx2
bool isSystemFilePicker() const { return mbSystemPicker; }
bool isPasswordEnabled() const { return mbIsPwdEnabled; }
- weld::Window* GetFrameWeld()
- {
- if (mpFrameWeld)
- return mpFrameWeld;
- if (mpPreferredParentWindow)
- return mpPreferredParentWindow->GetFrameWeld();
- return nullptr;
- }
-
css::uno::Reference<css::awt::XWindow> GetFrameInterface();
};
diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx
index 33ff0c1a1099..ad262468313e 100644
--- a/sfx2/source/doc/docinsert.cxx
+++ b/sfx2/source/doc/docinsert.cxx
@@ -73,8 +73,8 @@ FileDialogFlags lcl_map_mode_to_flags(const sfx2::DocumentInserter::Mode mode)
namespace sfx2 {
-DocumentInserter::DocumentInserter(vcl::Window* pParent, const OUString& rFactory, const Mode mode)
- : m_xParent ( pParent )
+DocumentInserter::DocumentInserter(weld::Window* pParent, const OUString& rFactory, const Mode mode)
+ : m_pParent ( pParent )
, m_sDocFactory ( rFactory )
, m_nDlgFlags ( lcl_map_mode_to_flags(mode) )
, m_nError ( ERRCODE_NONE )
@@ -95,7 +95,7 @@ void DocumentInserter::StartExecuteModal( const Link<sfx2::FileDialogHelper*,voi
{
m_pFileDlg.reset( new FileDialogHelper(
ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- m_nDlgFlags, m_sDocFactory, SfxFilterFlags::NONE, SfxFilterFlags::NONE, m_xParent ) );
+ m_nDlgFlags, m_sDocFactory, SfxFilterFlags::NONE, SfxFilterFlags::NONE, m_pParent ) );
}
m_pFileDlg->StartExecuteModal( LINK( this, DocumentInserter, DialogClosedHdl ) );
}
@@ -215,7 +215,7 @@ IMPL_LINK_NOARG(DocumentInserter, DialogClosedHdl, sfx2::FileDialogHelper*, void
if ( ( aValue >>= bPassWord ) && bPassWord )
{
// ask for the password
- SfxPasswordDialog aPasswordDlg(m_xParent ? m_xParent->GetFrameWeld() : nullptr);
+ SfxPasswordDialog aPasswordDlg(m_pParent);
aPasswordDlg.ShowExtras( SfxShowExtras::CONFIRM );
short nRet = aPasswordDlg.execute();
if ( RET_OK == nRet )
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index cbdde2efbb52..428d9d35128f 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -867,6 +867,7 @@ bool ModelData_Impl::OutputFileDialog( sal_Int16 nStoreMode,
SfxFilterFlags nDont = getDontFlags( nStoreMode );
sfx2::FileDialogHelper::Context eCtxt = sfx2::FileDialogHelper::UNKNOWN_CONTEXT;
vcl::Window* pWin = SfxStoringHelper::GetModelWindow( m_xModel );
+ weld::Window* pFrameWin = pWin ? pWin->GetFrameWeld() : nullptr;
if ( ( nStoreMode & EXPORT_REQUESTED ) && !( nStoreMode & WIDEEXPORT_REQUESTED ) )
{
if ( ( nStoreMode & PDFEXPORT_REQUESTED ) && !aPreselectedFilterPropsHM.empty() )
@@ -874,20 +875,20 @@ bool ModelData_Impl::OutputFileDialog( sal_Int16 nStoreMode,
// this is a PDF export
// the filter options has been shown already
const OUString aFilterUIName = aPreselectedFilterPropsHM.getUnpackedValueOrDefault( "UIName", OUString() );
- pFileDlg.reset(new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aFilterUIName, "pdf", rStandardDir, rBlackList, pWin ));
+ pFileDlg.reset(new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aFilterUIName, "pdf", rStandardDir, rBlackList, pFrameWin ));
pFileDlg->SetCurrentFilter( aFilterUIName );
}
else if ((nStoreMode & EPUBEXPORT_REQUESTED) && !aPreselectedFilterPropsHM.empty())
{
// This is an EPUB export, the filter options has been shown already.
const OUString aFilterUIName = aPreselectedFilterPropsHM.getUnpackedValueOrDefault( "UIName", OUString() );
- pFileDlg.reset(new sfx2::FileDialogHelper(aDialogMode, aDialogFlags, aFilterUIName, "epub", rStandardDir, rBlackList, pWin));
+ pFileDlg.reset(new sfx2::FileDialogHelper(aDialogMode, aDialogFlags, aFilterUIName, "epub", rStandardDir, rBlackList, pFrameWin));
pFileDlg->SetCurrentFilter(aFilterUIName);
}
else
{
// This is the normal dialog
- pFileDlg.reset(new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir, rBlackList, pWin ));
+ pFileDlg.reset(new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog, nMust, nDont, rStandardDir, rBlackList, pFrameWin ));
}
if ( aDocServiceName == "com.sun.star.drawing.DrawingDocument" )
@@ -916,7 +917,7 @@ bool ModelData_Impl::OutputFileDialog( sal_Int16 nStoreMode,
{
// This is the normal dialog
pFileDlg.reset(new sfx2::FileDialogHelper( aDialogMode, aDialogFlags, aDocServiceName, nDialog,
- nMust, nDont, rStandardDir, rBlackList, pWin ));
+ nMust, nDont, rStandardDir, rBlackList, pFrameWin ));
pFileDlg->CreateMatcher( aDocServiceName );
}
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index b9c728e19475..03459cd9cfff 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -891,7 +891,7 @@ void SfxTemplateManagerDlg::OnTemplateState (const ThumbnailViewItem *pItem)
void SfxTemplateManagerDlg::OnTemplateImportCategory(const OUString& sCategory)
{
sfx2::FileDialogHelper aFileDlg(css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
- FileDialogFlags::MultiSelection, this);
+ FileDialogFlags::MultiSelection, GetFrameWeld());
// add "All" filter
aFileDlg.AddFilter( SfxResId(STR_SFX_FILTERNAME_ALL),