Salome HOME
Fix for problem: broken reference objects after delete originals.
authormzn <mzn@opencascade.com>
Fri, 26 Aug 2005 08:10:26 +0000 (08:10 +0000)
committermzn <mzn@opencascade.com>
Fri, 26 Aug 2005 08:10:26 +0000 (08:10 +0000)
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_DataObject.cxx

index 1dcf08d2234d6660ace57a9e345f86afa0001b03..fa0d6a15604998eeb637f6b67de4fcf700d15cdd 100644 (file)
@@ -1993,7 +1993,7 @@ void SalomeApp_Application::contextMenuPopup( const QString& type, QPopupMenu* t
          if ( it.Value()->hasEntry() )
            {
              _PTR(SObject) aSObject = aStudyDS->FindObjectID( it.Value()->getEntry() );
-             if ( aSObject->ReferencedObject(anObj) == false || !QString(anObj->GetIOR().c_str()).isEmpty() )
+             if ( aSObject->ReferencedObject(anObj) == false || !QString(anObj->GetName()).isEmpty() )
                isInvalidRefs = false;
            }
        }
index d04114d3e60a6fffcd1cf083f7d275f7d2904d37..63f39cc615f6c9ae87d3266998185a538564da3a 100644 (file)
@@ -114,7 +114,7 @@ QString SalomeApp_DataObject::name() const
 
   if ( isReference() )
     {
-      if ( !(text(CT_IOR).isEmpty()) )
+      if ( !(QString(referencedObject()->GetName()).isEmpty()) )
        str = QString( "* " ) + str;
       else
        str = QString( "<Invalid Reference>" );
@@ -187,7 +187,7 @@ QColor SalomeApp_DataObject::color( const ColorRole cr ) const
   case Text:
     if ( isReference() )
       {
-       if ( !(text(CT_IOR).isEmpty()) )
+       if ( !(QString(referencedObject()->GetName()).isEmpty()) )
          clr = QColor( 255, 0, 0 );
        else
          clr = QColor( 200, 200, 200 );
@@ -205,7 +205,7 @@ QColor SalomeApp_DataObject::color( const ColorRole cr ) const
   case Highlight:
     if ( isReference() )
       {
-       if ( !(text(CT_IOR).isEmpty()) )
+       if ( !(QString(referencedObject()->GetName()).isEmpty()) )
          clr = QColor( 255, 0, 0 );
        else
          clr = QColor( 200, 200, 200 );