Tag: cws_src680_dba21fini
User: oj      
Date: 2006/10/27 01:14:36

Modified:
   dba/connectivity/source/drivers/ado/APreparedStatement.cxx
   dba/connectivity/source/drivers/ado/AResultSetMetaData.cxx
   dba/connectivity/source/drivers/ado/adoimp.cxx
   dba/connectivity/source/inc/ado/AResultSetMetaData.hxx

Log:
 #142400# check recordset

File Changes:

Directory: /dba/connectivity/source/drivers/ado/
================================================

File [changed]: APreparedStatement.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/ado/APreparedStatement.cxx?r1=1.20&r2=1.20.26.1
Delta lines:  +4 -5
-------------------
--- APreparedStatement.cxx      17 Sep 2006 02:14:52 -0000      1.20
+++ APreparedStatement.cxx      27 Oct 2006 08:14:33 -0000      1.20.26.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: APreparedStatement.cxx,v $
  *
- *  $Revision: 1.20 $
+ *  $Revision: 1.20.26.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 02:14:52 $
+ *  last change: $Author: oj $ $Date: 2006/10/27 08:14:33 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -151,7 +151,7 @@
 
 Reference< XResultSetMetaData > SAL_CALL OPreparedStatement::getMetaData(  ) 
throw(SQLException, RuntimeException)
 {
-       if(!m_xMetaData.is())
+       if(!m_xMetaData.is() && m_RecordSet.IsValid())
                m_xMetaData = new OResultSetMetaData(m_RecordSet);
        return m_xMetaData;
 }
@@ -334,7 +334,6 @@
        CHECK_RETURN(m_RecordSet.put_CacheSize(m_nFetchSize))
        CHECK_RETURN(m_RecordSet.put_MaxRecords(m_nMaxRows))
        
CHECK_RETURN(m_RecordSet.Open(aCmd,aCon,m_eCursorType,m_eLockType,adOpenUnspecified))
-
        CHECK_RETURN(m_RecordSet.get_CacheSize(m_nFetchSize))
        CHECK_RETURN(m_RecordSet.get_MaxRecords(m_nMaxRows))
        CHECK_RETURN(m_RecordSet.get_CursorType(m_eCursorType))

File [changed]: AResultSetMetaData.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/ado/AResultSetMetaData.cxx?r1=1.11&r2=1.11.26.1
Delta lines:  +16 -5
--------------------
--- AResultSetMetaData.cxx      17 Sep 2006 02:15:19 -0000      1.11
+++ AResultSetMetaData.cxx      27 Oct 2006 08:14:33 -0000      1.11.26.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: AResultSetMetaData.cxx,v $
  *
- *  $Revision: 1.11 $
+ *  $Revision: 1.11.26.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 02:15:19 $
+ *  last change: $Author: oj $ $Date: 2006/10/27 08:14:33 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -60,9 +60,17 @@
 using namespace com::sun::star::beans;
 using namespace com::sun::star::sdbc;
 
+OResultSetMetaData::OResultSetMetaData( ADORecordset* _pRecordSet)
+                                       :       m_pRecordSet(_pRecordSet),
+                                               m_nColCount(-1)
+{
+       if ( m_pRecordSet )
+               m_pRecordSet->AddRef();
+}
 // -------------------------------------------------------------------------
 OResultSetMetaData::~OResultSetMetaData()
 {
+       if ( m_pRecordSet )
        m_pRecordSet->Release();
 }
 // -------------------------------------------------------------------------
@@ -84,8 +92,11 @@
 
 sal_Int32 SAL_CALL OResultSetMetaData::getColumnCount(  ) throw(SQLException, 
RuntimeException)
 {
-       if(m_nColCount != -1)
+       if(m_nColCount != -1 )
                return m_nColCount;
+
+       if ( !m_pRecordSet )
+               return 0;
 
        ADOFields* pFields      = NULL;
        m_pRecordSet->get_Fields(&pFields);

File [changed]: adoimp.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/drivers/ado/adoimp.cxx?r1=1.15&r2=1.15.26.1
Delta lines:  +7 -4
-------------------
--- adoimp.cxx  17 Sep 2006 02:17:56 -0000      1.15
+++ adoimp.cxx  27 Oct 2006 08:14:34 -0000      1.15.26.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: adoimp.cxx,v $
  *
- *  $Revision: 1.15 $
+ *  $Revision: 1.15.26.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 02:17:56 $
+ *  last change: $Author: oj $ $Date: 2006/10/27 08:14:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -339,9 +339,12 @@
 // 
-----------------------------------------------------------------------------
 WpADOField ADOS::getField(ADORecordset* _pRecordSet,sal_Int32 _nColumnIndex) 
throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException)
 {
+       if ( !_pRecordSet )
+               return WpADOField();
+
        ADOFields* pFields      = NULL;
        _pRecordSet->get_Fields(&pFields);
-       WpOLEAppendCollection<ADOFields, ADOField, WpADOField>  
aFields(pFields);                                       \
+       WpOLEAppendCollection<ADOFields, ADOField, WpADOField>  
aFields(pFields);
        if(_nColumnIndex <= 0 || _nColumnIndex > aFields.GetItemCount())
                ::dbtools::throwInvalidIndexException(NULL);
        WpADOField aField(aFields.GetItem(_nColumnIndex-1));

Directory: /dba/connectivity/source/inc/ado/
============================================

File [changed]: AResultSetMetaData.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/inc/ado/AResultSetMetaData.hxx?r1=1.4&r2=1.4.196.1
Delta lines:  +6 -7
-------------------
--- AResultSetMetaData.hxx      8 Sep 2005 06:53:32 -0000       1.4
+++ AResultSetMetaData.hxx      27 Oct 2006 08:14:34 -0000      1.4.196.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: AResultSetMetaData.hxx,v $
  *
- *  $Revision: 1.4 $
+ *  $Revision: 1.4.196.1 $
  *
- *  last change: $Author: rt $ $Date: 2005/09/08 06:53:32 $
+ *  last change: $Author: oj $ $Date: 2006/10/27 08:14:34 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -78,12 +78,11 @@
                        OResultSetMetaData( const OResultSetMetaData& );        
                // never implemented
                        OResultSetMetaData& operator=( const 
OResultSetMetaData& );     // never implemented
 
+               protected:
+                       virtual ~OResultSetMetaData();
                public:
                        // ein Konstruktor, der fuer das Returnen des Objektes 
benoetigt wird:
-                       OResultSetMetaData( ADORecordset* _pRecordSet)
-                                       :       m_pRecordSet(_pRecordSet),
-                                               
m_nColCount(-1){m_pRecordSet->AddRef();}
-                       ~OResultSetMetaData();
+                       OResultSetMetaData( ADORecordset* _pRecordSet);
 
                        virtual sal_Int32 SAL_CALL getColumnCount(  ) 
throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);
                        virtual sal_Bool SAL_CALL isAutoIncrement( sal_Int32 
column ) throw(::com::sun::star::sdbc::SQLException, 
::com::sun::star::uno::RuntimeException);




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

Reply via email to