From e1843e15d406c127eb201694fe9a10239eb3a75c Mon Sep 17 00:00:00 2001 From: david Date: Fri, 8 Feb 2002 13:31:22 +0000 Subject: [PATCH] Patch from Melchior Franz: - add indices to ambiguous property names --- src/GUI/prop_picker.cxx | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/GUI/prop_picker.cxx b/src/GUI/prop_picker.cxx index e38342fd7..59674c36d 100755 --- a/src/GUI/prop_picker.cxx +++ b/src/GUI/prop_picker.cxx @@ -470,20 +470,18 @@ void fgPropPicker::find_props () for (i = 0; i < (int)node->nChildren(); i++) { SGPropertyNode * child = node->getChild(i); name = child->getName(); + if ( node->getChild(name, 1) != 0 ) { + iindex = child->getIndex(); + sprintf(sindex, "[%d]", iindex); + name += sindex; + } line = name; names[ pi ] = new char[ strlen(line.c_str())+2 ] ; strcpy ( names [ pi ], line.c_str() ) ; if ( child->nChildren() > 0 ) { - iindex = child->getIndex(); - sprintf(sindex, "%d", iindex); dflag[ pi ] = 1 ; files[ pi ] = new char[ strlen(line.c_str())+strlen(sindex)+4 ] ; strcpy ( files [ pi ], line.c_str() ) ; - if ( node->getChild(name, 1) != 0 ) { - strcat ( files [ pi ], "[" ) ; - strcat ( files [ pi ], sindex ) ; - strcat ( files [ pi ], "]" ) ; - } strcat ( files [ pi ], "/" ) ; values[ pi ] = new char[ 2 ] ; } else {