User: rt      
Date: 2008-01-30 07:46:27+0000
Modified:
   dba/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx

Log:
 INTEGRATION: CWS dba24d (1.20.152); FILE MERGED
 2007/12/05 14:15:00 fs 1.20.152.2: next: correctly set m_bEOF
 2007/12/05 13:27:00 fs 1.20.152.1: during i81658: +m_bEOF / throw 
FunctionSequenceException in getValue if we're before the first or after the 
last row

File Changes:

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

File [changed]: FDatabaseMetaDataResultSet.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/connectivity/source/commontools/FDatabaseMetaDataResultSet.cxx?r1=1.20&r2=1.21
Delta lines:  +26 -12
---------------------
--- FDatabaseMetaDataResultSet.cxx      2006-09-17 01:58:09+0000        1.20
+++ FDatabaseMetaDataResultSet.cxx      2008-01-30 07:46:24+0000        1.21
@@ -106,6 +106,7 @@
        ,m_aStatement(NULL)
        ,m_xMetaData(NULL)
        ,m_bBOF(sal_True)
+       ,m_bEOF(sal_True)
 {
        construct();
 }
@@ -117,6 +118,7 @@
     ,m_aStatement(NULL)
     ,m_xMetaData(NULL)
     ,m_bBOF(sal_True)
+       ,m_bEOF(sal_True)
 {
     construct();
 
@@ -195,6 +197,8 @@
 void ODatabaseMetaDataResultSet::setRows(const ORows& _rRows)
 {
        m_aRows = _rRows;
+    m_bBOF = sal_True;
+    m_bEOF = m_aRows.empty();
 }
 // -------------------------------------------------------------------------
 sal_Int32 SAL_CALL ODatabaseMetaDataResultSet::findColumn( const 
::rtl::OUString& columnName ) throw(SQLException, RuntimeException)
@@ -357,8 +361,7 @@
 
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isAfterLast(  ) 
throw(SQLException, RuntimeException)
 {
-       ::dbtools::throwFunctionSequenceException(*this);
-       return sal_False;
+       return m_bEOF;
 }
 // -------------------------------------------------------------------------
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isFirst(  ) throw(SQLException, 
RuntimeException)
@@ -453,8 +456,7 @@
 
 sal_Bool SAL_CALL ODatabaseMetaDataResultSet::isBeforeFirst(  ) 
throw(SQLException, RuntimeException)
 {
-       ::dbtools::throwFunctionSequenceException(*this);
-       return sal_False;
+       return m_bBOF;
 }
 // -------------------------------------------------------------------------
 
@@ -463,18 +465,27 @@
        ::osl::MutexGuard aGuard( m_aMutex );
        checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
 
-
-       if(m_bBOF)
+       if ( m_bBOF )
        {
           m_aRowsIter = m_aRows.begin();
           m_bBOF = sal_False;
-          return m_aRowsIter != m_aRows.end();
        }
-
-       if(m_aRowsIter != m_aRows.end())
+    else
+    {
+        if ( m_bEOF )
+            throwFunctionSequenceException( *this );
+        else
+               if ( m_aRowsIter != m_aRows.end() )
                ++m_aRowsIter;
+    }
 
-       return m_aRowsIter != m_aRows.end();
+    bool bSuccess = m_aRowsIter != m_aRows.end();
+    if ( !bSuccess )
+    {
+        m_bEOF = sal_True;
+        m_bBOF = m_aRows.empty();
+    }
+    return bSuccess;
 }
 // -------------------------------------------------------------------------
 
@@ -657,6 +668,9 @@
        ::osl::MutexGuard aGuard( m_aMutex );
        checkDisposed(ODatabaseMetaDataResultSet_BASE::rBHelper.bDisposed );
 
+    if ( isBeforeFirst() || isAfterLast() )
+           ::dbtools::throwFunctionSequenceException( *this );
+
        checkIndex(columnIndex );
        m_nColPos = columnIndex;
 




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

Reply via email to