summaryrefslogtreecommitdiff
path: root/sfx2/source/doc/guisaveas.cxx
diff options
context:
space:
mode:
authorJustin Luth <justin_luth@sil.org>2017-01-20 15:59:25 +0300
committerJustin Luth <justin_luth@sil.org>2017-02-03 04:37:25 +0000
commiteb9f90186ae52efa7ff884b3e64f5dd59ddc0329 (patch)
treef2a2dd0110154217505595223e6b11dea3b19a09 /sfx2/source/doc/guisaveas.cxx
parentc0d3916cb7777918dbca359e88fb69f92ebf93ff (diff)
tdf#80807 guisaveas: never recommend system's tempdir
Various download-and-open mechanisms save to the system's $TEMP dir. If so, don't recomment saving in that same location in the GUI dialog! That's just silly. Change-Id: Ifa20fdfd81d768bbd893f92a50355f08c3aab356 Reviewed-on: https://gerrit.libreoffice.org/33353 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Justin Luth <justin_luth@sil.org>
Diffstat (limited to 'sfx2/source/doc/guisaveas.cxx')
-rw-r--r--sfx2/source/doc/guisaveas.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index e51b987ff49d..abce2e3f4cb9 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -1201,6 +1201,10 @@ OUString ModelData_Impl::GetRecommendedDir( const OUString& aSuggestedDir )
aLocation = INetURLObject( SvtPathOptions().GetWorkPath() );
}
+ // Suggest somewhere other than the system's temp directory
+ if( aLocation.GetMainURL( INetURLObject::DecodeMechanism::NONE ).startsWith( SvtPathOptions().GetTempPath() ) )
+ aLocation = INetURLObject( SvtPathOptions().GetWorkPath() );
+
aLocation.setFinalSlash();
if ( !aLocation.HasError() )
aRecommendedDir = aLocation.GetMainURL( INetURLObject::DecodeMechanism::NONE );