Browse Source

Fixed forum-9168: ArgumentOutOfRangeException in BooFormattingStrategy.SearchBracketForward/GapTextBufferStrategy.GetCharAt.

Fixed forum-9200: ArgumentException in ShowErrorHelpCommand.Run/IHxTopicList.ItemAt.

git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/branches/3.0@3878 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61
shortcuts
Daniel Grunwald 17 years ago
parent
commit
1d2890c1e2
  1. 24
      src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/FormattingStrategy.cs
  2. 6
      src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs

24
src/AddIns/BackendBindings/Boo/BooBinding/Project/Src/FormattingStrategy.cs

@ -185,13 +185,12 @@ namespace Grunwald.BooBinding @@ -185,13 +185,12 @@ namespace Grunwald.BooBinding
bool IsMultilineString(IDocument document, int offset)
{
try {
if ((document.GetCharAt(offset) == document.GetCharAt(offset + 1))
&& (document.GetCharAt(offset) == document.GetCharAt(offset + 2))) {
return true;
}
} catch (Exception) {
if (offset + 2 >= document.TextLength)
return false;
if ((document.GetCharAt(offset) == document.GetCharAt(offset + 1))
&& (document.GetCharAt(offset) == document.GetCharAt(offset + 2))) {
return true;
}
return false;
@ -228,17 +227,18 @@ namespace Grunwald.BooBinding @@ -228,17 +227,18 @@ namespace Grunwald.BooBinding
switch (ch) {
case '/':
if (!inMultiString && !inSingleString) {
if (document.GetCharAt(offset + 1) == '*') {
multiCommentLevel++;
}
if (document.GetCharAt(offset + 1) == '/') {
inSingleComment = true;
if (offset + 1 < document.TextLength) {
if (document.GetCharAt(offset + 1) == '*') {
multiCommentLevel++;
} else if (document.GetCharAt(offset + 1) == '/') {
inSingleComment = true;
}
}
}
break;
case '*':
if (!inMultiString && !inSingleString) {
if (document.GetCharAt(offset + 1) == '/') {
if (offset + 1 < document.TextLength && document.GetCharAt(offset + 1) == '/') {
multiCommentLevel--;
}
}

6
src/AddIns/Misc/HtmlHelp2/Project/src/Commands/ShowErrorHelpCommand.cs

@ -55,7 +55,11 @@ namespace HtmlHelp2.Commands @@ -55,7 +55,11 @@ namespace HtmlHelp2.Commands
MessageService.ShowErrorFormatted("No help available for {0}!", code);
return;
}
topic = list.ItemAt(1);
try {
topic = list.ItemAt(1);
} catch (ArgumentException) {
topic = null;
}
if (topic == null) {
MessageService.ShowErrorFormatted("No help available for {0}!", code);
return;

Loading…
Cancel
Save