From: mkr Date: Fri, 20 Nov 2015 08:53:53 +0000 (+0300) Subject: refs #610: correct processing of open new document, when create calculation case... X-Git-Tag: v1.5~11 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5e509b7593f9d62024f6122ecba1322b697675e1;p=modules%2Fhydro.git refs #610: correct processing of open new document, when create calculation case operation is started. --- diff --git a/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx b/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx index 3f54816f..6426928f 100644 --- a/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx +++ b/src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx @@ -40,6 +40,7 @@ #include +#include #include #include #include @@ -156,7 +157,9 @@ void HYDROGUI_LandCoverMapOp::abortOperation() HYDROGUI_Operation::abortOperation(); - module()->update( UF_OCCViewer | UF_FitAll ); + SalomeApp_Study* aStudy = dynamic_cast( module()->getApp()->activeStudy() ); + if ( aStudy ) + module()->update( UF_OCCViewer | UF_FitAll ); } void HYDROGUI_LandCoverMapOp::commitOperation() diff --git a/src/HYDROGUI/HYDROGUI_Module.cxx b/src/HYDROGUI/HYDROGUI_Module.cxx index 9b1d8f3d..cd5a630b 100644 --- a/src/HYDROGUI/HYDROGUI_Module.cxx +++ b/src/HYDROGUI/HYDROGUI_Module.cxx @@ -1089,10 +1089,13 @@ void HYDROGUI_Module::setObjectVisible( const int theViewId, if ( hydroObject ) { SUIT_AbstractModel* treeModel = dynamic_cast( getApp()->objectBrowser()->model() ); - QString id = hydroObject->text( hydroObject->customData( Qtx::IdType ).toInt() ); - Qtx::VisibilityState visState = treeModel->visibilityState( id ); - if ( visState != Qtx::UnpresentableState ) + if ( treeModel ) + { + QString id = hydroObject->text( hydroObject->customData( Qtx::IdType ).toInt() ); + Qtx::VisibilityState visState = treeModel->visibilityState( id ); + if ( visState != Qtx::UnpresentableState ) treeModel->setVisibilityState( id, theState ? Qtx::ShownState : Qtx::HiddenState ); + } } if ( theObject->GetKind() == KIND_BATHYMETRY && theState ) {