summaryrefslogtreecommitdiffstats
path: root/src/ui
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2009-09-05 22:01:24 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2009-09-05 22:01:24 +0000
commit9f4c787cd772c585ffa7be104bffc8ee62114728 (patch)
tree35ad94e63234b1309f4e2f951fd65045a3e9f1ab /src/ui
parentupdate (diff)
downloadinkscape-9f4c787cd772c585ffa7be104bffc8ee62114728.tar.gz
inkscape-9f4c787cd772c585ffa7be104bffc8ee62114728.zip
patch by Adrian Johnson for 166678
(bzr r8561)
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/dialog/print.cpp2
-rw-r--r--src/ui/widget/page-sizer.cpp23
2 files changed, 12 insertions, 13 deletions
diff --git a/src/ui/dialog/print.cpp b/src/ui/dialog/print.cpp
index d98d6a49e..f9db265d6 100644
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
@@ -189,7 +189,7 @@ Print::Print(SPDocument *doc, SPItem *base) :
gdouble doc_width = sp_document_width(_doc) * PT_PER_PX;
gdouble doc_height = sp_document_height(_doc) * PT_PER_PX;
GtkPaperSize *paper_size;
- if (sp_document_landscape(_doc)) {
+ if (doc_width > doc_height) {
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);
diff --git a/src/ui/widget/page-sizer.cpp b/src/ui/widget/page-sizer.cpp
index 6817d815b..02688a55e 100644
--- a/src/ui/widget/page-sizer.cpp
+++ b/src/ui/widget/page-sizer.cpp
@@ -345,23 +345,11 @@ PageSizer::setDim (double w, double h, bool changeList)
_changedw_connection.block();
_changedh_connection.block();
- if ( w != h ) {
- _landscapeButton.set_sensitive(true);
- _portraitButton.set_sensitive (true);
- _landscape = ( w > h );
- _landscapeButton.set_active(_landscape ? true : false);
- _portraitButton.set_active (_landscape ? false : true);
- } else {
- _landscapeButton.set_sensitive(false);
- _portraitButton.set_sensitive (false);
- }
-
if (SP_ACTIVE_DESKTOP && !_widgetRegistry->isUpdating()) {
SPDocument *doc = sp_desktop_document(SP_ACTIVE_DESKTOP);
double const old_height = sp_document_height(doc);
sp_document_set_width (doc, w, &_px_unit);
sp_document_set_height (doc, h, &_px_unit);
- sp_document_set_landscape (doc, _landscape);
// The origin for the user is in the lower left corner; this point should remain stationary when
// changing the page size. The SVG's origin however is in the upper left corner, so we must compensate for this
Geom::Translate const vert_offset(Geom::Point(0, (old_height - h)));
@@ -369,6 +357,17 @@ PageSizer::setDim (double w, double h, bool changeList)
sp_document_done (doc, SP_VERB_NONE, _("Set page size"));
}
+ if ( w != h ) {
+ _landscapeButton.set_sensitive(true);
+ _portraitButton.set_sensitive (true);
+ _landscape = ( w > h );
+ _landscapeButton.set_active(_landscape ? true : false);
+ _portraitButton.set_active (_landscape ? false : true);
+ } else {
+ _landscapeButton.set_sensitive(false);
+ _portraitButton.set_sensitive (false);
+ }
+
if (changeList)
{
Gtk::TreeModel::Row row = (*find_paper_size(w, h));