embedding/tests/mfcembed/BrowserView.cpp - Revision 1.24

There were 4 changes made.
Legend
   Added lines
   Changed lines
   Removed lines

embedding/tests/mfcembed/BrowserView.cpp,1.24
.
Disk File
Skipping to line 152. 
 
.
 
    m_bUrlBarClipOp = FALSE;
.
    m_bUrlBarClipOp = FALSE;
    m_bCurrentlyPrinting = FALSE;
.
    m_bCurrentlyPrinting = FALSE;
 
.
 
    m_SecurityState = SECURITY_STATE_INSECURE;
.
    m_SecurityState = SECURITY_STATE_INSECURE;
 
.
 
    m_PrintSettings = (nsIPrintSettings*)new nsPrintSettings();
.
 
}
.
}
 
.
 
CBrowserView::~CBrowserView()
.
CBrowserView::~CBrowserView()
{
.
{
}
.
}
Skipping to line 266. 
							    NS_GET_IID(nsIWebProgressListener));
.
							    NS_GET_IID(nsIWebProgressListener));
 
.
 
	// Finally, show the web browser window
.
	// Finally, show the web browser window
	mBaseWindow->SetVisibility(PR_TRUE);
.
	mBaseWindow->SetVisibility(PR_TRUE);
 
.
 
 
.
	nsCOMPtr<nsIWebBrowserPrint> print(do_GetInterface(mWebBrowser));
 
.
  if (print) {
 
.
    print->GetPrintSettings(getter_AddRefs(m_PrintSettings));
 
.
  }
 
.
 
	return S_OK;
.
	return S_OK;
}
.
}
 
.
 
HRESULT CBrowserView::DestroyBrowser() 
.
HRESULT CBrowserView::DestroyBrowser() 
{	   
.
{	   
Skipping to line 1029. 
  } else {
.
  } else {
    return 0.5;
.
    return 0.5;
  }
.
  }
}
.
}
 
.
 
 
.
static PRUnichar* GetUnicodeFromCString(const CString& aStr)
 
.
{
 
.
  nsString str;
 
.
  str.AssignWithConversion(LPCSTR(aStr));
 
.
  return ToNewUnicode(str);
 
.
}
 
.
 
void CBrowserView::OnFilePrintSetup()
.
void CBrowserView::OnFilePrintSetup()
{
.
{
  CPrintSetupDialog  dlg(m_PrintSettings);
.
  CPrintSetupDialog  dlg(m_PrintSettings);
  if (dlg.DoModal() == IDOK && m_PrintSettings != NULL) {
.
  if (dlg.DoModal() == IDOK && m_PrintSettings != NULL) {
    m_PrintSettings->SetMarginTop(GetFloatFromStr(dlg.m_TopMargin));
.
    m_PrintSettings->SetMarginTop(GetFloatFromStr(dlg.m_TopMargin));
Skipping to line 1048. 
    m_PrintSettings->SetMarginBottom(GetFloatFromStr(dlg.m_BottomMargin));
.
    m_PrintSettings->SetMarginBottom(GetFloatFromStr(dlg.m_BottomMargin));
 
.
 
    m_PrintSettings->SetScaling(double(dlg.m_Scaling) / 100.0);
.
    m_PrintSettings->SetScaling(double(dlg.m_Scaling) / 100.0);
    m_PrintSettings->SetPrintBGColors(dlg.m_PrintBGColors);
.
    m_PrintSettings->SetPrintBGColors(dlg.m_PrintBGColors);
    m_PrintSettings->SetPrintBGColors(dlg.m_PrintBGImages);
.
    m_PrintSettings->SetPrintBGColors(dlg.m_PrintBGImages);
 
.
 
 
.
    short  type;
 
.
    double width;
 
.
    double height;
 
.
    dlg.GetPaperSizeInfo(type, width, height);
 
.
    m_PrintSettings->SetPaperSizeType(type);
 
.
    m_PrintSettings->SetPaperWidth(width);
 
.
    m_PrintSettings->SetPaperHeight(height);
 
.
 
 
.
    PRUnichar* uStr;
 
.
    uStr = GetUnicodeFromCString(dlg.m_HeaderLeft);
 
.
    m_PrintSettings->SetHeaderStrLeft(uStr);
 
.
    if (uStr != nsnull) nsMemory::Free(uStr);
 
.
 
 
.
    uStr = GetUnicodeFromCString(dlg.m_HeaderMiddle);
 
.
    m_PrintSettings->SetHeaderStrCenter(uStr);
 
.
    if (uStr != nsnull) nsMemory::Free(uStr);
 
.
 
 
.
    uStr = GetUnicodeFromCString(dlg.m_HeaderRight);
 
.
    m_PrintSettings->SetHeaderStrRight(uStr);
 
.
    if (uStr != nsnull) nsMemory::Free(uStr);
 
.
 
 
.
    uStr = GetUnicodeFromCString(dlg.m_FooterLeft);
 
.
    m_PrintSettings->SetFooterStrLeft(uStr);
 
.
    if (uStr != nsnull) nsMemory::Free(uStr);
 
.
 
 
.
    uStr = GetUnicodeFromCString(dlg.m_FooterMiddle);
 
.
    m_PrintSettings->SetFooterStrCenter(uStr);
 
.
    if (uStr != nsnull) nsMemory::Free(uStr);
 
.
 
 
.
    uStr = GetUnicodeFromCString(dlg.m_FooterRight);
 
.
    m_PrintSettings->SetFooterStrRight(uStr);
 
.
    if (uStr != nsnull) nsMemory::Free(uStr);
 
.
 
  }
.
  }
}
.
}
 
.
 
/////////////////////////////////////////////////////////////////////////////
.
/////////////////////////////////////////////////////////////////////////////
void CBrowserView::OnUpdateFilePrint(CCmdUI* pCmdUI)
.
void CBrowserView::OnUpdateFilePrint(CCmdUI* pCmdUI)