summaryrefslogtreecommitdiffstats
path: root/src/sp-namedview.cpp
diff options
context:
space:
mode:
authorJohn Smith <john.smith7545@yahoo.com>2012-08-28 23:19:10 +0000
committerJohn Smith <john.smith7545@yahoo.com>2012-08-28 23:19:10 +0000
commit6307d87c8daf2986c3e0f574fc898ab02be6f5e3 (patch)
treefaff8cb32a7dde71ff67aefdff7172658dafd5eb /src/sp-namedview.cpp
parentFix for 1042602 : Select toolbar : Width and height are not initially 0 (diff)
downloadinkscape-6307d87c8daf2986c3e0f574fc898ab02be6f5e3.tar.gz
inkscape-6307d87c8daf2986c3e0f574fc898ab02be6f5e3.zip
Fix for 928205 : Preference to not save doc viewport metadata
(bzr r11630)
Diffstat (limited to 'src/sp-namedview.cpp')
-rw-r--r--src/sp-namedview.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sp-namedview.cpp b/src/sp-namedview.cpp
index 75c2f8343..9d5821897 100644
--- a/src/sp-namedview.cpp
+++ b/src/sp-namedview.cpp
@@ -889,6 +889,7 @@ void sp_namedview_document_from_window(SPDesktop *desktop)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
bool save_geometry_in_file = prefs->getBool("/options/savewindowgeometry/value", 0);
+ bool save_viewport_in_file = prefs->getBool("/options/savedocviewport/value", true);
Inkscape::XML::Node *view = desktop->namedview->getRepr();
Geom::Rect const r = desktop->get_display_area();
@@ -896,9 +897,11 @@ void sp_namedview_document_from_window(SPDesktop *desktop)
bool saved = DocumentUndo::getUndoSensitive(sp_desktop_document(desktop));
DocumentUndo::setUndoSensitive(sp_desktop_document(desktop), false);
- sp_repr_set_svg_double(view, "inkscape:zoom", desktop->current_zoom());
- sp_repr_set_svg_double(view, "inkscape:cx", r.midpoint()[Geom::X]);
- sp_repr_set_svg_double(view, "inkscape:cy", r.midpoint()[Geom::Y]);
+ if (save_viewport_in_file) {
+ sp_repr_set_svg_double(view, "inkscape:zoom", desktop->current_zoom());
+ sp_repr_set_svg_double(view, "inkscape:cx", r.midpoint()[Geom::X]);
+ sp_repr_set_svg_double(view, "inkscape:cy", r.midpoint()[Geom::Y]);
+ }
if (save_geometry_in_file) {
gint w, h, x, y;