implement nsMorkRowCellCursor::NextCell r/sr =sspitzer 114117

This commit is contained in:
bienvenu%netscape.com 2002-01-07 15:10:16 +00:00
Родитель 3214848ef3
Коммит 945dc729af
5 изменённых файлов: 56 добавлений и 30 удалений

Просмотреть файл

@ -2194,9 +2194,9 @@ public:
// { ===== begin nsIMdbRow methods =====
// { ----- begin cursor methods -----
NS_IMETHOD GetRowCellCursor( // make a cursor starting iteration at inRowPos
NS_IMETHOD GetRowCellCursor( // make a cursor starting iteration at inCellPos
nsIMdbEnv* ev, // context
mdb_pos inRowPos, // zero-based ordinal position of row in table
mdb_pos inCellPos, // zero-based ordinal position of cell in row
nsIMdbRowCellCursor** acqCursor) = 0; // acquire new cursor instance
// } ----- end cursor methods -----
@ -2337,7 +2337,7 @@ public:
// { ----- begin cell iteration methods -----
NS_IMETHOD NextCell( // get next cell in the row
nsIMdbEnv* ev, // context
nsIMdbCell* ioCell, // changes to the next cell in the iteration
nsIMdbCell** acqCell, // changes to the next cell in the iteration
mdb_column* outColumn, // column for this particular cell
mdb_pos* outPos) = 0; // position of cell in row sequence

Просмотреть файл

@ -48,11 +48,11 @@
class nsMorkFactoryFactory : public nsIMdbFactoryFactory
{
public:
nsMorkFactoryFactory();
// nsISupports methods
NS_DECL_ISUPPORTS
nsMorkFactoryFactory();
// nsISupports methods
NS_DECL_ISUPPORTS
NS_IMETHOD GetMdbFactory(nsIMdbFactory **aFactory);
NS_IMETHOD GetMdbFactory(nsIMdbFactory **aFactory);
};
@ -80,32 +80,32 @@ NS_IMPL_RELEASE(nsMorkFactoryFactory)
NS_IMETHODIMP
nsMorkFactoryFactory::QueryInterface(REFNSIID iid, void** result)
{
if (! result)
return NS_ERROR_NULL_POINTER;
*result = nsnull;
if(iid.Equals(NS_GET_IID(nsIMdbFactoryFactory)) ||
iid.Equals(NS_GET_IID(nsISupports))) {
*result = NS_STATIC_CAST(nsIMdbFactoryFactory*, this);
AddRef();
return NS_OK;
}
return NS_NOINTERFACE;
if (! result)
return NS_ERROR_NULL_POINTER;
*result = nsnull;
if(iid.Equals(NS_GET_IID(nsIMdbFactoryFactory)) ||
iid.Equals(NS_GET_IID(nsISupports))) {
*result = NS_STATIC_CAST(nsIMdbFactoryFactory*, this);
AddRef();
return NS_OK;
}
return NS_NOINTERFACE;
}
nsMorkFactoryFactory::nsMorkFactoryFactory()
{
NS_INIT_REFCNT();
NS_INIT_REFCNT();
}
NS_IMETHODIMP nsMorkFactoryFactory::GetMdbFactory(nsIMdbFactory **aFactory)
{
if (!gMDBFactory)
gMDBFactory = MakeMdbFactory();
*aFactory = gMDBFactory;
NS_IF_ADDREF(gMDBFactory);
return (gMDBFactory) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
if (!gMDBFactory)
gMDBFactory = MakeMdbFactory();
*aFactory = gMDBFactory;
NS_IF_ADDREF(gMDBFactory);
return (gMDBFactory) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
}

Просмотреть файл

@ -95,6 +95,7 @@ morkRowCellCursor::CloseMorkNode(morkEnv* ev) // CloseRowCellCursor() only if op
/*public virtual*/
morkRowCellCursor::~morkRowCellCursor() // CloseRowCellCursor() executed earlier
{
CloseMorkNode(mMorkEnv);
MORK_ASSERT(this->IsShutNode());
}
@ -278,12 +279,37 @@ morkRowCellCursor::SeekCell( // same as SetRow() followed by MakeCell()
NS_IMETHODIMP
morkRowCellCursor::NextCell( // get next cell in the row
nsIMdbEnv* mev, // context
nsIMdbCell* ioCell, // changes to the next cell in the iteration
nsIMdbCell** acqCell, // changes to the next cell in the iteration
mdb_column* outColumn, // column for this particular cell
mdb_pos* outPos)
{
NS_ASSERTION(PR_FALSE, "not implemented");
return NS_ERROR_NOT_IMPLEMENTED;
morkEnv* ev = morkEnv::FromMdbEnv(mev);
mdb_column col = 0;
mdb_pos pos = mRowCellCursor_Col;
if ( pos < 0 )
pos = 0;
else
++pos;
morkCell* cell = mRowCellCursor_RowObject->mRowObject_Row->CellAt(ev, pos);
if ( cell )
{
col = cell->GetColumn();
*acqCell = mRowCellCursor_RowObject->mRowObject_Row->AcquireCellHandle(ev, cell, col, pos);
}
else
{
*acqCell = nsnull;
pos = -1;
}
if ( outPos )
*outPos = pos;
if ( outColumn )
*outColumn = col;
mRowCellCursor_Col = pos;
*outPos = pos;
return NS_OK;
}
NS_IMETHODIMP

Просмотреть файл

@ -112,7 +112,7 @@ public: // morkRowCellCursor construction & destruction
// { ----- begin cell iteration methods -----
NS_IMETHOD NextCell( // get next cell in the row
nsIMdbEnv* ev, // context
nsIMdbCell* ioCell, // changes to the next cell in the iteration
nsIMdbCell** acqCell, // changes to the next cell in the iteration
mdb_column* outColumn, // column for this particular cell
mdb_pos* outPos); // position of cell in row sequence

Просмотреть файл

@ -229,9 +229,9 @@ morkRowObject::DropActivity( // tell collection usage no longer expected
// { ----- begin cursor methods -----
NS_IMETHODIMP
morkRowObject::GetRowCellCursor( // make a cursor starting iteration at inRowPos
morkRowObject::GetRowCellCursor( // make a cursor starting iteration at inCellPos
nsIMdbEnv* mev, // context
mdb_pos inPos, // zero-based ordinal position of row in table
mdb_pos inPos, // zero-based ordinal position of cell in row
nsIMdbRowCellCursor** acqCursor)
{
mdb_err outErr = 0;