desktop/source/deployment/gui/dp_gui_dialog2.cxx | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
New commits: commit 83ce76aff65f03c2ba6fb02c5621ce5e1bd3d0d1 Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Mon May 19 10:27:18 2025 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Mon May 19 11:45:36 2025 +0200 Fix storing recent directory for Extension->Add dialog Need to use the filedialoghelper methods, otherwise the directory will not be stored properly. Change-Id: Ib5f380ccd46d8c6c1cfa007cfe745a0aad43963e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/185504 Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> Tested-by: Jenkins diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 1a91ea99278f..e2b547d382db 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -636,8 +636,7 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker() { sfx2::FileDialogHelper aDlgHelper(ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE, FileDialogFlags::NONE, m_xDialog.get()); aDlgHelper.SetContext(sfx2::FileDialogHelper::ExtensionManager); - const uno::Reference<ui::dialogs::XFilePicker3>& xFilePicker = aDlgHelper.GetFilePicker(); - xFilePicker->setTitle( m_sAddPackages ); + aDlgHelper.SetTitle( m_sAddPackages ); // collect and set filter list: typedef std::map< OUString, OUString > t_string2string; @@ -674,26 +673,26 @@ uno::Sequence< OUString > ExtMgrDialog::raiseAddPicker() }(); // All files at top: - xFilePicker->appendFilter( StrAllFiles, u"*.*"_ustr ); - xFilePicker->appendFilter( DpResId(RID_STR_ALL_SUPPORTED), supportedFilters.makeStringAndClear() ); + aDlgHelper.AddFilter( StrAllFiles, u"*.*"_ustr ); + aDlgHelper.AddFilter( DpResId(RID_STR_ALL_SUPPORTED), supportedFilters.makeStringAndClear() ); // then supported ones: for (auto const& elem : title2filter) { try { - xFilePicker->appendFilter( elem.first, elem.second ); + aDlgHelper.AddFilter( elem.first, elem.second ); } catch (const lang::IllegalArgumentException &) { TOOLS_WARN_EXCEPTION( "desktop", "" ); } } - xFilePicker->setCurrentFilter( DpResId(RID_STR_ALL_SUPPORTED) ); + aDlgHelper.SetCurrentFilter( DpResId(RID_STR_ALL_SUPPORTED) ); - if ( xFilePicker->execute() != ui::dialogs::ExecutableDialogResults::OK ) + if ( aDlgHelper.Execute() == ERRCODE_ABORT ) return uno::Sequence<OUString>(); // cancelled - uno::Sequence< OUString > files( xFilePicker->getSelectedFiles() ); + uno::Sequence< OUString > files( aDlgHelper.GetSelectedFiles() ); OSL_ASSERT( files.hasElements() ); return files; }