Kaydet (Commit) 11ad9b6d authored tarafından Ocke Janssen's avatar Ocke Janssen

#82632# change member

üst 6a818b90
......@@ -2,9 +2,9 @@
*
* $RCSfile: CRowSetColumn.cxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: oj $ $Date: 2000-10-25 07:30:24 $
* last change: $Author: oj $ $Date: 2001-01-22 07:35:47 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -170,8 +170,8 @@ void SAL_CALL ORowSetColumn::getFastPropertyValue( Any& rValue, sal_Int32 nHandl
OColumnSettings::getFastPropertyValue( rValue, nHandle );
break;
case PROPERTY_ID_VALUE:
if(m_rColumnValue != m_rEnd && (*m_rColumnValue).isValid())
rValue = (*(*m_rColumnValue))[m_nPos].makeAny();
if(m_aColumnValue != m_rEnd && (*m_aColumnValue).isValid())
rValue = (*(*m_aColumnValue))[m_nPos].makeAny();
break;
default:
ORowSetDataColumn::getFastPropertyValue(rValue,nHandle);
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: CRowSetColumn.hxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: oj $ $Date: 2000-10-17 10:18:12 $
* last change: $Author: oj $ $Date: 2001-01-22 07:36:07 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -88,7 +88,7 @@ namespace dbaccess
const ::com::sun::star::uno::Reference < ::com::sun::star::sdbc::XRow >& _xRow,
sal_Int32 _nPos,
const ::rtl::OUString& _rDescription,
ORowSetMatrix::iterator& _rColumnValue,
ORowSetCacheIterator& _rColumnValue,
ORowSetMatrix::iterator& _rEnd)
: ORowSetDataColumn(_xMetaData,_xRow,NULL,_nPos,_rDescription,_rColumnValue,_rEnd)
{
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: CRowSetDataColumn.cxx,v $
*
* $Revision: 1.7 $
* $Revision: 1.8 $
*
* last change: $Author: oj $ $Date: 2000-12-06 14:36:23 $
* last change: $Author: oj $ $Date: 2001-01-22 07:38:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -96,11 +96,11 @@ ORowSetDataColumn::ORowSetDataColumn( const Reference < XResultSetMetaData >&
const Reference < XRowUpdate >& _xRowUpdate,
sal_Int32 _nPos,
const ::rtl::OUString& _rDescription,
ORowSetMatrix::iterator& _rColumnValue,
const ORowSetCacheIterator& _rColumnValue,
ORowSetMatrix::iterator& _rEnd)
: ODataColumn(_xMetaData,_xRow,_xRowUpdate,_nPos)
,m_aDescription(_rDescription)
,m_rColumnValue(_rColumnValue)
,m_aColumnValue(_rColumnValue)
,m_rEnd(_rEnd)
{
......@@ -169,8 +169,8 @@ void SAL_CALL ORowSetDataColumn::getFastPropertyValue( Any& rValue, sal_Int32 nH
OColumnSettings::getFastPropertyValue( rValue, nHandle );
break;
case PROPERTY_ID_VALUE:
if(m_rColumnValue != m_rEnd && (*m_rColumnValue).isValid())
rValue = (*(*m_rColumnValue))[m_nPos].makeAny();
if(m_aColumnValue != m_rEnd && m_aColumnValue->isValid())
rValue = (*(*m_aColumnValue))[m_nPos].makeAny();
break;
default:
ODataColumn::getFastPropertyValue(rValue,nHandle);
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: CRowSetDataColumn.hxx,v $
*
* $Revision: 1.4 $
* $Revision: 1.5 $
*
* last change: $Author: oj $ $Date: 2000-11-03 14:32:31 $
* last change: $Author: oj $ $Date: 2001-01-22 07:38:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -73,6 +73,9 @@
#ifndef _COMPHELPER_PROPERTY_ARRAY_HELPER_HXX_
#include <comphelper/proparrhlp.hxx>
#endif
#ifndef DBACCESS_ROWSETCACHEITERATOR_HXX
#include "RowSetCacheIterator.hxx"
#endif
namespace dbaccess
{
......@@ -84,7 +87,7 @@ namespace dbaccess
public ORowSetDataColumn_PROP
{
protected:
ORowSetMatrix::iterator& m_rColumnValue;
ORowSetCacheIterator m_aColumnValue;
ORowSetMatrix::iterator& m_rEnd; // end of the matrix to when we reach the end
::com::sun::star::uno::Any m_aOldValue;
......@@ -95,7 +98,7 @@ namespace dbaccess
const ::com::sun::star::uno::Reference < ::com::sun::star::sdbc::XRowUpdate >& _xRowUpdate,
sal_Int32 _nPos,
const ::rtl::OUString& _rDescription,
ORowSetMatrix::iterator& _rColumnValue,
const ORowSetCacheIterator& _rColumnValue,
ORowSetMatrix::iterator& _rEnd);
~ORowSetDataColumn();
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: CacheSet.cxx,v $
*
* $Revision: 1.13 $
* $Revision: 1.14 $
*
* last change: $Author: oj $ $Date: 2000-12-12 12:15:41 $
* last change: $Author: oj $ $Date: 2001-01-22 07:38:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -123,17 +123,17 @@ OCacheSet::~OCacheSet()
}
catch(Exception&)
{
OSL_ENSHURE(0,"Exception occured");
OSL_ENSURE(0,"Exception occured");
}
catch(...)
{
OSL_ENSHURE(0,"Unknown Exception occured");
OSL_ENSURE(0,"Unknown Exception occured");
}
}
// -----------------------------------------------------------------------------
void OCacheSet::fillTableName(const Reference<XPropertySet>& _xTable) throw(SQLException, RuntimeException)
{
OSL_ENSHURE(_xTable.is(),"OCacheSet::fillTableName: PropertySet is empty!");
OSL_ENSURE(_xTable.is(),"OCacheSet::fillTableName: PropertySet is empty!");
if(!m_aComposedTableName.getLength())
{
Reference<XDatabaseMetaData> xMeta(m_xConnection->getMetaData());
......@@ -173,18 +173,36 @@ void SAL_CALL OCacheSet::insertRow( const ORowSetRow& _rInsertRow,const connecti
aSql += aValues;
// now create end execute the prepared statement
Reference< XPreparedStatement > xPrep(m_xConnection->prepareStatement(aSql));
Reference< XParameters > xParameter(xPrep,UNO_QUERY);
i = 1;
for(aIter = _rInsertRow->begin()+1; aIter != _rInsertRow->end();++aIter,++i)
{
if(aIter->isNull())
xParameter->setNull(i,aIter->getTypeKind());
else
setParameter(i,xParameter,*aIter);
Reference< XPreparedStatement > xPrep(m_xConnection->prepareStatement(aSql));
Reference< XParameters > xParameter(xPrep,UNO_QUERY);
i = 1;
for(aIter = _rInsertRow->begin()+1; aIter != _rInsertRow->end();++aIter,++i)
{
if(aIter->isNull())
xParameter->setNull(i,aIter->getTypeKind());
else
setParameter(i,xParameter,*aIter);
}
m_bInserted = xPrep->executeUpdate() > 0;
}
m_bInserted = xPrep->executeUpdate() > 0;
// ::rtl::OUString aCountSql = ::rtl::OUString::createFromAscii("SELECT COUNT(*) FROM ");
// aCountSql += m_aComposedTableName;
// try
// {
// Reference< XStatement > xStmt(m_xConnection->createStatement());
// Reference<XResultSet> xRes(xStmt->executeQuery(aCountSql));
// if(xRes.is() && xRes->next())
// {
// Reference<XRow> xRow(xRes,UNO_QUERY);
// }
// }
// catch(SQLException&)
// {
// }
// TODO set the bookmark in the insert row
}
// -------------------------------------------------------------------------
......@@ -546,6 +564,9 @@ void OCacheSet::fillValueRow(ORowSetRow& _rRow,sal_Int32 _nPosition)
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.13 2000/12/12 12:15:41 oj
use paramter instead of member and set member to ull
Revision 1.12 2000/12/07 12:35:21 oj
#81424# valueof(bool) has no opposite conversion
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: CacheSet.hxx,v $
*
* $Revision: 1.6 $
* $Revision: 1.7 $
*
* last change: $Author: oj $ $Date: 2000-12-12 12:15:41 $
* last change: $Author: oj $ $Date: 2001-01-22 07:38:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -242,6 +242,7 @@ namespace dbaccess
// ::com::sun::star::sdbc::XResultSet
virtual sal_Bool SAL_CALL next( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
return m_xDriverSet->next();
}
// -------------------------------------------------------------------------
......@@ -267,21 +268,25 @@ namespace dbaccess
// -------------------------------------------------------------------------
virtual void SAL_CALL beforeFirst( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
m_xDriverSet->beforeFirst();
}
// -------------------------------------------------------------------------
virtual void SAL_CALL afterLast( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
m_xDriverSet->afterLast();
}
// -------------------------------------------------------------------------
virtual sal_Bool SAL_CALL first( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
return m_xDriverSet->first();
}
// -------------------------------------------------------------------------
virtual sal_Bool SAL_CALL last( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
return m_xDriverSet->last();
}
// -------------------------------------------------------------------------
......@@ -292,16 +297,19 @@ namespace dbaccess
// -------------------------------------------------------------------------
virtual sal_Bool SAL_CALL absolute( sal_Int32 row ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
return m_xDriverSet->absolute(row);
}
// -------------------------------------------------------------------------
virtual sal_Bool SAL_CALL relative( sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
return m_xDriverSet->relative(rows);
}
// -------------------------------------------------------------------------
virtual sal_Bool SAL_CALL previous( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
return m_xDriverSet->previous();
}
// -------------------------------------------------------------------------
......@@ -352,6 +360,9 @@ namespace dbaccess
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.6 2000/12/12 12:15:41 oj
use paramter instead of member and set member to ull
Revision 1.5 2000/11/14 13:28:20 oj
change for rowset when getRow returns 0
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: KeySet.hxx,v $
*
* $Revision: 1.3 $
* $Revision: 1.4 $
*
* last change: $Author: oj $ $Date: 2000-10-17 10:18:12 $
* last change: $Author: oj $ $Date: 2001-01-22 07:38:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -66,26 +66,75 @@
#include "CacheSet.hxx"
#endif
#ifndef _CPPUHELPER_IMPLBASE1_HXX_
#include <cppuhelper/implbase1.hxx>
#endif
#ifndef _MAP_
#include <map>
#endif
#ifndef _COM_SUN_STAR_LANG_XUNOTUNNEL_HPP_
#include <com/sun/star/lang/XUnoTunnel.hpp>
#endif
namespace dbaccess
{
typedef ::std::map<sal_Int32,::com::sun::star::uno::WeakReference< ::com::sun::star::lang::XUnoTunnel> > OBookmarkMap;
class OKeySet;
class OKeySetBookmark : public ::cppu::WeakImplHelper1< ::com::sun::star::lang::XUnoTunnel>
{
OKeySet* m_pKeySet; // to parent
OBookmarkMap::iterator m_aPosIter; //
public:
OKeySetBookmark(OKeySet* _pKeySet,const OBookmarkMap::iterator& _aPosIter)
: m_pKeySet(_pKeySet)
, m_aPosIter(_aPosIter)
{
}
~OKeySetBookmark();
void removeKeySet();
sal_Int32 getRealPos() const;
OBookmarkMap::iterator getPosIterator() { return m_aPosIter; }
void setPosIterator(const OBookmarkMap::iterator& _rIter);
virtual sal_Int64 SAL_CALL getSomething( const ::com::sun::star::uno::Sequence< sal_Int8 >& aIdentifier ) throw(::com::sun::star::uno::RuntimeException);
static ::com::sun::star::uno::Sequence< sal_Int8 > getUnoTunnelImplementationId();
};
// is used when the source supports keys
class OKeySet : public OCacheSet
{
OBookmarkMap m_aBookmarkMap;
::std::vector<sal_Int32> m_aDeletedRows;
public:
OKeySet(const ::com::sun::star::uno::Reference< ::com::sun::star::sdbc::XResultSet>& _xDriverSet);
~OKeySet();
// ::com::sun::star::sdbcx::XRowLocate
virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( const ORowSetRow& _rRow ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
void RemoveBookmarkPos(OBookmarkMap::iterator& _rIter);
// -------------------------------------------------------------------------
virtual sal_Bool SAL_CALL rowUpdated( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
return m_bUpdated;
}
// -------------------------------------------------------------------------
virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
virtual sal_Bool SAL_CALL rowInserted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
return m_xDriverSet->absolute(connectivity::getINT32(bookmark));
return m_bInserted;
}
// -------------------------------------------------------------------------
virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
virtual sal_Bool SAL_CALL rowDeleted( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException)
{
return m_xDriverSet->absolute(connectivity::getINT32(bookmark)+rows);
return m_bDeleted;
}
// ::com::sun::star::sdbcx::XRowLocate
virtual ::com::sun::star::uno::Any SAL_CALL getBookmark( const ORowSetRow& _rRow ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
// -------------------------------------------------------------------------
virtual sal_Bool SAL_CALL moveToBookmark( const ::com::sun::star::uno::Any& bookmark ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
// -------------------------------------------------------------------------
virtual sal_Bool SAL_CALL moveRelativeToBookmark( const ::com::sun::star::uno::Any& bookmark, sal_Int32 rows ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
// -------------------------------------------------------------------------
virtual sal_Int32 SAL_CALL compareBookmarks( const ::com::sun::star::uno::Any& first, const ::com::sun::star::uno::Any& second ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
// -------------------------------------------------------------------------
......@@ -98,6 +147,7 @@ namespace dbaccess
// ::com::sun::star::sdbc::XResultSetUpdate
virtual void SAL_CALL updateRow(const ORowSetRow& _rInsertRow,const ORowSetRow& _rOrginalRow,const connectivity::OSQLTable& _xTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL deleteRow(const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL insertRow( const ORowSetRow& _rInsertRow,const connectivity::OSQLTable& _xTable ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL moveToCurrentRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
......@@ -107,6 +157,9 @@ namespace dbaccess
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.3 2000/10/17 10:18:12 oj
some changes for the rowset
Revision 1.2 2000/10/11 11:18:10 fs
replace unotools with comphelper
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: RowSet.hxx,v $
*
* $Revision: 1.13 $
* $Revision: 1.14 $
*
* last change: $Author: oj $ $Date: 2001-01-09 12:29:09 $
* last change: $Author: oj $ $Date: 2001-01-22 07:38:23 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -206,6 +206,7 @@ namespace dbaccess
void notifyClonesRowDeleted(const ::com::sun::star::uno::Any& _rBookmark);
// inform the clones that we will delete some records
void notifyClonesRowDelete(const ::com::sun::star::uno::Any& _rBookmark);
void checkUpdateIterator();
protected:
virtual void SAL_CALL setFastPropertyValue_NoBroadcast(sal_Int32 nHandle,const ::com::sun::star::uno::Any& rValue) throw (::com::sun::star::uno::Exception);
......@@ -402,7 +403,7 @@ namespace dbaccess
// the clone can not insert anything
virtual void checkInsert() {}
public:
ORowSetClone(ORowSet& rParent);
ORowSetClone(ORowSet& rParent,::osl::Mutex& _rMutex);
virtual ~ORowSetClone();
// com::sun::star::lang::XTypeProvider
......@@ -455,6 +456,9 @@ namespace dbaccess
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.13 2001/01/09 12:29:09 oj
two new properties
Revision 1.12 2000/12/06 09:52:12 oj
#80219# correted deleterow(s) and remeber position
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: RowSetBase.hxx,v $
*
* $Revision: 1.9 $
* $Revision: 1.10 $
*
* last change: $Author: oj $ $Date: 2000-12-06 09:53:45 $
* last change: $Author: oj $ $Date: 2001-01-22 07:38:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -115,6 +115,10 @@
#ifndef _COMPHELPER_BROADCASTHELPER_HXX_
#include <comphelper/broadcasthelper.hxx>
#endif
#ifndef DBACCESS_ROWSETCACHEITERATOR_HXX
#include "RowSetCacheIterator.hxx"
#endif
namespace com { namespace sun { namespace star {
......@@ -136,7 +140,7 @@ namespace dbaccess
::com::sun::star::lang::XUnoTunnel> ORowSetBase_BASE;
class ORowSetCache;
class ORowSetDataColumns;
class ORowSetCacheIterator;
class ORowSetBase : public ORowSetBase_BASE,
public ::comphelper::OPropertyContainer,
public ::comphelper::OPropertyArrayUsageHelper<ORowSetBase> // this class hold the static property info
......@@ -152,7 +156,8 @@ namespace dbaccess
m_aApproveListeners;// when clone -> they are empty
::com::sun::star::uno::Any m_aBookmark;
ORowSetMatrix::iterator m_aCurrentRow; // contains the actual fetched row
ORowSetCacheIterator m_aCurrentRow; // contains the actual fetched row
ORowSetRow m_aOldRow;
::cppu::OWeakObject* m_pMySelf; // set by derived classes
ORowSetCache* m_pCache; // the cache is used by the rowset and his clone (shared)
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: RowSetCache.hxx,v $
*
* $Revision: 1.5 $
* $Revision: 1.6 $
*
* last change: $Author: oj $ $Date: 2000-10-17 10:18:12 $
* last change: $Author: oj $ $Date: 2001-01-22 07:38:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -136,6 +136,9 @@
#ifndef DBACCESS_CORE_API_ROWSETROW_HXX
#include "RowSetRow.hxx"
#endif
#ifndef DBACCESS_ROWSETCACHEITERATOR_HXX
#include "RowSetCacheIterator.hxx"
#endif
namespace dbaccess
{
......@@ -148,6 +151,7 @@ namespace dbaccess
friend class ORowSetBase;
friend class ORowSet;
friend class ORowSetClone;
friend class ORowSetCacheIterator;
::osl::Mutex m_aRowCountMutex, // mutex for rowcount changes
// we need a extra mutex for columns to prevend deadlock when setting new values
......@@ -163,6 +167,7 @@ namespace dbaccess
ORowSetMatrix* m_pMatrix; // represent the table struct
ORowSetMatrix::iterator m_aMatrixIter; // represent a row of the table
ORowSetMatrix::iterator m_aMatrixEnd; // present the row behind the last row of the table
ORowSetCacheMap m_aCacheIterators;
ORowSetMatrix* m_pInsertMatrix; // represent the rows which should be inserted normally this is only one
ORowSetMatrix::iterator m_aInsertRow; // represent a insert row
......@@ -218,11 +223,12 @@ namespace dbaccess
sal_Bool m_bIsBookmarable ;
sal_Bool& m_bNew ; // points to the rowset member m_bNew
sal_Bool fillMatrix(sal_Int32 _nNewStartPos,sal_Int32 _nNewEndPos);
sal_Bool fillMatrix(sal_Int32 &_nNewStartPos,sal_Int32 _nNewEndPos);
sal_Bool moveWindow();
void firePropertyChange(sal_Int32 _nColumnIndex,const ::com::sun::star::uno::Any& _rOldValue);
void rotateCacheIterator(sal_Int16 _nDist);
protected:
ORowSetMatrix::iterator& getIterator() { return m_aMatrixIter;}
ORowSetMatrix::iterator& getEnd() { return m_aMatrixEnd;}
......@@ -237,6 +243,9 @@ namespace dbaccess
~ORowSetCache();
// called from the rowset when a updateXXX was called for the first time
void setUpdateIterator(const ORowSetMatrix::iterator& _rOriginalRow);
ORowSetCacheIterator createIterator();
// sets the size of the matrix
void setMaxRowSize(sal_Int32 _nSize);
......@@ -327,6 +336,7 @@ namespace dbaccess
// ::com::sun::star::sdbc::XResultSetUpdate
virtual void SAL_CALL insertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL updateRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL updateRow( ORowSetMatrix::iterator& _rUpdateRow ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL deleteRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL cancelRowUpdates( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
virtual void SAL_CALL moveToInsertRow( ) throw(::com::sun::star::sdbc::SQLException, ::com::sun::star::uno::RuntimeException);
......@@ -354,6 +364,9 @@ namespace dbaccess
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.5 2000/10/17 10:18:12 oj
some changes for the rowset
Revision 1.4 2000/10/11 11:18:11 fs
replace unotools with comphelper
......
......@@ -2,9 +2,9 @@
*
* $RCSfile: StaticSet.cxx,v $
*
* $Revision: 1.6 $
* $Revision: 1.7 $
*
* last change: $Author: oj $ $Date: 2000-11-29 10:23:32 $
* last change: $Author: oj $ $Date: 2001-01-22 07:38:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
......@@ -112,7 +112,7 @@ sal_Bool SAL_CALL OStaticSet::moveToBookmark( const Any& bookmark ) throw(SQLExc
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
m_aSetIter = m_aSet.begin() + getINT32(bookmark);
OSL_ENSHURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
return m_aSetIter != m_aSet.end();
}
// -------------------------------------------------------------------------
......@@ -120,7 +120,7 @@ sal_Bool SAL_CALL OStaticSet::moveRelativeToBookmark( const Any& bookmark, sal_I
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
m_aSetIter = m_aSet.begin() + getINT32(bookmark) + rows;
OSL_ENSHURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
return m_aSetIter != m_aSet.end();
}
// -------------------------------------------------------------------------
......@@ -204,8 +204,8 @@ sal_Bool SAL_CALL OStaticSet::next( ) throw(SQLException, RuntimeException)
else if(m_aSetIter != m_aSet.end())
++m_aSetIter;
}
OSL_ENSHURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSHURE(m_aSetIter <= m_aSet.end(),"Iterator behind end()!");
OSL_ENSURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSURE(m_aSetIter <= m_aSet.end(),"Iterator behind end()!");
return m_aSetIter != m_aSet.end();
}
// -------------------------------------------------------------------------
......@@ -234,7 +234,7 @@ void SAL_CALL OStaticSet::beforeFirst( ) throw(SQLException, RuntimeException)
m_bBeforeFirst = sal_True;
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
m_aSetIter = m_aSet.end();
OSL_ENSHURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
}
// -------------------------------------------------------------------------
void SAL_CALL OStaticSet::afterLast( ) throw(SQLException, RuntimeException)
......@@ -243,7 +243,7 @@ void SAL_CALL OStaticSet::afterLast( ) throw(SQLException, RuntimeException)
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
fillAllRows();
m_aSetIter = m_aSet.end();
OSL_ENSHURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL OStaticSet::first( ) throw(SQLException, RuntimeException)
......@@ -254,8 +254,8 @@ sal_Bool SAL_CALL OStaticSet::first( ) throw(SQLException, RuntimeException)
if(m_aSetIter == m_aSet.end() && !fetchRow())
m_bBeforeFirst = sal_True;
OSL_ENSHURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSHURE(m_aSetIter <= m_aSet.end(),"Iterator behind end()!");
OSL_ENSURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSURE(m_aSetIter <= m_aSet.end(),"Iterator behind end()!");
return m_aSetIter != m_aSet.end();
}
......@@ -268,8 +268,8 @@ sal_Bool SAL_CALL OStaticSet::last( ) throw(SQLException, RuntimeException)
if(m_aSet.size())
m_aSetIter = m_aSet.end()-1;
OSL_ENSHURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSHURE(m_aSetIter <= m_aSet.end(),"Iterator behind end()!");
OSL_ENSURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSURE(m_aSetIter <= m_aSet.end(),"Iterator behind end()!");
return !(m_bBeforeFirst = (m_aSetIter == m_aSet.end()));
}
......@@ -281,14 +281,14 @@ sal_Int32 SAL_CALL OStaticSet::getRow( ) throw(SQLException, RuntimeException)
if(isBeforeFirst())
return 0;
sal_Int32 nPos = m_aSet.size() - (m_aSet.end() - m_aSetIter) +1;
OSL_ENSHURE(nPos >= 0,"RowPos is < 0");
OSL_ENSURE(nPos >= 0,"RowPos is < 0");
return nPos;
}
// -------------------------------------------------------------------------
sal_Bool SAL_CALL OStaticSet::absolute( sal_Int32 row ) throw(SQLException, RuntimeException)
{
m_bInserted = m_bUpdated = m_bDeleted = sal_False;
OSL_ENSHURE(row,"OStaticSet::absolute: INVALID row number!");
OSL_ENSURE(row,"OStaticSet::absolute: INVALID row number!");
// if row greater 0 than count from end - row means last
if(row < 0)
{
......@@ -332,8 +332,8 @@ sal_Bool SAL_CALL OStaticSet::absolute( sal_Int32 row ) throw(SQLException, Runt
else
throw SQLException();
OSL_ENSHURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSHURE(m_aSetIter <= m_aSet.end(),"Iterator behind end()!");
OSL_ENSURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSURE(m_aSetIter <= m_aSet.end(),"Iterator behind end()!");
return m_aSetIter != m_aSet.end();
}
// -------------------------------------------------------------------------
......@@ -356,7 +356,7 @@ sal_Bool SAL_CALL OStaticSet::previous( ) throw(SQLException, RuntimeException)
else
--m_aSetIter;
OSL_ENSHURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
OSL_ENSURE((m_aSet.size() - (m_aSet.end() - m_aSetIter)) >= 0,"Current row is not valid!");
return sal_True;
}
// -------------------------------------------------------------------------
......@@ -435,6 +435,9 @@ void SAL_CALL OStaticSet::moveToCurrentRow( ) throw(SQLException, RuntimeExcept
/*------------------------------------------------------------------------
$Log: not supported by cvs2svn $
Revision 1.6 2000/11/29 10:23:32 oj
#80219# wrong use of keys
Revision 1.5 2000/11/15 15:57:40 oj
change for rowset
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment