From d88b1bb9966a55a62660d65b0b2ef76d79c45332 Mon Sep 17 00:00:00 2001 From: ouv Date: Wed, 16 Dec 2009 09:26:11 +0000 Subject: [PATCH] Debug --- src/SalomeApp/SalomeApp_DataObject.cxx | 31 ++++--------------------- src/SalomeApp/SalomeApp_NoteBookDlg.cxx | 4 +--- src/SalomeApp/SalomeApp_Notebook.cxx | 5 ++++ src/SalomeApp/SalomeApp_Notebook.h | 1 + 4 files changed, 11 insertions(+), 30 deletions(-) diff --git a/src/SalomeApp/SalomeApp_DataObject.cxx b/src/SalomeApp/SalomeApp_DataObject.cxx index 7b31a375b..2a198fb17 100644 --- a/src/SalomeApp/SalomeApp_DataObject.cxx +++ b/src/SalomeApp/SalomeApp_DataObject.cxx @@ -483,44 +483,21 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const { _PTR(AttributeString) strAttr = attr; std::string str = strAttr->Value(); - QString aStrings = QString( str.c_str() ); + val = QString( str.c_str() ); // Special case to show NoteBook variables in the "Value" column of the OB - if( aStrings.contains( ":" ) ) // old format ('var1::var2|var1') + if( val.contains( ":" ) ) // old format ('var1::var2|var1') { if ( LightApp_RootObject* aRoot = dynamic_cast( root() ) ) { 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; + QStringList aList = aNb.getAttributeParameters( val ); + val = aList.join( ", " ); } } } - else // new format ('var1, var2') or single variable in old format - val = aStrings; } else if ( obj->FindAttribute( attr, "AttributeInteger" ) ) { diff --git a/src/SalomeApp/SalomeApp_NoteBookDlg.cxx b/src/SalomeApp/SalomeApp_NoteBookDlg.cxx index 7ef27d96c..f42aa8ac6 100644 --- a/src/SalomeApp/SalomeApp_NoteBookDlg.cxx +++ b/src/SalomeApp/SalomeApp_NoteBookDlg.cxx @@ -713,8 +713,6 @@ void NoteBook_Table::processItemChanged( NoteBook_TableRow* theRow, int theColum QString anExpressionPrevious = aVariable.Expression; bool isCompletePrevious = !aVariable.Name.isEmpty() && !aVariable.Expression.isEmpty(); - bool isCorrectPrevious = checkRow( theRow ); - QString aName = theRow->getVariable(); QString anExpression = theRow->getExpression(); bool isComplete = !aName.isEmpty() && !anExpression.isEmpty(); @@ -722,7 +720,7 @@ void NoteBook_Table::processItemChanged( NoteBook_TableRow* theRow, int theColum aVariable.Name = aName; aVariable.Expression = anExpression; - if( theColumn == VARIABLE_COLUMN && isCompletePrevious /*&& isCorrectPrevious*/ && aName != aNamePrevious ) + if( theColumn == VARIABLE_COLUMN && isCompletePrevious && aName != aNamePrevious ) { if( !renameVariable( aNamePrevious, aName ) ) { diff --git a/src/SalomeApp/SalomeApp_Notebook.cxx b/src/SalomeApp/SalomeApp_Notebook.cxx index 89356ca8b..1470e362a 100644 --- a/src/SalomeApp/SalomeApp_Notebook.cxx +++ b/src/SalomeApp/SalomeApp_Notebook.cxx @@ -292,6 +292,11 @@ QStringList SalomeApp_Notebook::getParameters( const QString& theParamName ) con return convert( myNotebook->GetParameters( theParamName.toLatin1().constData() ) ); } +QStringList SalomeApp_Notebook::getAttributeParameters( const QString& theStringAttribute ) const +{ + return convert( myNotebook->GetAttributeParameters( theStringAttribute.toLatin1().constData() ) ); +} + void SalomeApp_Notebook::setRecentValues( const QMap& theRecentValues ) { myRecentValues = theRecentValues; diff --git a/src/SalomeApp/SalomeApp_Notebook.h b/src/SalomeApp/SalomeApp_Notebook.h index 01301dc2c..0817f6b90 100644 --- a/src/SalomeApp/SalomeApp_Notebook.h +++ b/src/SalomeApp/SalomeApp_Notebook.h @@ -73,6 +73,7 @@ public: QStringList getObjectParameters( const QString& theComponent, const QString& theEntry ) const; QStringList getParameters( const QString& theParamName ) const; + QStringList getAttributeParameters( const QString& theStringAttribute ) const; void setRecentValues( const QMap& theRecentValues ); -- 2.39.2