[Libreoffice-commits] core.git: vcl/unx

Gergő Mocsi gmocsi91 at gmail.com
Tue Mar 19 06:31:14 PDT 2013


 vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx |    3 +++
 vcl/unx/gtk/fpicker/SalGtkPicker.cxx       |    3 +++
 2 files changed, 6 insertions(+)

New commits:
commit e8504d9737ba0306ab8bcde9fcd8f50fdf30d33f
Author: Gergő Mocsi <gmocsi91 at gmail.com>
Date:   Mon Feb 25 15:46:08 2013 +0100

    handle the empty URL case in file picker
    
    Some extensions in the wild, for example Impress Photo Album Creator,
    manage to call the file picker dialog with an empty URL. The resulting
    error message is not very helpful: "Operation not supported" dialog.
    Therefore we assign a default URL when empty URL is passed.
    
    Change-Id: Icf71142411a79e1fe2d1d5918d2a400b174acc00
    Reviewed-on: https://gerrit.libreoffice.org/2390
    Reviewed-by: Andras Timar <atimar at suse.com>
    Tested-by: Andras Timar <atimar at suse.com>

diff --git a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
index 45fe125..d950dd8 100644
--- a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx
@@ -78,6 +78,9 @@ void SAL_CALL SalGtkFolderPicker::setDisplayDirectory( const rtl::OUString& aDir
     OSL_ASSERT( m_pDialog != NULL );
 
     OString aTxt = unicodetouri( aDirectory );
+    if( aTxt.isEmpty() ){
+      aTxt = unicodetouri(OUString("file:///."));
+    }
 
     if( !aTxt.isEmpty() && aTxt.lastIndexOf('/') == aTxt.getLength() - 1 )
         aTxt = aTxt.copy( 0, aTxt.getLength() - 1 );
diff --git a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
index 236a0df..b4c08b5 100644
--- a/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
+++ b/vcl/unx/gtk/fpicker/SalGtkPicker.cxx
@@ -217,6 +217,9 @@ void SAL_CALL SalGtkPicker::implsetDisplayDirectory( const rtl::OUString& aDirec
     OSL_ASSERT( m_pDialog != NULL );
 
     OString aTxt = unicodetouri(aDirectory);
+    if( aTxt.isEmpty() ){
+      aTxt = unicodetouri(OUString("file:///."));
+    }
 
     if( aTxt.lastIndexOf('/') == aTxt.getLength() - 1 )
         aTxt = aTxt.copy( 0, aTxt.getLength() - 1 );


More information about the Libreoffice-commits mailing list