summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/print.cpp
diff options
context:
space:
mode:
authorNicolas Dufour <nicoduf@yahoo.fr>2009-08-12 14:00:19 +0000
committerJazzyNico <JazzyNico@users.sourceforge.net>2009-08-12 14:00:19 +0000
commit3c5b9a5d0a9df79c757435ad63514287cd5b211b (patch)
tree0a22f3d90db1a915fa9d3c8031e621ae082c23e7 /src/ui/dialog/print.cpp
parentDon't open 'Save as ...' dialog inside the application bundle on OS X when it... (diff)
downloadinkscape-3c5b9a5d0a9df79c757435ad63514287cd5b211b.tar.gz
inkscape-3c5b9a5d0a9df79c757435ad63514287cd5b211b.zip
Fix for Bug #166678 (Paper size or orientation are not used when printing) by Adrian Johnson.
(bzr r8473)
Diffstat (limited to 'src/ui/dialog/print.cpp')
-rw-r--r--src/ui/dialog/print.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp
index 214b1a6db..d98d6a49e 100644
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
@@ -188,12 +188,19 @@ Print::Print(SPDocument *doc, SPItem *base) :
GtkPageSetup *page_setup = gtk_page_setup_new();
gdouble doc_width = sp_document_width(_doc) * PT_PER_PX;
gdouble doc_height = sp_document_height(_doc) * PT_PER_PX;
- GtkPaperSize *paper_size = gtk_paper_size_new_custom("custom", "custom",
- doc_width, doc_height, GTK_UNIT_POINTS);
+ GtkPaperSize *paper_size;
+ if (sp_document_landscape(_doc)) {
+ gtk_page_setup_set_orientation (page_setup, GTK_PAGE_ORIENTATION_LANDSCAPE);
+ paper_size = gtk_paper_size_new_custom("custom", "custom",
+ doc_height, doc_width, GTK_UNIT_POINTS);
+ } else {
+ gtk_page_setup_set_orientation (page_setup, GTK_PAGE_ORIENTATION_PORTRAIT);
+ paper_size = gtk_paper_size_new_custom("custom", "custom",
+ doc_width, doc_height, GTK_UNIT_POINTS);
+ }
+
gtk_page_setup_set_paper_size (page_setup, paper_size);
-#ifndef WIN32
gtk_print_operation_set_default_page_setup (_printop, page_setup);
-#endif
gtk_print_operation_set_use_full_page (_printop, TRUE);
// set up signals