diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2006-05-16 07:05:56 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2006-05-16 07:05:56 +0000 |
commit | 5ce544d92b2658aeb67267e1b6a92b224617f7bc (patch) | |
tree | 548f02e8a64ef6c7db36e68dd00c70fb52135917 /fpicker | |
parent | c9ea78f03a45dac9b54a7afa33e069be8a290768 (diff) |
INTEGRATION: CWS gtkfpicker (1.9.66); FILE MERGED
2006/05/12 15:45:20 hro 1.9.66.1: #b6424439# URI cannot be converted to Unicode if system locale is not UTF-8. Prevent from crash
Diffstat (limited to 'fpicker')
-rw-r--r-- | fpicker/source/unx/gnome/SalGtkPicker.cxx | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/fpicker/source/unx/gnome/SalGtkPicker.cxx b/fpicker/source/unx/gnome/SalGtkPicker.cxx index 7c56c69ac80e..5fff3bf80fac 100644 --- a/fpicker/source/unx/gnome/SalGtkPicker.cxx +++ b/fpicker/source/unx/gnome/SalGtkPicker.cxx @@ -4,9 +4,9 @@ * * $RCSfile: SalGtkPicker.cxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: rt $ $Date: 2005-09-08 23:35:50 $ + * last change: $Author: vg $ $Date: 2006-05-16 08:05:56 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -82,15 +82,22 @@ rtl::OUString SalGtkPicker::uritounicode(const gchar* pIn) { rtl::OUString sURL( const_cast<const sal_Char *>(pIn), strlen(pIn), RTL_TEXTENCODING_UTF8 ); + INetURLObject aURL(sURL); if (INET_PROT_FILE == aURL.GetProtocol()) { gchar *pEncodedFileName = g_filename_from_uri(pIn, NULL, NULL); - rtl::OUString sEncoded(pEncodedFileName, strlen(pEncodedFileName), - osl_getThreadTextEncoding()); - INetURLObject aCurrentURL(sEncoded, INetURLObject::FSYS_UNX); - aCurrentURL.SetHost(aURL.GetHost()); - sURL = aCurrentURL.getExternalURL(); + + if ( pEncodedFileName ) + { + rtl::OUString sEncoded(pEncodedFileName, strlen(pEncodedFileName), + osl_getThreadTextEncoding()); + INetURLObject aCurrentURL(sEncoded, INetURLObject::FSYS_UNX); + aCurrentURL.SetHost(aURL.GetHost()); + sURL = aCurrentURL.getExternalURL(); + } + else + sURL = rtl::OUString(); } return sURL; } |