From aa07400080540499a1d52434a3541877ecf07b76 Mon Sep 17 00:00:00 2001 From: adv Date: Fri, 21 Mar 2014 06:46:13 +0000 Subject: [PATCH] Transaction mechanism corrected. --- src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx | 24 ++++++++++++++------ 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx b/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx index 50eb1cad..d7b389e6 100644 --- a/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx +++ b/src/HYDROGUI/HYDROGUI_GeoreferencementOp.cxx @@ -152,12 +152,23 @@ void HYDROGUI_GeoreferencementOp::onModeActivated( const int theActualMode ) SUIT_MessageBox::Yes) == SUIT_MessageBox::Yes; } // Store modifications if needed - if ( isToStore && !store( anErrorMsg ) ) { - anErrorMsg.append( "\n" + tr( "INPUT_VALID_DATA" ) ); - SUIT_MessageBox::critical( module()->getApp()->desktop(), - tr( "INSUFFICIENT_INPUT_DATA" ), - anErrorMsg ); - return; + if ( isToStore ) + { + startDocOperation(); + if ( !store( anErrorMsg ) ) + { + abortDocOperation(); + + anErrorMsg.append( "\n" + tr( "INPUT_VALID_DATA" ) ); + SUIT_MessageBox::critical( module()->getApp()->desktop(), + tr( "INSUFFICIENT_INPUT_DATA" ), + anErrorMsg ); + return; + } + else + { + commitDocOperation(); + } } aPanel->setMode( theActualMode ); @@ -250,7 +261,6 @@ bool HYDROGUI_GeoreferencementOp::store( QString& theErrorMsg ) } aModule->update( UF_Model | UF_OCCViewer | UF_OCC_Forced ); - commitDocOperation(); // TODO: analyze the consequences return true; } -- 2.39.2