Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


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.

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.