]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Join modifications from branch BR_For_OCT_611: migration to OCCT6.1.1 with new except... V3_2_2pre
authorjfa <jfa@opencascade.com>
Mon, 4 Sep 2006 11:30:42 +0000 (11:30 +0000)
committerjfa <jfa@opencascade.com>
Mon, 4 Sep 2006 11:30:42 +0000 (11:30 +0000)
src/CAF/CAF_Study.cxx
src/DDS/DDS_Dictionary.cxx
src/SUITApp/SUITApp_Application.cxx
src/SalomeApp/SalomeApp_ExceptionHandler.cxx
src/Session/Makefile.in
src/Session/SALOME_Session_Server.cxx

index 7acc291dc08eb735a5803efdddd9239cd095d494..79d0da098ad6a9a674bf5a92f20ca7039e4de232 100755 (executable)
@@ -31,6 +31,7 @@
 #include <TDF_Delta.hxx>
 #include <TDF_ListIteratorOfDeltaList.hxx>
 
+#include <Standard_Failure.hxx>
 #include <Standard_ErrorHandler.hxx>
 
 /*!
@@ -87,8 +88,11 @@ void CAF_Study::createDocument()
   if ( app && !app->stdApp().IsNull() )
   {
     try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+      OCC_CATCH_SIGNALS;
+#endif
       TColStd_SequenceOfExtendedString formats;
-           app->stdApp()->Formats( formats );
+      app->stdApp()->Formats( formats );
       if ( !formats.IsEmpty() )
         app->stdApp()->NewDocument( formats.First(), myStdDoc );
     }
@@ -121,6 +125,9 @@ bool CAF_Study::openDocument( const QString& fname )
 
   bool status = false;
   try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+    OCC_CATCH_SIGNALS;
+#endif
     status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == CDF_RS_OK;
   }
   catch ( Standard_Failure ) {
@@ -149,6 +156,9 @@ bool CAF_Study::saveDocumentAs( const QString& fname )
 
   bool status = false;
   try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+    OCC_CATCH_SIGNALS;
+#endif
     if ( save )
       status = app->Save( stdDoc() ) == CDF_SS_OK;
     else
@@ -185,6 +195,9 @@ bool CAF_Study::openTransaction()
 
   bool res = true;
   try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+    OCC_CATCH_SIGNALS;
+#endif
     if ( myStdDoc->HasOpenCommand() )
       myStdDoc->AbortCommand();
 
@@ -207,8 +220,11 @@ bool CAF_Study::abortTransaction()
 
   bool res = true;
   try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+    OCC_CATCH_SIGNALS;
+#endif
     myStdDoc->AbortCommand();
-               update();
+    update();
   }
   catch ( Standard_Failure ) {
     res = false;
@@ -226,12 +242,15 @@ bool CAF_Study::commitTransaction( const QString& name )
 
   bool res = true;
   try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+    OCC_CATCH_SIGNALS;
+#endif
     myStdDoc->CommitCommand();
 
     if ( canUndo() )
     {
       Handle(TDF_Delta) d = myStdDoc->GetUndos().Last();
-                       if ( !d.IsNull() )
+      if ( !d.IsNull() )
         d->SetName( CAF_Tools::toExtString( name ) );
     }
   }
@@ -313,18 +332,21 @@ void CAF_Study::clearModified()
 */
 bool CAF_Study::undo()
 {
-       if ( myStdDoc.IsNull() )
+  if ( myStdDoc.IsNull() )
     return false;
 
   try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+    OCC_CATCH_SIGNALS;
+#endif
     myStdDoc->Undo();
     undoModified();     /* decrement modification counter */
   }
   catch ( Standard_Failure ) {
-               SUIT_MessageBox::error1( application()->desktop(), tr( "ERR_ERROR" ),
-                             tr( "ERR_DOC_UNDO" ), tr ( "BUT_OK" ) );
-               return false;
-       }
+    SUIT_MessageBox::error1(application()->desktop(), tr( "ERR_ERROR" ),
+                            tr( "ERR_DOC_UNDO" ), tr ( "BUT_OK" ));
+    return false;
+  }
   return true;
 }
 
@@ -333,10 +355,13 @@ bool CAF_Study::undo()
 */
 bool CAF_Study::redo()
 {
-       if ( myStdDoc.IsNull() )
+  if ( myStdDoc.IsNull() )
     return false;
 
   try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+    OCC_CATCH_SIGNALS;
+#endif
     myStdDoc->Redo();
     doModified();      /* increment modification counter */
   }
