From 491179a61b44b0c5037d2ef8815597cbde094c02 Mon Sep 17 00:00:00 2001 From: johanengelen Date: Wed, 2 Jan 2008 13:56:43 +0000 Subject: [PATCH] Fix LP #179741 --- src/ui/dialog/document-properties.cpp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index d60f1f7ec..a3e0fdfbc 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -647,19 +647,13 @@ DocumentProperties::onRemoveGrid() if (pagenum == -1) // no pages return; - Gtk::Widget *page = _grids_notebook.get_nth_page(pagenum); - if (!page) return; - - Glib::ustring tabtext = _grids_notebook.get_tab_label_text(*page); - - // find the grid with name tabtext (it's id) and delete that one. SPDesktop *dt = getDesktop(); SPNamedView *nv = sp_desktop_namedview(dt); Inkscape::CanvasGrid * found_grid = NULL; - for (GSList const * l = nv->grids; l != NULL; l = l->next) { + int i = 0; + for (GSList const * l = nv->grids; l != NULL; l = l->next, i++) { // not a very nice fix, but works. Inkscape::CanvasGrid * grid = (Inkscape::CanvasGrid*) l->data; - gchar const *idtext = grid->repr->attribute("id"); - if ( !strcmp(tabtext.c_str(), idtext) ) { + if (pagenum == i) { found_grid = grid; break; // break out of for-loop } -- 2.30.2