From: stv Date: Tue, 29 Aug 2006 11:45:02 +0000 (+0000) Subject: Comparing method isLess() was added. X-Git-Tag: LAST_STABLE_VERSION_21_09_2006_ON_3_2_0~22 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=cb65a9e268fc76120650ea11f4e653ffae322774;p=modules%2Fgui.git Comparing method isLess() was added. --- diff --git a/src/LightApp/LightApp_DataOwner.cxx b/src/LightApp/LightApp_DataOwner.cxx index dea72f88c..979140ad7 100644 --- a/src/LightApp/LightApp_DataOwner.cxx +++ b/src/LightApp/LightApp_DataOwner.cxx @@ -31,42 +31,41 @@ #include /*!Constructor. Initialize by \a theEntry.*/ -LightApp_DataOwner -::LightApp_DataOwner( const QString& theEntry ): - myEntry( theEntry ) +LightApp_DataOwner::LightApp_DataOwner( const QString& theEntry ) +: myEntry( theEntry ) +{ +} + +LightApp_DataOwner::LightApp_DataOwner( const LightApp_DataObject* obj ) +: myEntry( obj ? obj->entry() : QString::null ) { } #ifndef DISABLE_SALOMEOBJECT /*!Constructor. Initialize by \a SALOME_InteractiveObject.*/ -LightApp_DataOwner -::LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ): - myEntry(!theIO.IsNull()? theIO->getEntry(): ""), - myIO(theIO) +LightApp_DataOwner::LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ) +: myEntry( !theIO.IsNull() ? theIO->getEntry() : "" ), +myIO( theIO ) { } #endif /*!Destructor. Do nothing.*/ -LightApp_DataOwner -::~LightApp_DataOwner() +LightApp_DataOwner::~LightApp_DataOwner() { } /*!Checks: Is current data owner equal \a obj.*/ -bool -LightApp_DataOwner -::isEqual( const SUIT_DataOwner& obj ) const +bool LightApp_DataOwner::isEqual( const SUIT_DataOwner& obj ) const { const LightApp_DataOwner* other = dynamic_cast( &obj ); - return other && entry() == other->entry(); } -bool LightApp_DataOwner::operator<( const SUIT_DataOwner& obj ) const +bool LightApp_DataOwner::isLess( const SUIT_DataOwner& obj ) const { const LightApp_DataOwner* other = dynamic_cast( &obj ); - return entry() < other->entry(); + return other && entry() < other->entry(); } /*!Gets entry.*/ diff --git a/src/LightApp/LightApp_DataOwner.h b/src/LightApp/LightApp_DataOwner.h index 7fd43eedc..f2e9a848b 100644 --- a/src/LightApp/LightApp_DataOwner.h +++ b/src/LightApp/LightApp_DataOwner.h @@ -21,12 +21,14 @@ #define LIGHTAPP_DATAOWNER_H #include "LightApp.h" -#include "SUIT_DataOwner.h" +#include #ifndef DISABLE_SALOMEOBJECT #include "SALOME_InteractiveObject.hxx" #endif +class LightApp_DataObject; + /*! This class provide data owner objects. */ @@ -36,11 +38,12 @@ public: #ifndef DISABLE_SALOMEOBJECT LightApp_DataOwner( const Handle(SALOME_InteractiveObject)& theIO ); #endif + LightApp_DataOwner( const LightApp_DataObject* ); LightApp_DataOwner( const QString& ); virtual ~LightApp_DataOwner(); virtual bool isEqual( const SUIT_DataOwner& ) const; - virtual bool operator<( const SUIT_DataOwner& ) const; + virtual bool isLess( const SUIT_DataOwner& ) const; #ifndef DISABLE_SALOMEOBJECT const Handle(SALOME_InteractiveObject)& IO() const;