Tag: cws_src680_qiq
User: fs      
Date: 06/05/31 04:04:05

Modified:
 /dba/dbaccess/source/core/api/
  querycontainer.cxx

Log:
 #i51143# XContainerApproveListener return XVeto now, instead of throwing

File Changes:

Directory: /dba/dbaccess/source/core/api/
=========================================

File [changed]: querycontainer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/querycontainer.cxx?r1=1.23.4.4&r2=1.23.4.5
Delta lines:  +26 -9
--------------------
--- querycontainer.cxx  30 May 2006 12:55:02 -0000      1.23.4.4
+++ querycontainer.cxx  31 May 2006 11:04:02 -0000      1.23.4.5
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: querycontainer.cxx,v $
  *
- *  $Revision: 1.23.4.4 $
+ *  $Revision: 1.23.4.5 $
  *
- *  last change: $Author: fs $ $Date: 2006/05/30 12:55:02 $
+ *  last change: $Author: fs $ $Date: 2006/05/31 11:04:02 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -48,6 +48,9 @@
 #ifndef DBA_CONTAINERLISTENER_HXX
 #include "ContainerListener.hxx"
 #endif
+#ifndef DBACCESS_VETO_HXX
+#include "veto.hxx"
+#endif
 
 /** === begin UNO includes === **/
 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
@@ -86,6 +89,9 @@
 #ifndef _COMPHELPER_EXTRACT_HXX_
 #include <comphelper/extract.hxx>
 #endif
+#ifndef _CPPUHELPER_EXC_HLP_HXX_
+#include <cppuhelper/exc_hlp.hxx>
+#endif
 
 using namespace dbtools;
 using namespace ::com::sun::star::uno;
@@ -96,6 +102,7 @@
 using namespace ::com::sun::star::sdbc;
 using namespace ::com::sun::star::sdbcx;
 using namespace ::com::sun::star::container;
+using namespace ::com::sun::star::util;
 using namespace ::osl;
 using namespace ::comphelper;
 using namespace ::cppu;
@@ -146,7 +153,7 @@
        }
        decrement(m_refCount);
 
-    setElementApproval( PContainerApprove( new ObjectNameApproval( _rxConn, 
ObjectNameApproval::TypeQuery, ObjectNameApproval::WrapSQLException ) ) );
+    setElementApproval( PContainerApprove( new ObjectNameApproval( _rxConn, 
ObjectNameApproval::TypeQuery ) ) );
 }
 
 
//------------------------------------------------------------------------------
@@ -327,24 +334,34 @@
 }
 
 
//------------------------------------------------------------------------------
-void SAL_CALL OQueryContainer::approveInsertElement( const ContainerEvent& 
Event ) throw (WrappedTargetException, RuntimeException)
+Reference< XVeto > SAL_CALL OQueryContainer::approveInsertElement( const 
ContainerEvent& Event ) throw (WrappedTargetException, RuntimeException)
 {
     ::rtl::OUString sName;
     OSL_VERIFY( Event.Accessor >>= sName );
     Reference< XContent > xElement( Event.Element, UNO_QUERY_THROW );
+
+    Reference< XVeto > xReturn;
+    try
+    {
     getElementApproval()->approveElement( sName, xElement.get() );
+    }
+    catch( const Exception& )
+    {
+        xReturn = new Veto( ::rtl::OUString(), ::cppu::getCaughtException() );
+    }
+    return xReturn;
 }
 
 
//------------------------------------------------------------------------------
-void SAL_CALL OQueryContainer::approveReplaceElement( const ContainerEvent& 
Event ) throw (WrappedTargetException, RuntimeException)
+Reference< XVeto > SAL_CALL OQueryContainer::approveReplaceElement( const 
ContainerEvent& Event ) throw (WrappedTargetException, RuntimeException)
 {
-    // not interested in
+    return NULL;
 }
 
 
//------------------------------------------------------------------------------
-void SAL_CALL OQueryContainer::approveRemoveElement( const ContainerEvent& 
Event ) throw (WrappedTargetException, RuntimeException)
+Reference< XVeto > SAL_CALL OQueryContainer::approveRemoveElement( const 
ContainerEvent& Event ) throw (WrappedTargetException, RuntimeException)
 {
-    // not interested in
+    return NULL;
 }
 
 
//------------------------------------------------------------------------------




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

Reply via email to