aboutsummaryrefslogtreecommitdiffstats
path: root/embed/mozilla/MozillaPrivate.cpp
diff options
context:
space:
mode:
authorChristian Persch <chpe@cvs.gnome.org>2003-06-15 20:01:53 +0800
committerChristian Persch <chpe@src.gnome.org>2003-06-15 20:01:53 +0800
commit5a927d2793acbd7ca212812048e41891cda8a6e9 (patch)
treec1d9fe682c7af65fda89ab591e7e9b729ac0596a /embed/mozilla/MozillaPrivate.cpp
parentfa31654eac12411d58ab603924953410c53e1426 (diff)
downloadgsoc2013-epiphany-5a927d2793acbd7ca212812048e41891cda8a6e9.tar
gsoc2013-epiphany-5a927d2793acbd7ca212812048e41891cda8a6e9.tar.gz
gsoc2013-epiphany-5a927d2793acbd7ca212812048e41891cda8a6e9.tar.bz2
gsoc2013-epiphany-5a927d2793acbd7ca212812048e41891cda8a6e9.tar.lz
gsoc2013-epiphany-5a927d2793acbd7ca212812048e41891cda8a6e9.tar.xz
gsoc2013-epiphany-5a927d2793acbd7ca212812048e41891cda8a6e9.tar.zst
gsoc2013-epiphany-5a927d2793acbd7ca212812048e41891cda8a6e9.zip
Convert dialog to metric units and default paper to A4. Fixes #112619
2003-06-15 Christian Persch <chpe@cvs.gnome.org> * embed/mozilla/MozillaPrivate.cpp: (MozillaCollatePrintSettings): * embed/ephy-embed.h: * embed/print-dialog.c: (print_dialog_init), (print_free_info), (print_get_info): * data/epiphany.schemas.in: * data/glade/print.glade: Convert dialog to metric units and default paper to A4. Fixes #112619
Diffstat (limited to 'embed/mozilla/MozillaPrivate.cpp')
-rw-r--r--embed/mozilla/MozillaPrivate.cpp17
1 files changed, 6 insertions, 11 deletions
diff --git a/embed/mozilla/MozillaPrivate.cpp b/embed/mozilla/MozillaPrivate.cpp
index 0847f3473..46ece8418 100644
--- a/embed/mozilla/MozillaPrivate.cpp
+++ b/embed/mozilla/MozillaPrivate.cpp
@@ -37,6 +37,7 @@ GtkWidget *MozillaFindGtkParent (nsIDOMWindow *aDOMWindow)
return gtk_widget_get_toplevel (GTK_WIDGET(mozembed));
}
+#define MM_TO_INCH(x) (((double) x) / 25.4)
NS_METHOD MozillaCollatePrintSettings (const EmbedPrintInfo *info,
nsIPrintSettings *options)
@@ -46,11 +47,6 @@ NS_METHOD MozillaCollatePrintSettings (const EmbedPrintInfo *info,
nsIPrintSettings::kSelectedFrame,
nsIPrintSettings::kEachFrameSep
};
- /* these should match the order of the radiobuttons in the dialog
- * and the paper names in the default print provider PS*/
- const static char *PaperSizeNames[] = {
- "Letter","Legal","Executive","A4"
- };
switch (info->pages)
@@ -68,10 +64,10 @@ NS_METHOD MozillaCollatePrintSettings (const EmbedPrintInfo *info,
break;
}
- options->SetMarginTop (info->top_margin);
- options->SetMarginBottom (info->bottom_margin);
- options->SetMarginLeft (info->left_margin);
- options->SetMarginRight (info->right_margin);
+ options->SetMarginTop (MM_TO_INCH (info->top_margin));
+ options->SetMarginBottom (MM_TO_INCH (info->bottom_margin));
+ options->SetMarginLeft (MM_TO_INCH (info->left_margin));
+ options->SetMarginRight (MM_TO_INCH (info->right_margin));
options->SetPrinterName(NS_LITERAL_STRING("PostScript/default").get());
@@ -95,8 +91,7 @@ NS_METHOD MozillaCollatePrintSettings (const EmbedPrintInfo *info,
/* native paper size formats. Our dialog does not support custom yet */
options->SetPaperSize (nsIPrintSettings::kPaperSizeNativeData);
- int tps = (info->paper >= 0 || info->paper < 4) ? info->paper : 0;
- options->SetPaperName (NS_ConvertUTF8toUCS2(PaperSizeNames[tps]).get());
+ options->SetPaperName (NS_ConvertUTF8toUCS2(info->paper).get());
options->SetPrintInColor (info->print_color);
options->SetOrientation (info->orientation);