Tag: cws_src680_dba22a
User: fs      
Date: 2006/11/22 12:45:55

Modified:
   dba/connectivity/source/commontools/dbexception.cxx

Log:
 #i71860# assignment from SQLErrorEvent and Any

File Changes:

Directory: /dba/connectivity/source/commontools/
================================================

File [changed]: dbexception.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/dbexception.cxx?r1=1.18&r2=1.18.18.1
Delta lines:  +23 -10
---------------------
--- dbexception.cxx     17 Sep 2006 02:02:31 -0000      1.18
+++ dbexception.cxx     22 Nov 2006 20:45:53 -0000      1.18.18.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dbexception.cxx,v $
  *
- *  $Revision: 1.18 $
+ *  $Revision: 1.18.18.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 02:02:31 $
+ *  last change: $Author: fs $ $Date: 2006/11/22 20:45:53 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -140,16 +140,25 @@
 }
 
 
//------------------------------------------------------------------------------
-SQLExceptionInfo::SQLExceptionInfo(const ::com::sun::star::sdb::SQLErrorEvent& 
_rError)
+const SQLExceptionInfo& SQLExceptionInfo::operator=(const 
::com::sun::star::sdb::SQLErrorEvent& _rErrorEvent)
 {
-       const staruno::Type& aSQLExceptionType = 
::getCppuType(reinterpret_cast< ::com::sun::star::sdbc::SQLException*>(NULL));
-       staruno::Type aReasonType = _rError.Reason.getValueType();
+       m_aContent = _rErrorEvent.Reason;
+       implDetermineType();
+       return *this;
+}
 
-       sal_Bool bValid = isAssignableFrom(aSQLExceptionType, aReasonType);
-       OSL_ENSURE(bValid, "SQLExceptionInfo::SQLExceptionInfo : invalid 
argument (does not contain an SQLException) !");
-       if (bValid)
-               m_aContent = _rError.Reason;
+//------------------------------------------------------------------------------
+const SQLExceptionInfo& SQLExceptionInfo::operator=(const 
::com::sun::star::uno::Any& _rCaughtSQLException)
+{
+       m_aContent = _rCaughtSQLException;
+       implDetermineType();
+       return *this;
+}
 
+//------------------------------------------------------------------------------
+SQLExceptionInfo::SQLExceptionInfo(const ::com::sun::star::sdb::SQLErrorEvent& 
_rError)
+{
+       m_aContent = _rError.Reason;
        implDetermineType();
 }
 
@@ -176,7 +185,11 @@
        else if (isA(aContentType, static_cast< 
::com::sun::star::sdbc::SQLException*>(NULL)))
                m_eType = SQL_EXCEPTION;
        else
+    {
+        OSL_ENSURE( false, "SQLExceptionInfo::implDetermineType: cannot 
determine type!" );
                m_eType = UNDEFINED;
+        m_aContent.clear();
+    }
 }
 
 
//------------------------------------------------------------------------------




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

Reply via email to