GetDoingPrintPreview(&is_in_print_preview);
GetDoingPrint(&is_in_print_mode);
DocumentViewerImpl::Hide(void){  PRBool is_in_print_preview = PR_FALSE;  GetDoingPrintPreview(&is_in_print_preview);  if (is_in_print_preview) {    // If we, or one of our parents, is in print preview mode it means    // we're right now returning from print preview and the layout    // frame that was created for this document is being destroyed. In    // such a case we ignore the Hide() call.    return NS_OK;  }  NS_ENSURE_TRUE(mDocument, NS_ERROR_NOT_AVAILABLE);  NS_PRECONDITION(mWindow, "null window");  if (mWindow) {    mWindow->Show(PR_FALSE);  }  if (!mPresShell || mIsDoingPrintPreview) {    return NS_OK;  }  // Avoid leaking the old viewer.  if (mPreviousViewer) {    mPreviousViewer->Destroy();    mPreviousViewer = nsnull;  }  if (mDeviceContext)    mDeviceContext->FlushFontCache();  // Break circular reference (or something)  mPresShell->EndObservingDocument();  nsCOMPtr<nsISelection> selection;  GetDocumentSelection(getter_AddRefs(selection));  nsCOMPtr<nsISelectionPrivate> selPrivate(do_QueryInterface(selection));  if (selPrivate && mSelectionListener)    selPrivate->RemoveSelectionListener(mSelectionListener);  nsCOMPtr<nsIXULDocument> xul_doc(do_QueryInterface(mDocument));  if (xul_doc) {    xul_doc->ClearBoxObjectTable();  }  mPresShell->Destroy();  mPresShell     = nsnull;  mPresContext   = nsnull;  mViewManager   = nsnull;  mWindow        = nsnull;  mDeviceContext = nsnull;  mParentWidget  = nsnull;  nsCOMPtr<nsIBaseWindow> base_win(do_QueryInterface(mContainer));  if (base_win) {    base_win->SetParentWidget(nsnull);  }  return NS_OK;}