mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-14 05:45:37 +00:00
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:
parent
73ee000f7f
commit
982414f786
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user