Skip to content
This repository has been archived by the owner on Oct 4, 2021. It is now read-only.

Commit

Permalink
[Ide] Handle cases where Notebook.CurrentPage is -1 (meaning "No Page").
Browse files Browse the repository at this point in the history
Fixes bug #9852.
  • Loading branch information
jstedfast committed Jan 29, 2013
1 parent b212146 commit 5b370a0
Showing 1 changed file with 8 additions and 6 deletions.
Expand Up @@ -601,13 +601,15 @@ void SetCurrentView (int newIndex)
int oldIndex = subViewNotebook.CurrentPage;
subViewNotebook.CurrentPage = newIndex;

subViewContent = viewContents[oldIndex] as IAttachableViewContent;
if (subViewContent != null)
subViewContent.Deselected ();
if (oldIndex != -1) {
subViewContent = viewContents[oldIndex] as IAttachableViewContent;
if (subViewContent != null)
subViewContent.Deselected ();

subViewContent = viewContents[newIndex] as IAttachableViewContent;
if (subViewContent != null)
subViewContent.Selected ();
subViewContent = viewContents[newIndex] as IAttachableViewContent;
if (subViewContent != null)
subViewContent.Selected ();
}

DetachFromPathedDocument ();

Expand Down

0 comments on commit 5b370a0

Please sign in to comment.