From 5e509b7593f9d62024f6122ecba1322b697675e1 Mon Sep 17 00:00:00 2001 From: mkr Date: Fri, 20 Nov 2015 11:53:53 +0300 Subject: [PATCH] refs #610: correct processing of open new document, when create calculation case operation is started. --- src/HYDROGUI/HYDROGUI_LandCoverMapOp.cxx | 5 ++++- src/HYDROGUI/HYDROGUI_Module.cxx | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) 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 ) { -- 2.39.2