fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit dcf11ef35fbd0012c1603b53704fa05afdb2ce7f
Author: Tor Lillqvist <tlillqv...@suse.com>
Date:   Tue May 7 17:54:46 2013 +0300

    Different fix for bnc#777788
    
    Use the same GUID in the file dialog for the FILESAVE_AUTOEXTENSION
    case as for the FILESAVE_AUTOEXTENSION_EXTENSION case. The former is
    used when exporting to PDF. Exactly why using one GUID for the dialog
    causes it to use the default folder as set by SetFolder(), and the
    other not, I have no idea. Are the GUIDs we use arbitrary (and unique
    to the OOo/LO codebase), or does either of them, or both, have some
    magic meaning to Windows?
    
    FILESAVE_AUTOEXTENSION is also used in other cases than exporting to
    PDF. It remains to be seen whether this change will cause noticeable
    behaviour change interpreted as a harmful regression. Or whether the
    change of default folder for PDF export will do that, for that matter.

diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx 
b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
index 6555685..52de8d8 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
@@ -68,7 +68,6 @@ typedef ::comphelper::SequenceAsVector< ::rtl::OUString > 
TStringList;
 // Guids used for IFileDialog::SetClientGuid
 static const GUID CLIENTID_FILEDIALOG_SIMPLE        = {0xB8628FD3, 0xA3F5, 
0x4845, 0x9B, 0x62, 0xD5, 0x1E, 0xDF, 0x97, 0xC4, 0x83};
 static const GUID CLIENTID_FILEDIALOG_OPTIONS       = {0x93ED486F, 0x0D04, 
0x4807, 0x8C, 0x44, 0xAC, 0x26, 0xCB, 0x6C, 0x5D, 0x36};
-static const GUID CLIENTID_FILESAVE                 = {0x3B2E2261, 0x402D, 
0x4049, 0xB0, 0xC0, 0x91, 0x13, 0xF8, 0x6E, 0x84, 0x7C};
 static const GUID CLIENTID_FILESAVE_PASSWORD        = {0xC12D4F4C, 0x4D41, 
0x4D4F, 0x97, 0xEF, 0x87, 0xF9, 0x8D, 0xB6, 0x1E, 0xA6};
 static const GUID CLIENTID_FILESAVE_SELECTION       = {0x5B2482B3, 0x0358, 
0x4E09, 0xAA, 0x64, 0x2B, 0x76, 0xB2, 0xA0, 0xDD, 0xFE};
 static const GUID CLIENTID_FILESAVE_TEMPLATE        = {0x9996D877, 0x20D5, 
0x424B, 0x9C, 0x2E, 0xD3, 0xB6, 0x31, 0xEC, 0xF7, 0xCE};
@@ -500,14 +499,11 @@ void 
VistaFilePickerImpl::impl_sta_enableFeatures(::sal_Int32 nFeatures, ::sal_I
             aGUID = CLIENTID_FILEDIALOG_OPTIONS;
             break;
 
-        case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION :
-            aGUID = CLIENTID_FILESAVE;
-            break;
-
         case 
css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_PASSWORD :
             aGUID = CLIENTID_FILESAVE_PASSWORD;
             break;
 
+        case css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION :
         case 
css::ui::dialogs::TemplateDescription::FILESAVE_AUTOEXTENSION_SELECTION :
             aGUID = CLIENTID_FILESAVE_SELECTION;
             break;
commit 58fc0b1a14e827ab0b9ee4da8630c1e3ee10a19c
Author: Tor Lillqvist <tlillqv...@suse.com>
Date:   Tue May 7 14:44:16 2013 +0300

    Revert ""Fix" bnc#777788"
    
    I will try to fix it in some other way that doesn't cause fdo#63622.
    
    This reverts commit d639a5febe0df03d7af90d69eed816dcf856a551.

diff --git a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx 
b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
index 75a3f79..6555685 100644
--- a/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
+++ b/fpicker/source/win32/filepicker/VistaFilePickerImpl.cxx
@@ -668,6 +668,7 @@ void VistaFilePickerImpl::impl_sta_SetFileName(const 
RequestRef& rRequest)
 void VistaFilePickerImpl::impl_sta_SetDirectory(const RequestRef& rRequest)
 {
     ::rtl::OUString sDirectory = 
rRequest->getArgumentOrDefault(PROP_DIRECTORY, ::rtl::OUString());
+    bool            bForce     = rRequest->getArgumentOrDefault(PROP_FORCE, 
false);
 
     if( !m_bInExecute)
     {
@@ -694,7 +695,13 @@ void VistaFilePickerImpl::impl_sta_SetDirectory(const 
RequestRef& rRequest)
     if ( FAILED(hResult) )
         return;
 
-    iDialog->SetFolder(pFolder);
+    if ( m_bInExecute || bForce )
+        iDialog->SetFolder(pFolder);
+    else
+    {
+        // Use set default folder as Microsoft recommends in the IFileDialog 
documentation.
+        iDialog->SetDefaultFolder(pFolder);
+    }
 }
 
 void VistaFilePickerImpl::impl_sta_GetDirectory(const RequestRef& rRequest)
_______________________________________________
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits

Reply via email to