From: tweenk Date: Wed, 17 Sep 2008 14:29:50 +0000 (+0000) Subject: Fix minor breakage in grid preferences caused by pref refactoring. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=98c0319217073f719e06d9944dccb037d849b159;p=inkscape.git Fix minor breakage in grid preferences caused by pref refactoring. --- diff --git a/src/display/canvas-axonomgrid.cpp b/src/display/canvas-axonomgrid.cpp index 7aecfb0b5..df402831e 100644 --- a/src/display/canvas-axonomgrid.cpp +++ b/src/display/canvas-axonomgrid.cpp @@ -298,6 +298,7 @@ static gboolean sp_nv_read_opacity(gchar const *str, guint32 *color) void CanvasAxonomGrid::readRepr() { + /// @todo Replace direct XML preference node manipulation with calls to public prefs API gchar const *value; if ( (value = repr->attribute("originx")) ) { sp_nv_read_length(value, SP_UNIT_ABSOLUTE | SP_UNIT_DEVICE, &origin[NR::X], &gridunit); @@ -350,12 +351,12 @@ CanvasAxonomGrid::readRepr() } if ( (value = repr->attribute("visible")) ) { - visible = (strcmp(value,"true") == 0); + visible = (strcmp(value,"false") != 0 && strcmp(value, "0") != 0); } if ( (value = repr->attribute("enabled")) ) { g_assert(snapper != NULL); - snapper->setEnabled(strcmp(value,"true") == 0); + snapper->setEnabled(strcmp(value,"false") != 0 && strcmp(value, "0") != 0); } for (GSList *l = canvasitems; l != NULL; l = l->next) { diff --git a/src/display/canvas-grid.cpp b/src/display/canvas-grid.cpp index 27f7030e4..948b89e6a 100644 --- a/src/display/canvas-grid.cpp +++ b/src/display/canvas-grid.cpp @@ -614,16 +614,16 @@ CanvasXYGrid::readRepr() } if ( (value = repr->attribute("dotted")) ) { - render_dotted = (strcmp(value,"true") == 0); + render_dotted = (strcmp(value,"false") != 0 && strcmp(value, "0") != 0); } if ( (value = repr->attribute("visible")) ) { - visible = (strcmp(value,"true") == 0); + visible = (strcmp(value,"false") != 0 && strcmp(value, "0") != 0); } if ( (value = repr->attribute("enabled")) ) { g_assert(snapper != NULL); - snapper->setEnabled(strcmp(value,"true") == 0); + snapper->setEnabled(strcmp(value,"false") != 0 && strcmp(value, "0") != 0); } for (GSList *l = canvasitems; l != NULL; l = l->next) {