From 98c0319217073f719e06d9944dccb037d849b159 Mon Sep 17 00:00:00 2001 From: tweenk Date: Wed, 17 Sep 2008 14:29:50 +0000 Subject: [PATCH] Fix minor breakage in grid preferences caused by pref refactoring. --- src/display/canvas-axonomgrid.cpp | 5 +++-- src/display/canvas-grid.cpp | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) 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) { -- 2.30.2