<html>
    <head>
      <base href="https://bugs.documentfoundation.org/">
    </head>
    <body>
      <p>
        <div>
            <b><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Files coming from a temp dir are offered to be saved back in the temp dir instead of default workdir"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=109537#c2">Comment # 2</a>
              on <a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Files coming from a temp dir are offered to be saved back in the temp dir instead of default workdir"
   href="https://bugs.documentfoundation.org/show_bug.cgi?id=109537">bug 109537</a>
              from <span class="vcard"><a class="email" href="mailto:baron@caesar.elte.hu" title="Aron Budea <baron@caesar.elte.hu>"> <span class="fn">Aron Budea</span></a>
</span></b>
        <pre>The plan is to update the followig piece of code (added for <a class="bz_bug_link 
          bz_status_VERIFIED  bz_closed"
   title="VERIFIED FIXED - FILESAVE: Saving File in Temporary Folder - usability issue"
   href="show_bug.cgi?id=80807">bug 80807</a>):
<a href="https://opengrok.libreoffice.org/xref/core/sfx2/source/doc/guisaveas.cxx#1151">https://opengrok.libreoffice.org/xref/core/sfx2/source/doc/guisaveas.cxx#1151</a>
// 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:
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb762181(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/bb762181(v=vs.85).aspx</a>

The value for nFolder is CSIDL_INTERNET_CACHE (from here:
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx</a>
)

b. Since Vista:

Call to SHGetKnownFolderPath can be used:
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/bb762188(v=vs.85).aspx</a>

The value for rfid is FOLDERID_InternetCache (from here:
<a href="https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx">https://msdn.microsoft.com/en-us/library/windows/desktop/bb762494(v=vs.85).aspx</a>
)</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are the assignee for the bug.</li>
      </ul>
    </body>
</html>