[Libreoffice-commits] .: Branch 'libreoffice-3-4' - 2 commits - sfx2/source

Caolán McNamara caolan at kemper.freedesktop.org
Tue Apr 19 04:33:17 PDT 2011


 sfx2/source/doc/guisaveas.cxx |   19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

New commits:
commit f1896b3341032ee06c70e1f6134b19adb534548e
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 19 12:08:24 2011 +0100

    Resolves: fdo#36358 Just use the same export dir as save as for all apps
    
    I believe the original idea was that draw/impress export graphics and so
    default output dir is the gallery as you might want to export them in there.
    
    Catch is that we cane export in some many different formats there there
    isn't a good fit for the whole collection, so lets just use the same
    dir for all apps
    (cherry picked from commit 364dd193486949af59596de7ce5bd83f4db54149)

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index f086bc6..c0250e2 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -311,8 +311,7 @@ public:
 
     sal_Bool ShowDocumentInfoDialog();
 
-    ::rtl::OUString GetReccomendedDir( const ::rtl::OUString& aSuggestedDir,
-                                       const sfx2::FileDialogHelper::Context& rCtxt );
+    ::rtl::OUString GetReccomendedDir( const ::rtl::OUString& aSuggestedDir );
     ::rtl::OUString GetReccomendedName( const ::rtl::OUString& aSuggestedName,
                                         const ::rtl::OUString& aTypeName );
 
@@ -884,9 +883,11 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
         }
 
         if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) ) )
-               eCtxt = sfx2::FileDialogHelper::SD_EXPORT;
+            eCtxt = sfx2::FileDialogHelper::SD_EXPORT;
         else if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) )
-               eCtxt = sfx2::FileDialogHelper::SI_EXPORT;
+            eCtxt = sfx2::FileDialogHelper::SI_EXPORT;
+        else if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextDocument" ) ) )
+            eCtxt = sfx2::FileDialogHelper::SW_EXPORT;
 
         if ( eCtxt != sfx2::FileDialogHelper::UNKNOWN_CONTEXT )
                pFileDlg->SetContext( eCtxt );
@@ -957,7 +958,7 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
         }
     }
 
-    ::rtl::OUString aReccomendedDir = GetReccomendedDir( aSuggestedDir, eCtxt );
+    ::rtl::OUString aReccomendedDir = GetReccomendedDir( aSuggestedDir );
     if ( aReccomendedDir.getLength() )
         pFileDlg->SetDisplayDirectory( aReccomendedDir );
     ::rtl::OUString aReccomendedName = GetReccomendedName( aSuggestedName, aAdjustToType );
@@ -1142,7 +1143,7 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog()
 }
 
 //-------------------------------------------------------------------------
-::rtl::OUString ModelData_Impl::GetReccomendedDir( const ::rtl::OUString& aSuggestedDir, const sfx2::FileDialogHelper::Context& rCtxt )
+::rtl::OUString ModelData_Impl::GetReccomendedDir( const ::rtl::OUString& aSuggestedDir )
 {
     ::rtl::OUString aReccomendedDir;
 
@@ -1173,13 +1174,7 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog()
     }
     else
     {
-        ::rtl::OUString aConfigSuggestion;
-        // Set graphic path if context == SD_EXPORT or SI_EXPORT else work path
-        if (rCtxt == sfx2::FileDialogHelper::SD_EXPORT || rCtxt == sfx2::FileDialogHelper::SI_EXPORT)
-            aConfigSuggestion = SvtPathOptions().GetGraphicPath();
-        else
-            aConfigSuggestion = SvtPathOptions().GetWorkPath();
-        aReccomendedDir = INetURLObject( aConfigSuggestion ).GetMainURL( INetURLObject::NO_DECODE );
+        aReccomendedDir = INetURLObject( SvtPathOptions().GetWorkPath() ).GetMainURL( INetURLObject::NO_DECODE );
     }
 
     return aReccomendedDir;
commit 83de55e4587840180caf1937687d93613cf07534
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Tue Apr 19 11:57:07 2011 +0100

    Resolves: fdo#36358, firstly lets code what the comment says it wants to do
    (cherry picked from commit 058335969debe302e23fa2c36d84d3ef55e2b47a)

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 74f3193..f086bc6 100644
--- a/sfx2/source/doc/guisaveas.cxx
+++ b/sfx2/source/doc/guisaveas.cxx
@@ -312,7 +312,7 @@ public:
     sal_Bool ShowDocumentInfoDialog();
 
     ::rtl::OUString GetReccomendedDir( const ::rtl::OUString& aSuggestedDir,
-                                       const sfx2::FileDialogHelper::Context& aCtxt );
+                                       const sfx2::FileDialogHelper::Context& rCtxt );
     ::rtl::OUString GetReccomendedName( const ::rtl::OUString& aSuggestedName,
                                         const ::rtl::OUString& aTypeName );
 
@@ -885,10 +885,8 @@ sal_Bool ModelData_Impl::OutputFileDialog( sal_Int8 nStoreMode,
 
         if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.drawing.DrawingDocument" ) ) )
                eCtxt = sfx2::FileDialogHelper::SD_EXPORT;
-        if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) )
+        else if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.presentation.PresentationDocument" ) ) )
                eCtxt = sfx2::FileDialogHelper::SI_EXPORT;
-        if( aDocServiceName.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM( "com.sun.star.text.TextDocument" ) ) )
-            eCtxt = sfx2::FileDialogHelper::SW_EXPORT;
 
         if ( eCtxt != sfx2::FileDialogHelper::UNKNOWN_CONTEXT )
                pFileDlg->SetContext( eCtxt );
@@ -1144,7 +1142,7 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog()
 }
 
 //-------------------------------------------------------------------------
-::rtl::OUString ModelData_Impl::GetReccomendedDir( const ::rtl::OUString& aSuggestedDir, const sfx2::FileDialogHelper::Context& aCtxt )
+::rtl::OUString ModelData_Impl::GetReccomendedDir( const ::rtl::OUString& aSuggestedDir, const sfx2::FileDialogHelper::Context& rCtxt )
 {
     ::rtl::OUString aReccomendedDir;
 
@@ -1175,8 +1173,12 @@ sal_Bool ModelData_Impl::ShowDocumentInfoDialog()
     }
     else
     {
-        // pb: set graphic path if context == SD_EXPORT or SI_EXPORT else work path
-        ::rtl::OUString aConfigSuggestion( ( aCtxt != sfx2::FileDialogHelper::UNKNOWN_CONTEXT ) ? SvtPathOptions().GetGraphicPath() : SvtPathOptions().GetWorkPath() );
+        ::rtl::OUString aConfigSuggestion;
+        // Set graphic path if context == SD_EXPORT or SI_EXPORT else work path
+        if (rCtxt == sfx2::FileDialogHelper::SD_EXPORT || rCtxt == sfx2::FileDialogHelper::SI_EXPORT)
+            aConfigSuggestion = SvtPathOptions().GetGraphicPath();
+        else
+            aConfigSuggestion = SvtPathOptions().GetWorkPath();
         aReccomendedDir = INetURLObject( aConfigSuggestion ).GetMainURL( INetURLObject::NO_DECODE );
     }
 


More information about the Libreoffice-commits mailing list