*aInstancePtr = NS_STATIC_CAST(void*, NS_STATIC_CAST(nsBlockFrame*, this));
*aInstancePtr = (void*) (this);
nsBlockFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr){  NS_PRECONDITION(aInstancePtr, "null out param");  if (aIID.Equals(kBlockFrameCID)) {    *aInstancePtr = NS_STATIC_CAST(void*, NS_STATIC_CAST(nsBlockFrame*, this));    return NS_OK;  }  if (aIID.Equals(NS_GET_IID(nsILineIterator)) ||      aIID.Equals(NS_GET_IID(nsILineIteratorNavigator)))  {    nsLineIterator* it = new nsLineIterator;    if (!it) {      *aInstancePtr = nsnull;      return NS_ERROR_OUT_OF_MEMORY;    }    NS_ADDREF(it); // reference passed to caller    const nsStyleVisibility* visibility = GetStyleVisibility();    nsresult rv = it->Init(mLines,                           visibility->mDirection == NS_STYLE_DIRECTION_RTL);    if (NS_FAILED(rv)) {      NS_RELEASE(it);      return rv;    }    *aInstancePtr = NS_STATIC_CAST(void*,            NS_STATIC_CAST(nsILineIteratorNavigator*, it));    return NS_OK;  }  return nsBlockFrameSuper::QueryInterface(aIID, aInstancePtr);}