Tag: cws_dev300_odbmacros3
User: fs      
Date: 2008-04-13 19:27:40+0000
Modified:
   dba/dbaccess/source/ui/app/AppController.cxx

Log:
 #i49133# re-enable scripting support

File Changes:

Directory: /dba/dbaccess/source/ui/app/
=======================================

File [changed]: AppController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppController.cxx?r1=1.56&r2=1.56.6.1
Delta lines:  +34 -41
---------------------
--- AppController.cxx   2008-03-11 08:48:04+0000        1.56
+++ AppController.cxx   2008-04-13 19:27:37+0000        1.56.6.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: AppController.cxx,v $
  *
- *  $Revision: 1.56 $
+ *  $Revision: 1.56.6.1 $
  *
- *  last change: $Author: obo $ $Date: 2008/03/11 08:48:04 $
+ *  last change: $Author: fs $ $Date: 2008/04/13 19:27:37 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -99,6 +99,9 @@
 #ifndef _CPPUHELPER_TYPEPROVIDER_HXX_
 #include <cppuhelper/typeprovider.hxx>
 #endif
+#ifndef _CPPUHELPER_EXC_HLP_HXX_
+#include <cppuhelper/exc_hlp.hxx>
+#endif
 #ifndef _CONNECTIVITY_DBTOOLS_HXX_
 #include <connectivity/dbtools.hxx>
 #endif
@@ -706,11 +709,7 @@
                 // Our document supports embedding scripts into it, if and 
only if there are no
                 // forms/reports with macros/scripts into them. So, we need to 
enable migration
                 // if and only if the database document does *not* support 
embedding scripts.
-//                bool bAvailable = !Reference< XEmbeddedScripts >( m_xModel, 
UNO_QUERY ).is();
-                // TODO: revert to the disabled code. The current version is 
just to be able
-                // to integrate an intermediate version of the CWS, which 
should behave as
-                // if no macros in DB docs are allowed
-                bool bAvailable = false;
+                bool bAvailable = !Reference< XEmbeddedScripts >( m_xModel, 
UNO_QUERY ).is();
                 aReturn.bEnabled = bAvailable;
                 if ( !bAvailable )
                     aReturn.bInvisible = true;
@@ -1597,7 +1596,7 @@
                }
                catch( Exception& )
                {
-                       OSL_ENSURE(0,"Exception catched");
+            DBG_UNHANDLED_EXCEPTION();
                }
        }
 }
@@ -1936,9 +1935,9 @@
                        }
                }
        }
-       catch(Exception&)
+       catch( const Exception& )
        {
-               OSL_ENSURE(0,"Exception catched!");
+        DBG_UNHANDLED_EXCEPTION();
        }
 }
 // 
-----------------------------------------------------------------------------
@@ -2065,9 +2064,9 @@
 
                                                        bTryAgain = sal_False;
                                                }
-                                               catch(const SQLException& e)
+                                               catch(const SQLException& )
                         {
-                                                       
showError(SQLExceptionInfo(e));
+                            showError( SQLExceptionInfo( 
::cppu::getCaughtException() ) );
 
                                                }
                                                catch(const 
ElementExistException& e)
@@ -2079,7 +2078,7 @@
                                                }
                                                catch(const Exception& )
                                                {
-                                                       OSL_ENSURE(0,"Exception 
catched!");
+                            DBG_UNHANDLED_EXCEPTION();
                                                }
                                        }
                                        else
@@ -2090,7 +2089,7 @@
        }
        catch(const Exception& )
        {
-               OSL_ENSURE(0,"Exception catched!");
+        DBG_UNHANDLED_EXCEPTION();
        }
 }
 // 
-----------------------------------------------------------------------------
@@ -2161,13 +2160,13 @@
                 break;
                }
        }
-       catch(SQLException e)
+       catch( const SQLException& )
        {
-               showError(e);
+        showError( SQLExceptionInfo( ::cppu::getCaughtException() ) );
        }
-       catch(Exception)
+       catch(const Exception& )
        {
-               OSL_ENSURE(0,"Exception catched while previewing!");
+        DBG_UNHANDLED_EXCEPTION();
        }
        
        pView->showPreview(xContent);
@@ -2257,7 +2256,7 @@
                }
                catch(const Exception& )
                {
-                       OSL_ENSURE(0,"Exception catched!");
+            DBG_UNHANDLED_EXCEPTION();
                }
        }
 
@@ -2453,11 +2452,6 @@
     // if we have forms or reports which contain macros/scripts, then show a 
warning
     // which suggests the user to migrate them to the database document
 
-    // TODO: remove the following line. The current version is just to be able
-    // to integrate an intermediate version of the CWS, which should behave as
-    // if no macros in DB docs are allowed
-    return 0L;
-/*
     Reference< XEmbeddedScripts > xDocumentScripts( m_xModel, UNO_QUERY );
     if ( xDocumentScripts.is() )
     {
@@ -2489,7 +2483,6 @@
     }
 
     return 1L;
-*/
 }
 
 // 
-----------------------------------------------------------------------------
@@ -2556,9 +2549,9 @@
                                m_ePreviewMode = 
static_cast<PreviewMode>(nValue);
                        }
                }
-               catch(Exception)
+               catch( const Exception& )
                {
-            OSL_ENSURE( false, "OApplicationController::attachModel: caught an 
exception while doing the property stuff!" );
+            DBG_UNHANDLED_EXCEPTION();
                }
        }
 
@@ -2595,9 +2588,9 @@
                        sName = getContainer()->getQualifiedName( NULL );
             OSL_ENSURE( sName.getLength(), 
"OApplicationController::newElementWithPilot: no name given!" );
                }
-               catch(Exception)
+               catch( const Exception& )
                {
-            OSL_ENSURE( 0, "OApplicationController::newElementWithPilot: 
Exception catched!" );
+            DBG_UNHANDLED_EXCEPTION();
                }
        }
     return sName;




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to