From: abd Date: Mon, 11 Sep 2006 11:21:45 +0000 (+0000) Subject: Implementation of method IsLess() for subOwners X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~4 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=2e7dc00d7799308b34855a176a019cb81463f7d2;p=modules%2Fgui.git Implementation of method IsLess() for subOwners --- diff --git a/src/LightApp/LightApp_DataSubOwner.cxx b/src/LightApp/LightApp_DataSubOwner.cxx index aaf1d3613..80c7d13a3 100644 --- a/src/LightApp/LightApp_DataSubOwner.cxx +++ b/src/LightApp/LightApp_DataSubOwner.cxx @@ -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( &obj ); + if(other && entry() == other->entry()){ + return index() < other->index(); + } + return other && entry() < other->entry(); +} + /*!Gets index.*/ int LightApp_DataSubOwner::index() const { diff --git a/src/LightApp/LightApp_DataSubOwner.h b/src/LightApp/LightApp_DataSubOwner.h index 0bd219c42..9b21d18a8 100644 --- a/src/LightApp/LightApp_DataSubOwner.h +++ b/src/LightApp/LightApp_DataSubOwner.h @@ -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: