diff options
author | Gergő Mocsi <gmocsi91@gmail.com> | 2013-02-25 15:46:08 +0100 |
---|---|---|
committer | Andras Timar <atimar@suse.com> | 2013-03-19 13:30:55 +0000 |
commit | e8504d9737ba0306ab8bcde9fcd8f50fdf30d33f (patch) | |
tree | 1c566b3aa115c7182425aa65029cf90707e6c4db /vcl | |
parent | e76e2c4ce76457e518b007b970e1b0c2742f8d6e (diff) |
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@suse.com>
Tested-by: Andras Timar <atimar@suse.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx | 3 | ||||
-rw-r--r-- | vcl/unx/gtk/fpicker/SalGtkPicker.cxx | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFolderPicker.cxx index 45fe1254c2a3..d950dd8dbf9c 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 236a0dfa7354..b4c08b5c5fd7 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 ); |