From 4c2f5ce59e24d96fe9e510b7eb8c62627573c606 Mon Sep 17 00:00:00 2001 From: andy Date: Sat, 15 May 2004 21:41:42 +0000 Subject: [PATCH] Don't set values on "live" text objects to prevent confusion when a dialog-apply happens. --- src/GUI/dialog.cxx | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/GUI/dialog.cxx b/src/GUI/dialog.cxx index 06d5e0a71..6320cae28 100644 --- a/src/GUI/dialog.cxx +++ b/src/GUI/dialog.cxx @@ -93,6 +93,13 @@ action_callback (puObject * object) static void copy_to_pui (SGPropertyNode * node, puObject * object) { + // Treat puText objects specially, so their "values" can be set + // from properties. + if(object->getType() & PUCLASS_TEXT) { + object->setLabel(node->getStringValue()); + return; + } + switch (node->getType()) { case SGPropertyNode::BOOL: case SGPropertyNode::INT: @@ -107,17 +114,16 @@ copy_to_pui (SGPropertyNode * node, puObject * object) object->setValue(node->getStringValue()); break; } - - // Treat puText objects specially, so their "values" can be set - // from properties. - if(object->getType() & PUCLASS_TEXT) - object->setLabel(node->getStringValue()); } static void copy_from_pui (puObject * object, SGPropertyNode * node) { + // puText objects are immutable, so should not be copied out + if(object->getType() & PUCLASS_TEXT) + return; + switch (node->getType()) { case SGPropertyNode::BOOL: case SGPropertyNode::INT: -- 2.39.5