diff options
author | Caolán McNamara <caolanm@redhat.com> | 2017-09-07 10:54:22 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2017-09-08 11:27:18 +0200 |
commit | 1af5f6e8d1bdec9bd2f14d0f5f8fad9c0fdead2b (patch) | |
tree | 84773114c08ca86424af4f8a17ec69d295908e01 /sfx2 | |
parent | bb2258f7e4bcf078810cf1e40fdec2f17576c3b2 (diff) |
set parent for file dialog helper
Change-Id: I3994ee48dcb5b2732cb27cb9ccb54926abf0828a
Reviewed-on: https://gerrit.libreoffice.org/42048
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')
-rw-r--r-- | sfx2/source/appl/fileobj.cxx | 4 | ||||
-rw-r--r-- | sfx2/source/appl/lnkbase2.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/appl/opengrf.cxx | 14 | ||||
-rw-r--r-- | sfx2/source/appl/shutdownicon.cxx | 2 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlghelper.cxx | 5 | ||||
-rw-r--r-- | sfx2/source/dialog/filedlgimpl.hxx | 4 | ||||
-rw-r--r-- | sfx2/source/doc/docinsert.cxx | 9 | ||||
-rw-r--r-- | sfx2/source/doc/templatedlg.cxx | 2 |
8 files changed, 19 insertions, 23 deletions
diff --git a/sfx2/source/appl/fileobj.cxx b/sfx2/source/appl/fileobj.cxx index 8ad8fba7c44c..fa7e8e03acac 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(vcl::Window* pParent, sfx2::SvBaseLink* pLink, const Link<const OUString&, void>& rEndEditHdl) { aEndEditLink = rEndEditHdl; OUString sFile, sRange, sTmpFilter; @@ -403,7 +403,7 @@ void SvFileObject::Edit( vcl::Window* /*pParent*/, sfx2::SvBaseLink* pLink, cons { nType = FILETYPE_GRF; // If not set already - SvxOpenGraphicDialog aDlg(SfxResId(RID_SVXSTR_EDITGRFLINK)); + SvxOpenGraphicDialog aDlg(SfxResId(RID_SVXSTR_EDITGRFLINK), pParent); aDlg.EnableLink(false); aDlg.SetPath( sFile, true ); aDlg.SetCurrentFilter( sTmpFilter ); diff --git a/sfx2/source/appl/lnkbase2.cxx b/sfx2/source/appl/lnkbase2.cxx index 1634ddd835b9..9b9def09f213 100644 --- a/sfx2/source/appl/lnkbase2.cxx +++ b/sfx2/source/appl/lnkbase2.cxx @@ -536,7 +536,7 @@ FileDialogHelper & SvBaseLink::GetInsertFileDialog(const OUString& rFactory) con { pImpl->m_pFileDlg.reset( new FileDialogHelper( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - FileDialogFlags::Insert, rFactory) ); + FileDialogFlags::Insert, rFactory, SfxFilterFlags::NONE, SfxFilterFlags::NONE, pImpl->m_pParentWin) ); return *pImpl->m_pFileDlg; } diff --git a/sfx2/source/appl/opengrf.cxx b/sfx2/source/appl/opengrf.cxx index 56ff31c2a357..16e0b0de5008 100644 --- a/sfx2/source/appl/opengrf.cxx +++ b/sfx2/source/appl/opengrf.cxx @@ -54,7 +54,6 @@ using namespace ::com::sun::star::ui::dialogs; using namespace ::com::sun::star::uno; using namespace ::cppu; - const char* SvxOpenGrfErr2ResId( ErrCode err ) { if (err == ERRCODE_GRFILTER_OPENERROR) @@ -69,37 +68,34 @@ const char* SvxOpenGrfErr2ResId( ErrCode err ) return RID_SVXSTR_GRFILTER_FORMATERROR; } - struct SvxOpenGrf_Impl { - SvxOpenGrf_Impl (); + SvxOpenGrf_Impl(const vcl::Window* pPreferredParent); sfx2::FileDialogHelper aFileDlg; uno::Reference < XFilePickerControlAccess > xCtrlAcc; }; -SvxOpenGrf_Impl::SvxOpenGrf_Impl() +SvxOpenGrf_Impl::SvxOpenGrf_Impl(const vcl::Window* pPreferredParent) : aFileDlg(ui::dialogs::TemplateDescription::FILEOPEN_LINK_PREVIEW, - FileDialogFlags::Graphic) + FileDialogFlags::Graphic, pPreferredParent) { uno::Reference < XFilePicker3 > xFP = aFileDlg.GetFilePicker(); xCtrlAcc.set(xFP, UNO_QUERY); } -SvxOpenGraphicDialog::SvxOpenGraphicDialog( const OUString& rTitle ) : - mpImpl( new SvxOpenGrf_Impl ) +SvxOpenGraphicDialog::SvxOpenGraphicDialog(const OUString& rTitle, const vcl::Window* pPreferredParent) + : mpImpl(new SvxOpenGrf_Impl(pPreferredParent)) { mpImpl->aFileDlg.SetTitle(rTitle); } - SvxOpenGraphicDialog::~SvxOpenGraphicDialog() { } - ErrCode SvxOpenGraphicDialog::Execute() { ErrCode nImpRet; diff --git a/sfx2/source/appl/shutdownicon.cxx b/sfx2/source/appl/shutdownicon.cxx index 4a0582d03d2e..9bc7812cc35a 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() ); + 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 a4e05ce41483..45d840854e79 100644 --- a/sfx2/source/dialog/filedlghelper.cxx +++ b/sfx2/source/dialog/filedlghelper.cxx @@ -2247,9 +2247,10 @@ FileDialogHelper::FileDialogHelper( FileDialogFlags nFlags, const OUString& rFact, SfxFilterFlags nMust, - SfxFilterFlags nDont ) + SfxFilterFlags nDont, + const vcl::Window* _pPreferredParent) : m_nError(0), - mpImpl( new FileDialogHelper_Impl( this, nDialogType, nFlags ) ) + mpImpl(new FileDialogHelper_Impl(this, nDialogType, nFlags, SFX2_IMPL_DIALOG_CONFIG, _pPreferredParent)) { // create the list of filters diff --git a/sfx2/source/dialog/filedlgimpl.hxx b/sfx2/source/dialog/filedlgimpl.hxx index a251f8558e09..b7aae374dfcd 100644 --- a/sfx2/source/dialog/filedlgimpl.hxx +++ b/sfx2/source/dialog/filedlgimpl.hxx @@ -170,8 +170,8 @@ namespace sfx2 FileDialogHelper* _pAntiImpl, const short nDialogType, FileDialogFlags nFlags, - sal_Int16 nDialog = SFX2_IMPL_DIALOG_CONFIG, - const vcl::Window* _pPreferredParentWindow = nullptr, + sal_Int16 nDialog, + const vcl::Window* _pPreferredParentWindow, const OUString& sStandardDir = OUString(), const css::uno::Sequence< OUString >& rBlackList = css::uno::Sequence< OUString >() ); diff --git a/sfx2/source/doc/docinsert.cxx b/sfx2/source/doc/docinsert.cxx index e6b2504bfae3..4be520f4d1fc 100644 --- a/sfx2/source/doc/docinsert.cxx +++ b/sfx2/source/doc/docinsert.cxx @@ -74,10 +74,9 @@ FileDialogFlags lcl_map_mode_to_flags(const sfx2::DocumentInserter::Mode mode) namespace sfx2 { -DocumentInserter::DocumentInserter( - const OUString& rFactory, const Mode mode) : - - m_sDocFactory ( rFactory ) +DocumentInserter::DocumentInserter(vcl::Window* pParent, const OUString& rFactory, const Mode mode) + : m_xParent ( pParent ) + , m_sDocFactory ( rFactory ) , m_nDlgFlags ( lcl_map_mode_to_flags(mode) ) , m_nError ( ERRCODE_NONE ) , m_pFileDlg ( nullptr ) @@ -97,7 +96,7 @@ void DocumentInserter::StartExecuteModal( const Link<sfx2::FileDialogHelper*,voi { m_pFileDlg.reset( new FileDialogHelper( ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - m_nDlgFlags, m_sDocFactory ) ); + m_nDlgFlags, m_sDocFactory, SfxFilterFlags::NONE, SfxFilterFlags::NONE, m_xParent ) ); } m_pFileDlg->StartExecuteModal( LINK( this, DocumentInserter, DialogClosedHdl ) ); } diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx index f951f000dcf6..fbaaa1b70aa0 100644 --- a/sfx2/source/doc/templatedlg.cxx +++ b/sfx2/source/doc/templatedlg.cxx @@ -887,7 +887,7 @@ void SfxTemplateManagerDlg::OnTemplateState (const ThumbnailViewItem *pItem) void SfxTemplateManagerDlg::OnTemplateImportCategory(const OUString& sCategory) { sfx2::FileDialogHelper aFileDlg(css::ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, - FileDialogFlags::MultiSelection); + FileDialogFlags::MultiSelection, this); // add "All" filter aFileDlg.AddFilter( SfxResId(STR_SFX_FILTERNAME_ALL), |