| Summary: | Files coming from Temporary Internet Files temp dir are offered to be saved back in that directory instead of default workdir | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Aron Budea <aron.budea> |
| Component: | framework | Assignee: | Mike Kaganski <mikekaganski> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | medium | ||
| Version: | Inherited From OOo | ||
| Hardware: | All | ||
| OS: | Windows (All) | ||
| See Also: |
https://bugs.documentfoundation.org/show_bug.cgi?id=80807 https://bugs.documentfoundation.org/show_bug.cgi?id=148996 https://bugs.documentfoundation.org/show_bug.cgi?id=155025 |
||
| Whiteboard: | target:6.0.0 | ||
| Crash report or crash signature: | Regression By: | ||
|
Description
Aron Budea
2017-07-28 04:11:58 UTC
A solution attempt could be having a dedicated function to check if a given location is inside of any system temporary directory (those that aren't the default temp dir have to be found out in system-specific ways). Then it also has to be investigated why LO doesn't already suggest My Documents if the file is in the currently identified temp dir. The plan is to update the followig piece of code (added for bug 80807): https://opengrok.libreoffice.org/xref/core/sfx2/source/doc/guisaveas.cxx#1151 // Suggest somewhere other than the system's temp directory if( aLocation.GetMainURL( INetURLObject::DecodeMechanism::NONE ).startsWith( SvtPathOptions().GetTempPath() ) ) 1. Use osl::FileBase::getTempDirURL(...) instead of SvtPathOptions().GetTempPath() to get system temporary directory, and check against that. 2. Add an additional, Windows-specific check, get the Temporary Internet Files location, and check if path is inside that. a. Before Vista (and kept for compatibility reasons): Call to SHGetFolderPath can be used: https://msdn.microsoft.com/en-us/library/windows/desktop/bb762181(v=vs.85).aspx The value for nFolder is CSIDL_INTERNET_CACHE (from here: https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx ) b. Since Vista: Call to SHGetKnownFolderPath can be used: https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188(v=vs.85).aspx The value for rfid is FOLDERID_InternetCache (from here: https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx ) A patch is in gerrit: https://gerrit.libreoffice.org/40594 An addition to my original description: Since 5.4 the default temporary directory isn't concerned anymore, as Justin's fix to bug 80807 handles that, I was just testing in 5.3.4 first, which didn't have it. A small additional change is that we don't want to check against LO's temporary directory there, as it might be changed by the user, and thus not be the same as the system's. For repro with 5.4 use Internet Explorer / Outlook, as those don't use the default temporary directory in Windows, but Temporary Internet Files. The fix is for handling that. Mike Kaganski committed a patch related to this issue. It has been pushed to "master": http://cgit.freedesktop.org/libreoffice/core/commit/?id=22334f8a003d26c71d772a8e00fc80b7e6d2bef1 tdf#109537: treat Temporary Internet Files as temp directory It will be available in 6.0.0. The patch should be included in the daily builds available at http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: http://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback. Fixed now, thanks Mike! |