diff options
| author | Johan B. C. Engelen <jbc.engelen@swissonline.ch> | 2008-01-02 13:56:43 +0000 |
|---|---|---|
| committer | johanengelen <johanengelen@users.sourceforge.net> | 2008-01-02 13:56:43 +0000 |
| commit | fd273d07a8172ffdb13ef2145a96d0119004515d (patch) | |
| tree | 08f167554629f290dccaf214dc35739d92e765e4 /src/ui/dialog/document-properties.cpp | |
| parent | * [INTL: it] Translation update for win32 installer (diff) | |
| download | inkscape-fd273d07a8172ffdb13ef2145a96d0119004515d.tar.gz inkscape-fd273d07a8172ffdb13ef2145a96d0119004515d.zip | |
Fix LP #179741
(bzr r4363)
Diffstat (limited to 'src/ui/dialog/document-properties.cpp')
| -rw-r--r-- | src/ui/dialog/document-properties.cpp | 12 |
1 files 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 } |
