From: apo Date: Thu, 30 Nov 2006 13:45:27 +0000 (+0000) Subject: To check ColoredPrs3dHolder on _non_existent before its handling X-Git-Tag: WP1_2_3_05-12-2006_cache_system~20 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=0ca7e1648d54237e42da4eb61737a5f31ad913cc;p=modules%2Fvisu.git To check ColoredPrs3dHolder on _non_existent before its handling --- diff --git a/src/VISUGUI/VisuGUI_Slider.cxx b/src/VISUGUI/VisuGUI_Slider.cxx index 32e1f3e8..068783ea 100644 --- a/src/VISUGUI/VisuGUI_Slider.cxx +++ b/src/VISUGUI/VisuGUI_Slider.cxx @@ -229,12 +229,26 @@ VisuGUI_Slider::~VisuGUI_Slider() { } +bool VisuGUI_Slider::checkHolderList() +{ + THolderList aHolderList; + THolderList::const_iterator anIter = myHolderList.begin(); + THolderList::const_iterator anIterEnd = myHolderList.end(); + for(; anIter != anIterEnd; anIter++){ + VISU::ColoredPrs3dHolder_var aHolder = *anIter; + if(!aHolder->_non_existent()) + aHolderList.push_back(aHolder); + } + myHolderList.swap(aHolderList); + return myHolderList.empty(); +} + void VisuGUI_Slider::enableControls( bool on ) { widget()->setEnabled( on ); if( on ) { - if( myHolderList.empty() ) + if( checkHolderList() ) return; myTimeStampStrings->clear(); @@ -288,7 +302,7 @@ void VisuGUI_Slider::enableControls( bool on ) void VisuGUI_Slider::updateMemoryState() { - if( myHolderList.empty() ) + if( checkHolderList() ) return; VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front(); @@ -337,7 +351,7 @@ void VisuGUI_Slider::onSelectionChanged() } } - enableControls( !myHolderList.empty() ); + enableControls( !checkHolderList() ); updateMemoryState(); } @@ -396,8 +410,10 @@ void VisuGUI_Slider::onLast() void VisuGUI_Slider::onValueChanged( int value ) { - if( myHolderList.empty() ) + if( checkHolderList() ){ + enableControls( false ); return; + } VISU::ColoredPrs3dHolder_var aHolder = myHolderList.front(); diff --git a/src/VISUGUI/VisuGUI_Slider.h b/src/VISUGUI/VisuGUI_Slider.h index a15037c1..652236ea 100644 --- a/src/VISUGUI/VisuGUI_Slider.h +++ b/src/VISUGUI/VisuGUI_Slider.h @@ -85,6 +85,7 @@ public slots: protected: virtual void enableControls( bool ); virtual void updateMemoryState(); + virtual bool checkHolderList(); private: VisuGUI_Module* myModule;