Author: gschneider
Date: Wed Aug 26 15:17:02 2009
New Revision: 42936
URL:
http://svn.reactos.org/svn/reactos?rev=42936&view=rev
Log:
- The browser view's document doesn't always exist (bug #4816)
- Suppress website script errors
Modified:
trunk/tools/reactosdbg/RosDBG/Dockable Objects/ReactOSWeb.cs
trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs
Modified: trunk/tools/reactosdbg/RosDBG/Dockable Objects/ReactOSWeb.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Dockable%2…
==============================================================================
--- trunk/tools/reactosdbg/RosDBG/Dockable Objects/ReactOSWeb.cs [iso-8859-1] (original)
+++ trunk/tools/reactosdbg/RosDBG/Dockable Objects/ReactOSWeb.cs [iso-8859-1] Wed Aug 26
15:17:02 2009
@@ -19,7 +19,8 @@
InitializeComponent();
BrowserView.CanGoBackChanged += BrowserView_CanGoBackChanged;
BrowserView.CanGoForwardChanged += BrowserView_CanGoForwardChanged;
- BrowserView.GoHome();
+ BrowserView.GoHome();
+ BrowserView.ScriptErrorsSuppressed = true;
}
public ReactOSWeb(string Title, string URL)
@@ -28,7 +29,8 @@
this.Text = Title;
BrowserView.CanGoBackChanged += BrowserView_CanGoBackChanged;
BrowserView.CanGoForwardChanged += BrowserView_CanGoForwardChanged;
- BrowserView.Navigate(URL);
+ BrowserView.Navigate(URL);
+ BrowserView.ScriptErrorsSuppressed = true;
}
private void BrowserView_Navigating(object sender, WebBrowserNavigatingEventArgs
e)
@@ -85,9 +87,12 @@
private bool pIsCmdEnabled(string Cmd)
{
- IHTMLDocument2 doc2 = BrowserView.Document.DomDocument as IHTMLDocument2;
- if (doc2 != null)
- return doc2.queryCommandEnabled(Cmd);
+ if (BrowserView.Document != null)
+ {
+ IHTMLDocument2 doc2 =
(mshtml.IHTMLDocument2)BrowserView.Document.DomDocument;
+ if (doc2 != null)
+ return doc2.queryCommandEnabled(Cmd);
+ }
return false;
}
@@ -107,14 +112,20 @@
private void copyToolStripMenuItem_Click(object sender, EventArgs e)
{
- IHTMLDocument2 htmlDocument =
(mshtml.IHTMLDocument2)BrowserView.Document.DomDocument;
- htmlDocument.execCommand("copy", true, null);
+ if (BrowserView.Document != null)
+ {
+ IHTMLDocument2 htmlDocument =
(mshtml.IHTMLDocument2)BrowserView.Document.DomDocument;
+ htmlDocument.execCommand("copy", true, null);
+ }
}
private void selectAllToolStripMenuItem_Click(object sender, EventArgs e)
{
- IHTMLDocument2 htmlDocument =
(mshtml.IHTMLDocument2)BrowserView.Document.DomDocument;
- htmlDocument.execCommand("selectall", true, null);
+ if (BrowserView.Document != null)
+ {
+ IHTMLDocument2 htmlDocument =
(mshtml.IHTMLDocument2)BrowserView.Document.DomDocument;
+ htmlDocument.execCommand("selectall", true, null);
+ }
}
private void editToolStripMenuItem_Click(object sender, EventArgs e)
@@ -129,8 +140,11 @@
public override void SaveAs(string FileName)
{
- IHTMLDocument2 htmlDocument =
(mshtml.IHTMLDocument2)BrowserView.Document.DomDocument;
- htmlDocument.execCommand("saveas", true, FileName);
+ if (BrowserView.Document != null)
+ {
+ IHTMLDocument2 htmlDocument =
(mshtml.IHTMLDocument2)BrowserView.Document.DomDocument;
+ htmlDocument.execCommand("saveas", true, FileName);
+ }
}
public override string GetDocumentName()
@@ -140,9 +154,11 @@
public override void Print(bool ShowDialog)
{
- IHTMLDocument2 htmlDocument =
(mshtml.IHTMLDocument2)BrowserView.Document.DomDocument;
- htmlDocument.execCommand("print", ShowDialog, null);
+ if (BrowserView.Document != null)
+ {
+ IHTMLDocument2 htmlDocument =
(mshtml.IHTMLDocument2)BrowserView.Document.DomDocument;
+ htmlDocument.execCommand("print", ShowDialog, null);
+ }
}
-
}
}
Modified: trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs
URL:
http://svn.reactos.org/svn/reactos/trunk/tools/reactosdbg/RosDBG/Properties…
==============================================================================
--- trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs [iso-8859-1] (original)
+++ trunk/tools/reactosdbg/RosDBG/Properties/AssemblyInfo.cs [iso-8859-1] Wed Aug 26
15:17:02 2009
@@ -39,5 +39,5 @@
// will be increased as well. MSI installers must not be generated with the same Build
Number
// otherwise they won't upgrade the old installation!
-[assembly: AssemblyVersion("1.0.2.73")]
-[assembly: AssemblyFileVersion("1.0.2.73")]
+[assembly: AssemblyVersion("1.0.2.74")]
+[assembly: AssemblyFileVersion("1.0.2.74")]