Commit 628ac884 authored by Christian Persch's avatar Christian Persch Committed by Christian Persch

Use CopyUTF8toUTF16 where appropriate.

2004-03-10  Christian Persch  <chpe@cvs.gnome.org>

	* embed/mozilla/EphyHeaderSniffer.cpp:
	* embed/mozilla/FilePicker.cpp:
	* embed/mozilla/GtkNSSDialogs.cpp:
	* embed/mozilla/mozilla-embed-persist.cpp:

	Use CopyUTF8toUTF16 where appropriate.
parent cf20c417
2004-03-10 Christian Persch <chpe@cvs.gnome.org>
* embed/mozilla/EphyHeaderSniffer.cpp:
* embed/mozilla/FilePicker.cpp:
* embed/mozilla/GtkNSSDialogs.cpp:
* embed/mozilla/mozilla-embed-persist.cpp:
Use CopyUTF8toUTF16 where appropriate.
2004-03-09 Christian Persch <chpe@cvs.gnome.org>
* lib/egg/egg-toolbar-editor.c: (editor_drag_data_received_cb):
......
......@@ -282,10 +282,7 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI)
{
nsCAutoString fileNameCString;
url->GetFileName(fileNameCString);
/* FIXME: when we can depend on moz >= 1.5, use
* CopyUTF8toUTF16 instead
*/
defaultFileName = NS_ConvertUTF8toUTF16(fileNameCString);
CopyUTF8toUTF16 (fileNameCString, defaultFileName);
}
}
......@@ -305,16 +302,13 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI)
/* 4 Use the host. */
nsCAutoString hostName;
mURL->GetHost(hostName);
/* FIXME: when we can depend on moz >= 1.5, use
* CopyUTF8toUTF16 instead
*/
defaultFileName = NS_ConvertUTF8toUTF16(hostName);
CopyUTF8toUTF16 (hostName, defaultFileName);
}
/* 5 One last case to handle about:blank and other untitled pages. */
if (defaultFileName.IsEmpty())
{
defaultFileName = NS_ConvertUTF8toUTF16 (_("Untitled"));
CopyUTF8toUTF16 (_("Untitled"), defaultFileName);
}
/* Validate the file name to ensure legality. */
......@@ -324,6 +318,9 @@ nsresult EphyHeaderSniffer::PerformSave (nsIURI* inOriginalURI)
const char *key;
key = ephy_embed_persist_get_persist_key (EPHY_EMBED_PERSIST (mEmbedPersist));
/* FIXME: do better here by using nsITextToSubURI service, like in
* http://lxr.mozilla.org/seamonkey/source/xpfe/communicator/resources/content/contentAreaUtils.js#763
*/
char *filename;
filename = gnome_vfs_unescape_string (default_name, NULL);
......
......@@ -199,8 +199,9 @@ NS_IMETHODIMP GFilePicker::AppendFilter(const PRUnichar *title, const PRUnichar
NS_ConvertUTF16toUTF8 (title).get(),
NS_ConvertUTF16toUTF8 (filter).get())
nsCAutoString pattern = NS_ConvertUTF16toUTF8 (filter);
NS_ConvertUTF16toUTF8 pattern(filter);
pattern.StripWhitespace();
if (pattern.IsEmpty()) return NS_ERROR_FAILURE;
char **patterns = g_strsplit (pattern.get(), ";", -1);
......@@ -231,7 +232,6 @@ NS_IMETHODIMP GFilePicker::GetDefaultString(PRUnichar **aDefaultString)
{
converted = g_filename_to_utf8(filename, -1, NULL, NULL, NULL);
/* FIXME: when can depend on moz >= 1.6, use CopyUTF8toUTF16 here */
*aDefaultString = ToNewUnicode (NS_ConvertUTF8toUTF16 (converted));
g_free (filename);
......
......@@ -833,7 +833,7 @@ GtkNSSDialogs::SetPKCS12FilePassword(nsIInterfaceRequestor *ctx,
else
{
gchar * text = gtk_editable_get_chars (GTK_EDITABLE (entry1), 0, -1);
_password = NS_ConvertUTF8toUTF16 (text);
CopyUTF8toUTF16 (text, _password);
g_free (text);
*_retval = PR_TRUE;
}
......@@ -893,7 +893,7 @@ GtkNSSDialogs::GetPKCS12FilePassword(nsIInterfaceRequestor *ctx,
else
{
gchar * text = gtk_editable_get_chars (GTK_EDITABLE (entry), 0, -1);
_password = NS_ConvertUTF8toUTF16 (text);
CopyUTF8toUTF16 (text, _password);
g_free (text);
*_retval = PR_TRUE;
}
......
......@@ -314,7 +314,6 @@ impl_to_string (EphyEmbedPersist *persist)
return g_strdup (NS_ConvertUTF16toUTF8(aOutputString).get());
}
static GObject *
mozilla_embed_persist_constructor (GType type, guint n_construct_properties,
GObjectConstructParam *construct_params)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment