Added method to nsITableCellLayout. Fixed QI bug

This commit is contained in:
cmanske%netscape.com 1999-08-04 02:04:45 +00:00
parent c33e5d92b5
commit cb1417e9fa
6 changed files with 44 additions and 2 deletions

View File

@ -37,6 +37,9 @@ public:
static const nsIID& GetIID() { static nsIID iid = NS_ITABLECELLAYOUT_IID; return iid; }
/** return the mapped cell's row and column indexes (starting at 0 for each) */
NS_IMETHOD GetCellIndexes(PRInt32 &aRowIndex, PRInt32 &aColIndex)=0;
/** return the mapped cell's row index (starting at 0 for the first row) */
virtual nsresult GetRowIndex(PRInt32 &aRowIndex)=0;

View File

@ -1050,13 +1050,27 @@ nsresult nsTableCellFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsITableCellLayout::GetIID())) {
*aInstancePtr = (void*)this;
*aInstancePtr = (void*) (nsITableCellLayout *)this;
return NS_OK;
} else {
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
}
/* This is primarily for editor access via nsITableLayout */
NS_IMETHODIMP
nsTableCellFrame::GetCellIndexes(PRInt32 &aRowIndex, PRInt32 &aColIndex)
{
nsresult res = GetRowIndex(aRowIndex);
if (NS_FAILED(res))
{
aColIndex = 0;
return res;
}
aColIndex = mColIndex;
return NS_OK;
}
nsresult
NS_NewTableCellFrame(nsIFrame** aNewFrame)
{

View File

@ -130,7 +130,11 @@ public:
/**
* return the cell's starting row index (starting at 0 for the first row).
* for continued cell frames the row index is that of the cell's first-in-flow
* and the column index (starting at 0 for the first column
*/
NS_IMETHOD GetCellIndexes(PRInt32 &aRowIndex, PRInt32 &aColIndex);
/** return the mapped cell's row index (starting at 0 for the first row) */
virtual nsresult GetRowIndex(PRInt32 &aRowIndex);
/**

View File

@ -37,6 +37,9 @@ public:
static const nsIID& GetIID() { static nsIID iid = NS_ITABLECELLAYOUT_IID; return iid; }
/** return the mapped cell's row and column indexes (starting at 0 for each) */
NS_IMETHOD GetCellIndexes(PRInt32 &aRowIndex, PRInt32 &aColIndex)=0;
/** return the mapped cell's row index (starting at 0 for the first row) */
virtual nsresult GetRowIndex(PRInt32 &aRowIndex)=0;

View File

@ -1050,13 +1050,27 @@ nsresult nsTableCellFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsITableCellLayout::GetIID())) {
*aInstancePtr = (void*)this;
*aInstancePtr = (void*) (nsITableCellLayout *)this;
return NS_OK;
} else {
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
}
/* This is primarily for editor access via nsITableLayout */
NS_IMETHODIMP
nsTableCellFrame::GetCellIndexes(PRInt32 &aRowIndex, PRInt32 &aColIndex)
{
nsresult res = GetRowIndex(aRowIndex);
if (NS_FAILED(res))
{
aColIndex = 0;
return res;
}
aColIndex = mColIndex;
return NS_OK;
}
nsresult
NS_NewTableCellFrame(nsIFrame** aNewFrame)
{

View File

@ -130,7 +130,11 @@ public:
/**
* return the cell's starting row index (starting at 0 for the first row).
* for continued cell frames the row index is that of the cell's first-in-flow
* and the column index (starting at 0 for the first column
*/
NS_IMETHOD GetCellIndexes(PRInt32 &aRowIndex, PRInt32 &aColIndex);
/** return the mapped cell's row index (starting at 0 for the first row) */
virtual nsresult GetRowIndex(PRInt32 &aRowIndex);
/**