]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Implementation of method IsLess() for subOwners
authorabd <abd@opencascade.com>
Mon, 11 Sep 2006 11:21:45 +0000 (11:21 +0000)
committerabd <abd@opencascade.com>
Mon, 11 Sep 2006 11:21:45 +0000 (11:21 +0000)
src/LightApp/LightApp_DataSubOwner.cxx
src/LightApp/LightApp_DataSubOwner.h

index aaf1d3613ab45707fb33cf6ce8e211b0bf98e565..80c7d13a39690578a8f54f5af3645982426b7399 100644 (file)
@@ -46,6 +46,16 @@ bool LightApp_DataSubOwner::isEqual( const SUIT_DataOwner& obj ) const
   return false;
 }
 
+/*!Checks: Is current data sub owner less \a obj.*/
+bool LightApp_DataSubOwner::isLess( const SUIT_DataOwner& obj ) const
+{
+  const LightApp_DataSubOwner* other = dynamic_cast<const LightApp_DataSubOwner*>( &obj );
+  if(other && entry() == other->entry()){
+         return index() < other->index();
+  }
+  return other && entry() < other->entry();
+}
+
 /*!Gets index.*/
 int LightApp_DataSubOwner::index() const
 {
index 0bd219c4287c5966c48155fa469891d0acf94545..9b21d18a8d8fd7d359891035d3fe92535943a4b1 100644 (file)
@@ -33,6 +33,7 @@ public:
     virtual ~LightApp_DataSubOwner();
 
     virtual bool isEqual( const SUIT_DataOwner& ) const;
+    virtual bool isLess( const SUIT_DataOwner& obj ) const;
     int          index() const;
 
 private: