summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-07-13 09:21:57 +0200
committerSamuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>2021-07-14 08:31:44 +0200
commit6f926a4787f5e8f76e9efd3a564211eb65655ab2 (patch)
tree9510cb8e1f7902218cb601f9f221d4c13bf6bab3 /svx
parentcfb25346ffe0ec8a65b4db2630ea615077fba277 (diff)
tdf#58114 Remember last selected folder when saving image in Impress
Change-Id: Ic095f461d794091716e7defcfd9850dd21493ba3 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/118816 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/core/graphichelper.cxx20
1 files changed, 1 insertions, 19 deletions
diff --git a/svx/source/core/graphichelper.cxx b/svx/source/core/graphichelper.cxx
index de29e0bbbffc..f67429be20b5 100644
--- a/svx/source/core/graphichelper.cxx
+++ b/svx/source/core/graphichelper.cxx
@@ -217,19 +217,12 @@ bool lcl_ExecuteFilterDialog( const Sequence< PropertyValue >& rPropsForDialog,
OUString GraphicHelper::ExportGraphic(weld::Window* pParent, const Graphic& rGraphic, const OUString& rGraphicName)
{
- SvtPathOptions aPathOpt;
- OUString sGraphicsPath( aPathOpt.GetGraphicPath() );
-
FileDialogHelper aDialogHelper(TemplateDescription::FILESAVE_AUTOEXTENSION, FileDialogFlags::NONE, pParent);
Reference < XFilePicker3 > xFilePicker = aDialogHelper.GetFilePicker();
- INetURLObject aPath;
- aPath.SetSmartURL( sGraphicsPath );
-
// fish out the graphic's name
aDialogHelper.SetContext(FileDialogHelper::ExportImage);
aDialogHelper.SetTitle( SvxResId(RID_SVXSTR_EXPORT_GRAPHIC_TITLE));
- aDialogHelper.SetDisplayDirectory( aPath.GetMainURL(INetURLObject::DecodeMechanism::ToIUri) );
INetURLObject aURL;
aURL.SetSmartURL( rGraphicName );
aDialogHelper.SetFileName(aURL.GetLastName());
@@ -274,10 +267,6 @@ OUString GraphicHelper::ExportGraphic(weld::Window* pParent, const Graphic& rGra
if( aDialogHelper.Execute() == ERRCODE_NONE )
{
OUString sPath( xFilePicker->getFiles().getConstArray()[0] );
- // remember used path - please don't optimize away!
- aPath.SetSmartURL( sPath);
- sGraphicsPath = aPath.GetPath();
-
if( !rGraphicName.isEmpty() &&
nDefaultFilter == rGraphicFilter.GetExportFormatNumber( xFilePicker->getCurrentFilter()))
{
@@ -383,18 +372,11 @@ void GraphicHelper::SaveShapeAsGraphic(weld::Window* pParent, const Reference<
Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
Reference< XPropertySet > xShapeSet( xShape, UNO_QUERY_THROW );
- SvtPathOptions aPathOpt;
- const OUString& sGraphicPath( aPathOpt.GetGraphicPath() );
-
FileDialogHelper aDialogHelper(TemplateDescription::FILESAVE_AUTOEXTENSION, FileDialogFlags::NONE, pParent);
Reference < XFilePicker3 > xFilePicker = aDialogHelper.GetFilePicker();
-
+ aDialogHelper.SetContext(FileDialogHelper::ExportImage);
aDialogHelper.SetTitle( SvxResId(RID_SVXSTR_SAVEAS_IMAGE) );
- INetURLObject aPath;
- aPath.SetSmartURL( sGraphicPath );
- xFilePicker->setDisplayDirectory( aPath.GetMainURL(INetURLObject::DecodeMechanism::ToIUri) );
-
// populate filter dialog filter list and select default filter to match graphic mime type
GraphicFilter& rGraphicFilter = GraphicFilter::GetGraphicFilter();