svx/source/core/graphichelper.cxx | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-)
New commits: commit 6f926a4787f5e8f76e9efd3a564211eb65655ab2 Author: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> AuthorDate: Tue Jul 13 09:21:57 2021 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Wed Jul 14 08:31:44 2021 +0200 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.mehrbr...@allotropia.de> 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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits