Code

patch 1750206 by Bruno Dilly - bdilly
[inkscape.git] / src / ui / dialog / document-properties.cpp
index 4bf4db48aaa910406828c1ba750099b881015062..0817b06aba7418c8e5cb774cf6fcf2ed1fdd5f4c 100644 (file)
@@ -370,11 +370,11 @@ DocumentProperties::build_gridspage()
         label_crea, 0,
         label_crea_type, (Gtk::Widget*) &_grids_combo_gridtype,
         (Gtk::Widget*) &_grids_button_new,         (Gtk::Widget*) &_grids_button_remove, 
-        label_def,         0,
-        (Gtk::Widget*) &_grids_notebook, 0
+        label_def,         0
     };
-
     attach_all(_page_grids.table(), widget_array, G_N_ELEMENTS(widget_array));
+    _page_grids.table().attach(_grids_notebook, 0, 3, 4, 5,
+                              Gtk::FILL|Gtk::EXPAND, (Gtk::AttachOptions)0,0,0);
 }
 
 
@@ -529,10 +529,12 @@ on_doc_replaced (SPDesktop* dt, SPDocument* doc)
 void
 DocumentProperties::onNewGrid()
 {
-    Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(SP_ACTIVE_DESKTOP));
+    SPDesktop *dt = SP_ACTIVE_DESKTOP;
+    Inkscape::XML::Node *repr = SP_OBJECT_REPR(sp_desktop_namedview(dt));
+    SPDocument *doc = sp_desktop_document(dt);
 
     Glib::ustring typestring = _grids_combo_gridtype.get_active_text();
-    CanvasGrid::writeNewGridToRepr(repr, CanvasGrid::getGridTypeFromName(typestring.c_str()));
+    CanvasGrid::writeNewGridToRepr(repr, doc, CanvasGrid::getGridTypeFromName(typestring.c_str()));
 }
 
 
@@ -564,7 +566,7 @@ DocumentProperties::onRemoveGrid()
         // delete the grid that corresponds with the selected tab
         // when the grid is deleted from SVG, the SPNamedview handler automatically deletes the object, so found_grid becomes an invalid pointer!
         found_grid->repr->parent()->removeChild(found_grid->repr);
-       sp_document_done(sp_desktop_document(dt), SP_VERB_DIALOG_NAMEDVIEW, _("Remove grid"));
+        sp_document_done(sp_desktop_document(dt), SP_VERB_DIALOG_NAMEDVIEW, _("Remove grid"));
     }
 }