last changed

This commit is contained in:
Ocke Janssen 2000-10-05 13:52:16 +00:00
parent f5a7239b9e
commit 2b9d05978f
2 changed files with 28 additions and 11 deletions

View file

@ -2,9 +2,9 @@
*
* $RCSfile: RowSet.cxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: fs $ $Date: 2000-10-05 09:33:39 $
* last change: $Author: oj $ $Date: 2000-10-05 14:52:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -1644,11 +1644,13 @@ Reference< XConnection > ORowSet::calcConnection() throw( SQLException, Runtime
{
#ifdef DEBUG
Reference<XDriverManager> xMan(m_xServiceManager->createInstance(::rtl::OUString::createFromAscii("com.sun.star.sdbc.DriverManager")),UNO_QUERY);
Sequence<PropertyValue> aInfo(1);
Sequence<PropertyValue> aInfo(2);
aInfo[0].Name = ::rtl::OUString::createFromAscii("CharSet");
aInfo[0].Value <<= RTL_TEXTENCODING_IBM_850;
aInfo[1].Name = ::rtl::OUString::createFromAscii("Extension");
aInfo[1].Value <<= ::rtl::OUString::createFromAscii("txt");
m_xActiveConnection = xMan->getConnectionWithInfo(::rtl::OUString::createFromAscii("sdbc:dbase:file:///G|/Office50/user/database/biblio/biblio.dbf"),aInfo);
m_xActiveConnection = xMan->getConnectionWithInfo(::rtl::OUString::createFromAscii("sdbc:flat:file:///G|/Office50/user/database/"),aInfo);
if(!m_xActiveConnection.is())
#endif
throw SQLException();
@ -2355,6 +2357,9 @@ sal_Int64 SAL_CALL ORowSetClone::getSomething( const Sequence< sal_Int8 >& rId )
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.4 2000/10/05 09:33:39 fs
using comphelper::OPropertyContainer instead of connectivity::OSimplePropertyContainer
Revision 1.3 2000/10/04 13:34:40 oj
some changes for deleteRow and updateRow

View file

@ -2,9 +2,9 @@
*
* $RCSfile: RowSetCache.cxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: oj $ $Date: 2000-10-04 13:34:40 $
* last change: $Author: oj $ $Date: 2000-10-05 14:52:16 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@ -184,7 +184,11 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
if(xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_ISBOOKMARKABLE) && any2bool(xProp->getPropertyValue(PROPERTY_ISBOOKMARKABLE)))
{
m_pCacheSet = new OBookmarkSet(_xRs,_pIterator);
m_nPrivileges = Privilege::SELECT | Privilege::INSERT | Privilege::DELETE | Privilege::UPDATE;
// check privileges
m_nPrivileges = Privilege::SELECT;
if(Reference<XResultSetUpdate>(_xRs,UNO_QUERY).is())
m_nPrivileges |= Privilege::INSERT | Privilege::DELETE | Privilege::UPDATE;
}
else
{
@ -196,7 +200,10 @@ ORowSetCache::ORowSetCache(const Reference< XResultSet >& _xRs,
else
{
m_pCacheSet = new OKeySet(_xRs,_pIterator);
m_nPrivileges = Privilege::SELECT | Privilege::INSERT | Privilege::DELETE | Privilege::UPDATE;
// check privileges
m_nPrivileges = Privilege::SELECT;
if(Reference<XResultSetUpdate>(_xRs,UNO_QUERY).is())
m_nPrivileges |= Privilege::INSERT | Privilege::DELETE | Privilege::UPDATE;
}
}
@ -964,8 +971,10 @@ sal_Bool ORowSetCache::moveWindow()
{
if(!m_bRowCountFinal)
{
m_pCacheSet->previous(); // because we stand after the last row
m_nRowCount = m_pCacheSet->getRow();// + 1 removed
if(m_pCacheSet->previous()) // because we stand after the last row
m_nRowCount = m_pCacheSet->getRow();// + 1 removed
else
m_nRowCount = 0;
m_bRowCountFinal = sal_True;
}
}
@ -1076,10 +1085,10 @@ sal_Bool SAL_CALL ORowSetCache::last( ) throw(SQLException, RuntimeException)
m_nRowCount = m_nPosition = m_pCacheSet->getRow(); // not + 1
}
m_bLast = sal_True;
m_nPosition = m_pCacheSet->getRow();
moveWindow();
// we have to repositioning because moveWindow can modify the cache
m_pCacheSet->last();
m_nPosition = m_pCacheSet->getRow();
if(m_nPosition > m_nFetchSize)
m_aMatrixIter = m_pMatrix->end() -1;
else
@ -1418,6 +1427,9 @@ void SAL_CALL ORowSetCache::clearWarnings( ) throw(SQLException, RuntimeExcepti
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.3 2000/10/04 13:34:40 oj
some changes for deleteRow and updateRow
Revision 1.2 2000/09/29 15:20:51 oj
rowset impl