[Libreoffice-commits] .: sfx2/source

Caolán McNamara caolan at kemper.freedesktop.org
Tue Apr 19 03:57:45 PDT 2011


 sfx2/source/doc/guisaveas.cxx |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

New commits:
commit 058335969debe302e23fa2c36d84d3ef55e2b47a
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

diff --git a/sfx2/source/doc/guisaveas.cxx b/sfx2/source/doc/guisaveas.cxx
index 8f5d2fc..c75147c 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 );
@@ -1145,7 +1143,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;
 
@@ -1176,8 +1174,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