index adaff0469fd5df62b17e7ebabf10ba7a5708cd4e..4fb61b601263f145c4fe74f47083289b50b01de0 100644 (file)
@@ -221,6 +221,9 @@ Standard_Real DDS_Dictionary::ToSI( const Standard_Real theValue, const Standard
   if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
   {
     try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+      OCC_CATCH_SIGNALS;
+#endif
       aRetValue = UnitsAPI::AnyToSI( theValue, theUnits );
     }
     catch( Standard_Failure ) {
@@ -238,6 +241,9 @@ Standard_Real DDS_Dictionary::FromSI( const Standard_Real theValue, const Standa
   if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
   {
     try {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+      OCC_CATCH_SIGNALS;
+#endif
       aRetValue = UnitsAPI::AnyFromSI( theValue, theUnits );
     }
     catch( Standard_Failure ) {
index af2badc6b0772c30e25933d0b7d3009360461f23..bf32979dea0b74650c171d9529389c82b1573c04 100644 (file)
@@ -69,6 +69,7 @@ myExceptHandler( hand )
 */
 bool SUITApp_Application::notify( QObject* receiver, QEvent* e )
 {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) < 0x060101
   // Disable GUI user actions while python command is executed
   if (SUIT_Session::IsPythonExecuted()) {
     // Disable mouse and keyboard events
@@ -80,6 +81,7 @@ bool SUITApp_Application::notify( QObject* receiver, QEvent* e )
         aType == QEvent::Accel || aType == QEvent::AccelOverride)
       return false;
   }
+#endif
 
   return myExceptHandler ? myExceptHandler->handle( receiver, e ) :
                            QApplication::notify( receiver, e );
index b22ab38d891f028ec1be56cac29ddda38f89e092..81cd56b04a168ade05cfac6ce3a7febb5411d03b 100644 (file)
@@ -17,7 +17,6 @@
 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "SalomeApp_ExceptionHandler.h"
-#include "CASCatch.hxx"
 
 #include <OSD.hxx>
 
 
 #include <qstring.h>
 
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+  #include <Standard_ErrorHandler.hxx>
+  #include <Standard_Failure.hxx>
+#else
+  #include "CASCatch.hxx"
+#endif
+
 /*!Constructor. Initialize by \a floatSignal.*/
 SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
 : SUIT_ExceptionHandler()
@@ -36,14 +42,23 @@ SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
 /*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/
 bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e )
 {
-  CASCatch_TRY {   
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+  try {
+    OCC_CATCH_SIGNALS;
+#else
+  CASCatch_TRY {
+#endif
     SUIT_ExceptionHandler::internalHandle( o, e );
   }
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) > 0x060100
+  catch(Standard_Failure) {
+#else
   CASCatch_CATCH(Standard_Failure) {
-    Handle(Standard_Failure) aFail = Standard_Failure::Caught();          
+#endif
+    Handle(Standard_Failure) aFail = Standard_Failure::Caught();
     throw Standard_Failure( aFail->GetMessageString() );
   }
-  
+
   return true;
 }
 
index 6379a13956b7653d9e79eadee29b49a87c7b3b87..a02da34946411e2336150594d7deae190af65832 100755 (executable)
@@ -59,7 +59,7 @@ LIB_SERVER_IDL = SALOME_Session.idl SalomeApp_Engine.idl
 BIN_SERVER_IDL = 
 BIN_CLIENT_IDL = SALOMEDS.idl SALOMEDS_Attributes.idl SALOME_Component.idl SALOME_Registry.idl SALOME_ModuleCatalog.idl SALOME_Exception.idl SALOME_GenericObj.idl
 
-CPPFLAGS += $(QT_MT_INCLUDES) $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) $(KERNEL_CXXFLAGS) -I$(OCC_INCLUDES)
+CPPFLAGS += $(QT_MT_INCLUDES) $(PYTHON_INCLUDES) $(HDF5_INCLUDES) $(BOOST_CPPFLAGS) $(KERNEL_CXXFLAGS) $(OCC_INCLUDES)
 CXXFLAGS += $(OCC_CXXFLAGS) $(BOOST_CPPFLAGS)
 LDFLAGS += $(QT_MT_LIBS) $(KERNEL_LDFLAGS) -lSalomeNS -lsuit -lSalomeLifeCycleCORBA -lOpUtil -lSALOMELocalTrace -lwith_loggerTraceCollector -lEvent -lSalomeCatalog -lSalomeDSClient $(CAS_KERNEL)
 
index 4aec7c8edf8251f090e2e2ec0babb5102a4a4d68..1a9987a544330f18f576f83a8cc8cecd9ed7801f 100755 (executable)
@@ -247,6 +247,7 @@ public:
 
   virtual bool notify( QObject* receiver, QEvent* e )
   {
+#if (OCC_VERSION_MAJOR << 16 | OCC_VERSION_MINOR << 8 | OCC_VERSION_MAINTENANCE) < 0x060101
     // Disable GUI user actions while python command is executed
     if (SUIT_Session::IsPythonExecuted()) {
       // Disable mouse and keyboard events
@@ -258,6 +259,7 @@ public:
           aType == QEvent::Accel || aType == QEvent::AccelOverride)
         return false;
     }
+#endif
 
     return myHandler ? myHandler->handle( receiver, e ) :
       QApplication::notify( receiver, e );