context->GetTwipsToPixels(&t2p);
t2p = context->TwipsToPixels();
nsImageDocument::CheckOverflowing(){  nsIPresShell *shell = GetShellAt(0);  if (!shell) {    return NS_OK;  }  nsCOMPtr<nsIPresContext> context;  shell->GetPresContext(getter_AddRefs(context));  nsRect visibleArea = context->GetVisibleArea();  nsCOMPtr<nsIContent> content = do_QueryInterface(mBodyContent);  nsRefPtr<nsStyleContext> styleContext =    context->StyleSet()->ResolveStyleFor(content, nsnull);  const nsStyleMargin* marginData = styleContext->GetStyleMargin();  nsMargin margin;  marginData->GetMargin(margin);  visibleArea.Deflate(margin);  nsStyleBorderPadding bPad;  styleContext->GetBorderPaddingFor(bPad);  bPad.GetBorderPadding(margin);  visibleArea.Deflate(margin);  float t2p;  context->GetTwipsToPixels(&t2p);  mVisibleWidth = NSTwipsToIntPixels(visibleArea.width, t2p);  mVisibleHeight = NSTwipsToIntPixels(visibleArea.height, t2p);  mImageIsOverflowing =    mImageWidth > mVisibleWidth || mImageHeight > mVisibleHeight;  if (mImageIsOverflowing) {    ShrinkToFit();  }  else if (mImageIsResized) {    RestoreImage();  }  return NS_OK;}