From 8c95c75fb70ce911a00c9f389c968a2aa12be8e8 Mon Sep 17 00:00:00 2001 From: Daniel Grunwald Date: Sat, 27 May 2006 15:01:02 +0000 Subject: [PATCH] Fixed SD2-812: Synchronising non-existent TOC git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/2.0@1433 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61 --- .../Project/src/BaseControls/TocPad.cs | 28 ++++++++++++++----- 1 file changed, 21 insertions(+), 7 deletions(-) diff --git a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs index 42f58e0546..5b62782cc9 100644 --- a/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs +++ b/src/AddIns/Misc/HtmlHelp2/Project/src/BaseControls/TocPad.cs @@ -300,7 +300,11 @@ namespace HtmlHelp2 #region published Help2 TOC Commands public void SynchronizeToc(string topicUrl) { - tocControl.Synchronize(topicUrl); + try { + tocControl.Synchronize(topicUrl); + } catch (System.Runtime.InteropServices.COMException) { + // SD2-812: ignore exception when trying to synchronize non-existing URL + } } public void GetNextFromNode() @@ -312,9 +316,14 @@ namespace HtmlHelp2 public void GetNextFromUrl(string url) { - int currentNode = tocControl.Hierarchy.GetNextFromUrl(url); - string topicUrl = tocControl.Hierarchy.GetURL(currentNode); - this.CallHelp(topicUrl, true); + try { + int currentNode = tocControl.Hierarchy.GetNextFromUrl(url); + string topicUrl = tocControl.Hierarchy.GetURL(currentNode); + this.CallHelp(topicUrl, true); + } catch (System.Runtime.InteropServices.COMException) { + } catch (ArgumentException) { + // SD2-812: ignore exception when trying to synchronize non-existing URL + } } public void GetPrevFromNode() @@ -326,9 +335,14 @@ namespace HtmlHelp2 public void GetPrevFromUrl(string url) { - int currentNode = tocControl.Hierarchy.GetPrevFromUrl(url); - string topicUrl = tocControl.Hierarchy.GetURL(currentNode); - this.CallHelp(topicUrl, true); + try { + int currentNode = tocControl.Hierarchy.GetPrevFromUrl(url); + string topicUrl = tocControl.Hierarchy.GetURL(currentNode); + this.CallHelp(topicUrl, true); + } catch (ArgumentException) { + } catch (System.Runtime.InteropServices.COMException) { + // SD2-812: ignore exception when trying to synchronize non-existing URL + } } public bool IsNotFirstNode