summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9fe2399)
raw | patch | inline | side by side (parent: 9fe2399)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 5 Sep 2009 22:01:24 +0000 (22:01 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Sat, 5 Sep 2009 22:01:24 +0000 (22:01 +0000) |
diff --git a/src/document.cpp b/src/document.cpp
index 17057e1dc8327bbddf883d323b3e8d63526c3fd2..288e52c6d88844244245381ac56986638d40d7e9 100644 (file)
--- a/src/document.cpp
+++ b/src/document.cpp
return root->height.computed;
}
-void sp_document_set_landscape (SPDocument *document, gboolean landscape)
-{
- SPRoot *root = SP_ROOT(document->root);
-
- root->landscape = landscape;
- SP_OBJECT (root)->updateRepr();
-}
-
-gboolean sp_document_landscape(SPDocument *document)
-{
- g_return_val_if_fail(document != NULL, 0.0);
- g_return_val_if_fail(document->priv != NULL, 0.0);
- g_return_val_if_fail(document->root != NULL, 0.0);
-
- SPRoot *root = SP_ROOT(document->root);
-
- return root->landscape;
-}
-
Geom::Point sp_document_dimensions(SPDocument *doc)
{
return Geom::Point(sp_document_width(doc), sp_document_height(doc));
diff --git a/src/document.h b/src/document.h
index 63ca221a29f1966bd5f5fb75ecb6015e44e5f5f5..696e568ad419e01465564e308928197278068ecf 100644 (file)
--- a/src/document.h
+++ b/src/document.h
@@ -185,14 +185,12 @@ SPDocument *sp_document_create(Inkscape::XML::Document *rdoc, gchar const *uri,
gdouble sp_document_width(SPDocument *document);
gdouble sp_document_height(SPDocument *document);
-gboolean sp_document_landscape(SPDocument *document);
Geom::Point sp_document_dimensions(SPDocument *document);
struct SPUnit;
void sp_document_set_width(SPDocument *document, gdouble width, const SPUnit *unit);
void sp_document_set_height(SPDocument *document, gdouble height, const SPUnit *unit);
-void sp_document_set_landscape(SPDocument *document, gboolean landscape);
#define SP_DOCUMENT_URI(d) (d->uri)
#define SP_DOCUMENT_NAME(d) (d->name)
diff --git a/src/sp-root.h b/src/sp-root.h
index 8b3cb4f0cb2d01f4f5d0c1c436512337b8a859a2..7976eb2f4eb46f7b073f9d4edf918284d855b620 100644 (file)
--- a/src/sp-root.h
+++ b/src/sp-root.h
SVGLength y;
SVGLength width;
SVGLength height;
- gboolean landscape;
/* viewBox; */
unsigned int viewBox_set : 1;
index d98d6a49e8f3996b2d931882f98113c0f2b72394..f9db265d66b1a6f3319f9dcb7363b055bf333c14 100644 (file)
--- a/src/ui/dialog/print.cpp
+++ b/src/ui/dialog/print.cpp
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);
index 6817d815b63a2a106a4980c788c619366aae3660..02688a55e67ac6370c31ba744e2027915ec07596 100644 (file)
_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)));
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));