About clearInsertRow() (connectivity and dbaccess module)

julien2412 serval2412 at yahoo.fr
Sat Mar 30 08:07:15 PDT 2013


Hello,

I noticed that a variable wasn't incremented in this loop:
   1772 void OResultSet::clearInsertRow()
   1773 {
  ...
   1778     for(sal_Int32 nPos = 0;aIter != aEnd;++aIter,++nPos)
   1779     {
   1780         ORowSetValueDecoratorRef& rValue = (*aIter);
   1781         if ( rValue->isBound() )
   1782         {
   1783             (m_aRow->get())[nPos]->setValue( (*aIter)->getValue() );
   1784         }
   1785         rValue->setBound(nPos == 0);
   1786         rValue->setModified(sal_False);
   1787         rValue->setNull();
   1788     }
   1789 }

See
http://opengrok.libreoffice.org/xref/core/connectivity/source/drivers/file/FResultSet.cxx#1772

I searched about "clearInsertRow" and found this method:
   1638 void ORowSetCache::clearInsertRow()
   1639 {
   1640     // we don't unbound the bookmark column
   1641     if ( m_aInsertRow != m_pInsertMatrix->end() &&
m_aInsertRow->is() )
   1642     {
   1643         ORowSetValueVector::Vector::iterator aIter =
(*m_aInsertRow)->get().begin()+1;
   1644         ORowSetValueVector::Vector::iterator aEnd =
(*m_aInsertRow)->get().end();
   1645         for(;aIter != aEnd;++aIter)
   1646         {
   1647             aIter->setBound(sal_False);
   1648             aIter->setModified(sal_False);
   1649             aIter->setNull();
   1650         }
   1651     }
   1652 }
http://opengrok.libreoffice.org/xref/core/dbaccess/source/core/api/RowSetCache.cxx#1638

I wonder if it's normal that these functions are different. For example,
should we consider a bookmark column in first method?
Then if it's ok, should we increment nPos in first one or should it be
rewritten in another way?

Julien



--
View this message in context: http://nabble.documentfoundation.org/About-clearInsertRow-connectivity-and-dbaccess-module-tp4047094.html
Sent from the Dev mailing list archive at Nabble.com.


More information about the LibreOffice mailing list