Browse Source

Fix crash if session contained only sub-view files.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@222 f5eea248-9336-0410-98b8-ebc06183d4e3
pull/343/head^2
harrybharry 17 years ago
parent
commit
70ca7e3ff8
  1. 12
      PowerEditor/src/Notepad_plus.cpp

12
PowerEditor/src/Notepad_plus.cpp

@ -462,9 +462,9 @@ bool Notepad_plus::loadSession(Session & session)
{
bool allSessionFilesLoaded = true;
BufferID lastOpened = BUFFER_INVALID;
int oldView = currentView();
size_t i = 0;
showView(MAIN_VIEW);
switchEditViewTo(MAIN_VIEW); //open files in main
for ( ; i < session.nbMainFiles() ; )
{
@ -506,8 +506,8 @@ bool Notepad_plus::loadSession(Session & session)
}
size_t k = 0;
//switchEditViewTo(SUB_VIEW); //open files in sub
_activeView = SUB_VIEW;
showView(SUB_VIEW);
switchEditViewTo(SUB_VIEW); //open files in sub
for ( ; k < session.nbSubFiles() ; )
{
const char *pFn = session._subViewFiles[k]._fileName.c_str();
@ -558,7 +558,6 @@ bool Notepad_plus::loadSession(Session & session)
allSessionFilesLoaded = false;
}
}
_activeView = MAIN_VIEW;
_mainEditView.restoreCurrentPos();
_subEditView.restoreCurrentPos();
@ -574,6 +573,11 @@ bool Notepad_plus::loadSession(Session & session)
else
switchEditViewTo(MAIN_VIEW);
if (canHideView(otherView()))
hideView(otherView());
else if (canHideView(currentView()))
hideView(currentView());
return allSessionFilesLoaded;
}

Loading…
Cancel
Save