summaryrefslogtreecommitdiff
path: root/sd
diff options
context:
space:
mode:
Diffstat (limited to 'sd')
-rw-r--r--sd/source/ui/dlg/PhotoAlbumDialog.cxx30
-rw-r--r--sd/source/ui/dlg/filedlg.cxx11
-rw-r--r--sd/source/ui/dlg/tpaction.cxx6
-rw-r--r--sd/source/ui/func/fuinsfil.cxx1
4 files changed, 8 insertions, 40 deletions
diff --git a/sd/source/ui/dlg/PhotoAlbumDialog.cxx b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
index 14e43dd75229..9c00afe4cdc4 100644
--- a/sd/source/ui/dlg/PhotoAlbumDialog.cxx
+++ b/sd/source/ui/dlg/PhotoAlbumDialog.cxx
@@ -20,7 +20,6 @@
#include <unotools/pathoptions.hxx>
#include <unotools/ucbstreamhelper.hxx>
-#include <officecfg/Office/Impress.hxx>
#include <vcl/graphicfilter.hxx>
#include <vcl/svapp.hxx>
#include <vcl/weld.hxx>
@@ -500,35 +499,16 @@ IMPL_LINK_NOARG(SdPhotoAlbumDialog, FileHdl, weld::Button&, void)
::sfx2::FileDialogHelper aDlg(
css::ui::dialogs::TemplateDescription::FILEOPEN_PREVIEW,
FileDialogFlags::Graphic | FileDialogFlags::MultiSelection, m_xDialog.get());
- // Read configuration
- OUString sUrl(officecfg::Office::Impress::Pictures::Path::get());
-
- INetURLObject aFile( SvtPathOptions().GetUserConfigPath() );
- if (!sUrl.isEmpty())
- aDlg.SetDisplayDirectory(sUrl);
- else
- aDlg.SetDisplayDirectory( aFile.GetMainURL( INetURLObject::DecodeMechanism::NONE ) );
+ aDlg.SetContext(sfx2::FileDialogHelper::ImpressPhotoDialog);
if ( aDlg.Execute() == ERRCODE_NONE )
{
const Sequence< OUString > aFilesArr = aDlg.GetSelectedFiles();
- if( aFilesArr.hasElements() )
+ for ( const auto& rFile : aFilesArr )
{
- sUrl = aDlg.GetDisplayDirectory();
- // Write out configuration
- {
- std::shared_ptr< comphelper::ConfigurationChanges > batch(
- comphelper::ConfigurationChanges::create());
- officecfg::Office::Impress::Pictures::Path::set(sUrl, batch);
- batch->commit();
- }
-
- for ( const auto& rFile : aFilesArr )
- {
- // Store full path, show filename only. Use INetURLObject to display spaces in filename correctly
- INetURLObject aUrl(rFile);
- m_xImagesLst->append(aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE), aUrl.GetLastName(INetURLObject::DecodeMechanism::WithCharset), "");
- }
+ // Store full path, show filename only. Use INetURLObject to display spaces in filename correctly
+ INetURLObject aUrl(rFile);
+ m_xImagesLst->append(aUrl.GetMainURL(INetURLObject::DecodeMechanism::NONE), aUrl.GetLastName(INetURLObject::DecodeMechanism::WithCharset), "");
}
}
EnableDisableButtons();
diff --git a/sd/source/ui/dlg/filedlg.cxx b/sd/source/ui/dlg/filedlg.cxx
index 05c4243dc539..a545f6dc946f 100644
--- a/sd/source/ui/dlg/filedlg.cxx
+++ b/sd/source/ui/dlg/filedlg.cxx
@@ -34,7 +34,6 @@
#include <filedlg.hxx>
#include <sdresid.hxx>
#include <strings.hrc>
-#include <officecfg/Office/Impress.hxx>
// ----------- SdFileDialog_Imp ---------------------------
@@ -214,6 +213,7 @@ SdOpenSoundFileDialog::SdOpenSoundFileDialog(weld::Window *pParent)
{
OUString aDescr = SdResId(STR_ALL_FILES);
mpImpl->AddFilter( aDescr, "*.*");
+ mpImpl->SetContext(sfx2::FileDialogHelper::DrawImpressOpenSound);
// setup filter
#if defined UNX
@@ -233,9 +233,6 @@ SdOpenSoundFileDialog::SdOpenSoundFileDialog(weld::Window *pParent)
aDescr = SdResId(STR_MIDI_FILE);
mpImpl->AddFilter( aDescr, "*.mid" );
#endif
-
- // Restore last selected path
- mpImpl->SetDisplayDirectory(officecfg::Office::Impress::Sound::Path::get());
}
SdOpenSoundFileDialog::~SdOpenSoundFileDialog()
@@ -249,12 +246,6 @@ ErrCode SdOpenSoundFileDialog::Execute()
OUString SdOpenSoundFileDialog::GetPath() const
{
- // Save last selected path
- std::shared_ptr<comphelper::ConfigurationChanges> batch(
- comphelper::ConfigurationChanges::create());
- officecfg::Office::Impress::Sound::Path::set(mpImpl->GetPath(), batch);
- batch->commit();
-
return mpImpl->GetPath();
}
diff --git a/sd/source/ui/dlg/tpaction.cxx b/sd/source/ui/dlg/tpaction.cxx
index 63fd24cb91aa..4cd0cf68af9d 100644
--- a/sd/source/ui/dlg/tpaction.cxx
+++ b/sd/source/ui/dlg/tpaction.cxx
@@ -401,11 +401,7 @@ void SdTPAction::OpenFileDialog()
sfx2::FileDialogHelper aFileDialog(
ui::dialogs::TemplateDescription::FILEOPEN_READONLY_VERSION,
FileDialogFlags::NONE, GetFrameWeld());
-
- if (bDocument && aFile.isEmpty())
- aFile = SvtPathOptions().GetWorkPath();
-
- aFileDialog.SetDisplayDirectory( aFile );
+ aFileDialog.SetContext(sfx2::FileDialogHelper::ImpressClickAction);
// The following is a workaround for #i4306#:
// The addition of the implicitly existing "all files"
diff --git a/sd/source/ui/func/fuinsfil.cxx b/sd/source/ui/func/fuinsfil.cxx
index ff890dfb5ec7..aec950b0c779 100644
--- a/sd/source/ui/func/fuinsfil.cxx
+++ b/sd/source/ui/func/fuinsfil.cxx
@@ -133,6 +133,7 @@ void FuInsertFile::DoExecute( SfxRequest& rReq )
sfx2::FileDialogHelper aFileDialog(
ui::dialogs::TemplateDescription::FILEOPEN_SIMPLE,
FileDialogFlags::Insert, mpWindow ? mpWindow->GetFrameWeld() : nullptr);
+ aFileDialog.SetContext(sfx2::FileDialogHelper::DrawImpressInsertFile);
Reference< XFilePicker > xFilePicker( aFileDialog.GetFilePicker() );
Reference< XFilterManager > xFilterManager( xFilePicker, UNO_QUERY );
OUString aOwnCont;