aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozillaPrivate.cpp
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@src.gnome.org>2004-06-04 02:51:32 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-06-04 02:51:32 +0800
commitb774b547788b74884b9eb690c548a6016e714023 (patch)
tree72b9df09c0fc257169b3e9b9cbdc349e56a63101 /embed/mozilla/MozillaPrivate.cpp
parentb699b40d663955560655271f7645ae277e6076c8 (diff)
downloadgsoc2013-epiphany-b774b547788b74884b9eb690c548a6016e714023.tar
gsoc2013-epiphany-b774b547788b74884b9eb690c548a6016e714023.tar.gz
gsoc2013-epiphany-b774b547788b74884b9eb690c548a6016e714023.tar.bz2
gsoc2013-epiphany-b774b547788b74884b9eb690c548a6016e714023.tar.lz
gsoc2013-epiphany-b774b547788b74884b9eb690c548a6016e714023.tar.xz
gsoc2013-epiphany-b774b547788b74884b9eb690c548a6016e714023.tar.zst
gsoc2013-epiphany-b774b547788b74884b9eb690c548a6016e714023.zip
merge mozilla-embed-strings branch
Diffstat (limited to 'embed/mozilla/MozillaPrivate.cpp')
-rw-r--r--embed/mozilla/MozillaPrivate.cpp50
1 files changed, 35 insertions, 15 deletions
diff --git a/embed/mozilla/MozillaPrivate.cpp b/embed/mozilla/MozillaPrivate.cpp
index cfd69173e..3fd0e57ab 100644
--- a/embed/mozilla/MozillaPrivate.cpp
+++ b/embed/mozilla/MozillaPrivate.cpp
@@ -27,17 +27,13 @@
#include "MozillaPrivate.h"
+#include <nsEmbedString.h>
#include <nsIServiceManagerUtils.h>
#include <nsIWindowWatcher.h>
#include <nsIEmbeddingSiteWindow.h>
#include <nsIWebBrowserChrome.h>
#include <gtkmozembed.h>
-#ifdef ALLOW_PRIVATE_STRINGS
-#include "nsString.h"
-#include "nsReadableUtils.h"
-#endif
-
GtkWidget *MozillaFindEmbed (nsIDOMWindow *aDOMWindow)
{
if (!aDOMWindow) return nsnull;
@@ -108,23 +104,44 @@ NS_METHOD MozillaCollatePrintSettings (const EmbedPrintInfo *info,
options->SetMarginLeft (MM_TO_INCH (info->left_margin));
options->SetMarginRight (MM_TO_INCH (info->right_margin));
- options->SetPrinterName(NS_LITERAL_STRING("PostScript/default").get());
+ PRUnichar postscript[] = { 'P', 'o', 's', 't', 's', 'c', 'r', 'i',
+ 'p', 't', '/', 'd', 'e', 'f', 'a', 'u',
+ 'l', 't', '\0' };
+ options->SetPrinterName(postscript);
- options->SetHeaderStrLeft(NS_ConvertUTF8toUTF16(info->header_left_string).get());
+ nsEmbedString tmp;
- options->SetHeaderStrCenter(NS_ConvertUTF8toUTF16(info->header_center_string).get());
+ NS_CStringToUTF16 (nsEmbedCString(info->header_left_string),
+ NS_CSTRING_ENCODING_UTF8, tmp);
+ options->SetHeaderStrLeft (tmp.get());
- options->SetHeaderStrRight(NS_ConvertUTF8toUTF16(info->header_right_string).get());
+ NS_CStringToUTF16 (nsEmbedCString(info->header_center_string),
+ NS_CSTRING_ENCODING_UTF8, tmp);
+ options->SetHeaderStrCenter (tmp.get());
- options->SetFooterStrLeft(NS_ConvertUTF8toUTF16(info->footer_left_string).get());
+ NS_CStringToUTF16 (nsEmbedCString(info->header_right_string),
+ NS_CSTRING_ENCODING_UTF8, tmp);
+ options->SetHeaderStrRight (tmp.get());
- options->SetFooterStrCenter(NS_ConvertUTF8toUTF16(info->footer_center_string).get());
+ NS_CStringToUTF16 (nsEmbedCString(info->footer_left_string),
+ NS_CSTRING_ENCODING_UTF8, tmp);
+ options->SetFooterStrLeft (tmp.get());
- options->SetFooterStrRight(NS_ConvertUTF8toUTF16(info->footer_right_string).get());
+ NS_CStringToUTF16 (nsEmbedCString(info->footer_center_string),
+ NS_CSTRING_ENCODING_UTF8, tmp);
+ options->SetFooterStrCenter(tmp.get());
- options->SetToFileName (NS_ConvertUTF8toUTF16(info->file).get());
+ NS_CStringToUTF16 (nsEmbedCString(info->footer_right_string),
+ NS_CSTRING_ENCODING_UTF8, tmp);
+ options->SetFooterStrRight(tmp.get());
- options->SetPrintCommand (NS_ConvertUTF8toUTF16(info->printer).get());
+ NS_CStringToUTF16 (nsEmbedCString(info->file),
+ NS_CSTRING_ENCODING_UTF8, tmp);
+ options->SetToFileName (tmp.get());
+
+ NS_CStringToUTF16 (nsEmbedCString(info->printer),
+ NS_CSTRING_ENCODING_UTF8, tmp);
+ options->SetPrintCommand (tmp.get());
/**
* Work around a mozilla bug where paper size & orientation are ignored
@@ -143,7 +160,10 @@ NS_METHOD MozillaCollatePrintSettings (const EmbedPrintInfo *info,
/* native paper size formats. Our dialog does not support custom yet */
options->SetPaperSize (nsIPrintSettings::kPaperSizeNativeData);
- options->SetPaperName (NS_ConvertUTF8toUTF16(info->paper).get());
+
+ NS_CStringToUTF16 (nsEmbedCString(info->paper),
+ NS_CSTRING_ENCODING_UTF8, tmp);
+ options->SetPaperName (tmp.get());
options->SetPrintInColor (info->print_color);
options->SetOrientation (info->orientation);