[Libreoffice-commits] .: 4 commits - connectivity/source dbaccess/source

Lionel Elie Mamane lmamane at kemper.freedesktop.org
Fri Jun 1 08:03:35 PDT 2012


 connectivity/source/drivers/odbcbase/OTools.cxx |    4 ++--
 dbaccess/source/core/api/KeySet.cxx             |   16 ++++++++++++----
 2 files changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 24ea39d7260dd536a24f50fa4a0b7e0cc9ea9896
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Jun 1 15:42:27 2012 +0200

    OKeySet::refreshRow: Invalidate m_xRow/m_xSet when BeforeFirst or AfterLast
    
    Change-Id: I0f48c099eddc077b2a89e3b7fab66b5da55b57c8

diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index 13464c4..49f4636 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -1334,12 +1334,13 @@ bool OKeySet::doTryRefetch_throw()  throw(SQLException, RuntimeException)
 void SAL_CALL OKeySet::refreshRow() throw(SQLException, RuntimeException)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen at sun.com", "OKeySet::refreshRow" );
-    if(isBeforeFirst() || isAfterLast() || !m_xStatement.is())
-        return;
 
     m_xRow = NULL;
     ::comphelper::disposeComponent(m_xSet);
 
+    if(isBeforeFirst() || isAfterLast() || !m_xStatement.is())
+        return;
+
     if ( m_aKeyIter->second.second.second.is() )
     {
         m_xRow = m_aKeyIter->second.second.second;
commit e7e21a6feae30c29c956235d071ebb0805c5afb2
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Jun 1 14:52:46 2012 +0200

    organise & comment code better
    
    Continuation of commits to fix fdo#48345
    
    Change-Id: Ie28f6a55cd8715a7180f5d88fe23c5b310440744

diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index d94609b..13464c4 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -1106,10 +1106,16 @@ sal_Bool SAL_CALL OKeySet::next(  ) throw(SQLException, RuntimeException)
     if(isAfterLast())
         return sal_False;
     ++m_aKeyIter;
-    if(!m_bRowCountFinal) // not yet all records fetched
+    if(!m_bRowCountFinal && m_aKeyIter == m_aKeyMap.end())
     {
-        if(m_aKeyIter == m_aKeyMap.end() && !fetchRow())
+        // not yet all records fetched, but we reached the end of those we fetched
+        // try to fetch one more row
+        if (!fetchRow())
+        {
+            // nope, we arrived at end of data
             m_aKeyIter = m_aKeyMap.end();
+            OSL_ENSURE(isAfterLast(), "fetchRow failed, but not end of data");
+        }
     }
 
     refreshRow();
commit 13b45d774088f55b07388e69f44a98468ea64a06
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Jun 1 14:49:02 2012 +0200

    Update comments
    
    Change-Id: I7e3f09d61cb35165000a35c8d3c3f2d284cf164e

diff --git a/connectivity/source/drivers/odbcbase/OTools.cxx b/connectivity/source/drivers/odbcbase/OTools.cxx
index df74076..9910859 100644
--- a/connectivity/source/drivers/odbcbase/OTools.cxx
+++ b/connectivity/source/drivers/odbcbase/OTools.cxx
@@ -693,8 +693,8 @@ Sequence<sal_Int8> OTools::getBytesValue(OConnection* _pConnection,
                 --nLen;
             aData.append(::rtl::OUString((const sal_Char*)aCharArray,nLen, _nTextEncoding));
 
-            // It is about Binariy Data, a String, that for StarView is to long or
-            // the driver kan't predict the length of the data - as well as save the
+            // It is about Binary Data, a String, that for StarView is too long or
+            // the driver can't predict the length of the data - as well as save the
             // MemoryStream.
             while ((pcbValue == SQL_NO_TOTAL) || pcbValue > nMaxLen)
             {
commit 3c436c2b0c74367dfdbbae96090be2f9828765ce
Author: Lionel Elie Mamane <lionel at mamane.lu>
Date:   Fri Jun 1 11:38:59 2012 +0200

    dbaccess::OKeySet::wasNull(): OSL_ENSURE we have a m_xRow
    
    Change-Id: I087d2893d853f431d27c592ba26bdc16e0a9cb84

diff --git a/dbaccess/source/core/api/KeySet.cxx b/dbaccess/source/core/api/KeySet.cxx
index f462b9b..d94609b 100644
--- a/dbaccess/source/core/api/KeySet.cxx
+++ b/dbaccess/source/core/api/KeySet.cxx
@@ -1416,6 +1416,7 @@ void OKeySet::fillAllRows()
 sal_Bool SAL_CALL OKeySet::wasNull(  ) throw(SQLException, RuntimeException)
 {
     RTL_LOGFILE_CONTEXT_AUTHOR( aLogger, "dbaccess", "Ocke.Janssen at sun.com", "OKeySet::wasNull" );
+    OSL_ENSURE(m_xRow.is(),"m_xRow is null!");
     return m_xRow->wasNull();
 }
 


More information about the Libreoffice-commits mailing list