Added QueryInterfaces so nsITableCellLayout and nsITableLayout can get to cell and table frames. Don't use macros because frames aren't refcounted.

This commit is contained in:
cmanske%netscape.com 1999-08-01 18:26:45 +00:00
Родитель 73ee000f7f
Коммит 982414f786
6 изменённых файлов: 92 добавлений и 6 удалений

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

@ -1010,8 +1010,21 @@ NS_METHOD nsTableCellFrame::DidSetStyleContext(nsIPresContext* aPresContext)
/* ----- global methods ----- */
NS_IMPL_ADDREF_INHERITED(nsTableCellFrame, nsHTMLContainerFrame)
NS_IMPL_RELEASE_INHERITED(nsTableCellFrame, nsHTMLContainerFrame)
NS_IMPL_ISUPPORTS_INHERITED(nsTableCellFrame, nsHTMLContainerFrame, nsITableCellLayout)
nsresult nsTableCellFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsITableCellLayout::GetIID())) {
*aInstancePtr = (void*)this;
return NS_OK;
} else {
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
}
nsresult
NS_NewTableCellFrame(nsIFrame** aNewFrame)

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

@ -292,7 +292,22 @@ nsTableFrame::nsTableFrame()
mBorderEdges.mOutsideEdge=PR_TRUE;
}
NS_IMPL_ISUPPORTS_INHERITED(nsTableFrame, nsHTMLContainerFrame, nsITableLayout)
NS_IMPL_ADDREF_INHERITED(nsTableFrame, nsHTMLContainerFrame)
NS_IMPL_RELEASE_INHERITED(nsTableFrame, nsHTMLContainerFrame)
nsresult nsTableFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsITableLayout::GetIID()))
{ // note there is no addref here, frames are not addref'd
*aInstancePtr = (void*)(nsITableLayout*)this;
return NS_OK;
} else {
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
}
NS_IMETHODIMP
nsTableFrame::Init(nsIPresContext& aPresContext,

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

@ -174,7 +174,22 @@ struct OuterTableReflowState {
/* ----------- nsTableOuterFrame ---------- */
NS_IMPL_ISUPPORTS_INHERITED(nsTableOuterFrame, nsHTMLContainerFrame, nsITableLayout)
NS_IMPL_ADDREF_INHERITED(nsTableOuterFrame, nsHTMLContainerFrame)
NS_IMPL_RELEASE_INHERITED(nsTableOuterFrame, nsHTMLContainerFrame)
nsresult nsTableOuterFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsITableLayout::GetIID()))
{ // note there is no addref here, frames are not addref'd
*aInstancePtr = (void*)(nsITableLayout*)this;
return NS_OK;
} else {
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
}
NS_IMETHODIMP nsTableOuterFrame::SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,

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

@ -1010,8 +1010,21 @@ NS_METHOD nsTableCellFrame::DidSetStyleContext(nsIPresContext* aPresContext)
/* ----- global methods ----- */
NS_IMPL_ADDREF_INHERITED(nsTableCellFrame, nsHTMLContainerFrame)
NS_IMPL_RELEASE_INHERITED(nsTableCellFrame, nsHTMLContainerFrame)
NS_IMPL_ISUPPORTS_INHERITED(nsTableCellFrame, nsHTMLContainerFrame, nsITableCellLayout)
nsresult nsTableCellFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsITableCellLayout::GetIID())) {
*aInstancePtr = (void*)this;
return NS_OK;
} else {
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
}
nsresult
NS_NewTableCellFrame(nsIFrame** aNewFrame)

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

@ -292,7 +292,22 @@ nsTableFrame::nsTableFrame()
mBorderEdges.mOutsideEdge=PR_TRUE;
}
NS_IMPL_ISUPPORTS_INHERITED(nsTableFrame, nsHTMLContainerFrame, nsITableLayout)
NS_IMPL_ADDREF_INHERITED(nsTableFrame, nsHTMLContainerFrame)
NS_IMPL_RELEASE_INHERITED(nsTableFrame, nsHTMLContainerFrame)
nsresult nsTableFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsITableLayout::GetIID()))
{ // note there is no addref here, frames are not addref'd
*aInstancePtr = (void*)(nsITableLayout*)this;
return NS_OK;
} else {
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
}
NS_IMETHODIMP
nsTableFrame::Init(nsIPresContext& aPresContext,

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

@ -174,7 +174,22 @@ struct OuterTableReflowState {
/* ----------- nsTableOuterFrame ---------- */
NS_IMPL_ISUPPORTS_INHERITED(nsTableOuterFrame, nsHTMLContainerFrame, nsITableLayout)
NS_IMPL_ADDREF_INHERITED(nsTableOuterFrame, nsHTMLContainerFrame)
NS_IMPL_RELEASE_INHERITED(nsTableOuterFrame, nsHTMLContainerFrame)
nsresult nsTableOuterFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
{
if (NULL == aInstancePtr) {
return NS_ERROR_NULL_POINTER;
}
if (aIID.Equals(nsITableLayout::GetIID()))
{ // note there is no addref here, frames are not addref'd
*aInstancePtr = (void*)(nsITableLayout*)this;
return NS_OK;
} else {
return nsHTMLContainerFrame::QueryInterface(aIID, aInstancePtr);
}
}
NS_IMETHODIMP nsTableOuterFrame::SetInitialChildList(nsIPresContext& aPresContext,
nsIAtom* aListName,