From e3c6e89146ea3c869279e2b7a90ad9f40dd11e6e Mon Sep 17 00:00:00 2001 From: ouv Date: Thu, 10 Dec 2009 15:11:55 +0000 Subject: [PATCH] Debug --- src/SalomeApp/SalomeApp_DataObject.cxx | 61 ++++++++++++++------------ 1 file changed, 33 insertions(+), 28 deletions(-) diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index a9caeaadf..7b31a375b 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -484,38 +484,43 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const _PTR(AttributeString) strAttr = attr; std::string str = strAttr->Value(); QString aStrings = QString( str.c_str() ); - - //Special case to show NoteBook variables in the "Value" column of the OB - if ( LightApp_RootObject* aRoot = dynamic_cast( root() ) ) + + // Special case to show NoteBook variables in the "Value" column of the OB + if( aStrings.contains( ":" ) ) // old format ('var1::var2|var1') { - if ( SalomeApp_Study* aStudy = dynamic_cast( aRoot->study() ) ) + if ( LightApp_RootObject* aRoot = dynamic_cast( root() ) ) { - SalomeApp_Notebook aNb( aStudy ); - - bool ok = false; - QStringList aSectionList = aStrings.split( "|" ); - if ( !aSectionList.isEmpty() ) - { - QString aLastSection = aSectionList.last(); - QStringList aStringList = aLastSection.split( ":" ); - if ( !aStringList.isEmpty() ) - { - ok = true; - for ( int i = 0, n = aStringList.size(); i < n; i++ ) - { - QString aStr = aStringList[i]; - if ( aNb.isParameter( aStr ) ) - val.append( aStr + ", " ); - } - - if ( !val.isEmpty() ) - val.remove( val.length() - 2, 2 ); - } - } - if( !ok ) - val = aStrings; + if ( SalomeApp_Study* aStudy = dynamic_cast( aRoot->study() ) ) + { + SalomeApp_Notebook aNb( aStudy ); + + bool ok = false; + QStringList aSectionList = aStrings.split( "|" ); + if ( !aSectionList.isEmpty() ) + { + QString aLastSection = aSectionList.last(); + QStringList aStringList = aLastSection.split( ":" ); + if ( !aStringList.isEmpty() ) + { + ok = true; + for ( int i = 0, n = aStringList.size(); i < n; i++ ) + { + QString aStr = aStringList[i]; + if ( aNb.isParameter( aStr ) ) + val.append( aStr + ", " ); + } + + if ( !val.isEmpty() ) + val.remove( val.length() - 2, 2 ); + } + } + if( !ok ) + val = aStrings; + } } } + else // new format ('var1, var2') or single variable in old format + val = aStrings; } else if ( obj->FindAttribute( attr, "AttributeInteger" ) ) { -- 2.39.2