From 18737c7ccde2ddecc296a096e815a696b8dd3e4a Mon Sep 17 00:00:00 2001 From: Don Ho Date: Tue, 8 Jan 2013 01:00:19 +0000 Subject: [PATCH] =?UTF-8?q?[BUG=5FFIXED]=20(Author:=20Pekka=20P=C3=B6yry)?= =?UTF-8?q?=20Fix=20the=20issue=20of=20document=20focus=20after=20cancelin?= =?UTF-8?q?g=20exit=20on=20an=20unsaved=20file.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1003 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/NppIO.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 27c5c38bc..0e8a6d7fa 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -576,8 +576,9 @@ bool Notepad_plus::fileCloseAll() } else if (buf->isDirty()) { - _mainDocTab.activateBuffer(id); - _mainEditView.activateBuffer(id); + activateBuffer(id, MAIN_VIEW); + if(!activateBuffer(id, SUB_VIEW)) + switchEditViewTo(MAIN_VIEW); int res = doSaveOrNot(buf->getFullPathName()); if (res == IDYES) @@ -601,8 +602,8 @@ bool Notepad_plus::fileCloseAll() } else if (buf->isDirty()) { - _subDocTab.activateBuffer(id); - _subEditView.activateBuffer(id); + activateBuffer(id, SUB_VIEW); + switchEditViewTo(SUB_VIEW); int res = doSaveOrNot(buf->getFullPathName()); if (res == IDYES) @@ -612,7 +613,7 @@ bool Notepad_plus::fileCloseAll() } else if (res == IDCANCEL) { - return false; + return false; //otherwise continue (IDNO) } } @@ -654,8 +655,9 @@ bool Notepad_plus::fileCloseAllButCurrent() } else if (buf->isDirty()) { - _mainDocTab.activateBuffer(id); - _mainEditView.activateBuffer(id); + activateBuffer(id, MAIN_VIEW); + if(!activateBuffer(id, SUB_VIEW)) + switchEditViewTo(MAIN_VIEW); int res = doSaveOrNot(buf->getFullPathName()); if (res == IDYES) @@ -681,8 +683,8 @@ bool Notepad_plus::fileCloseAllButCurrent() } else if (buf->isDirty()) { - _subDocTab.activateBuffer(id); - _subEditView.activateBuffer(id); + activateBuffer(id, SUB_VIEW); + switchEditViewTo(SUB_VIEW); int res = doSaveOrNot(buf->getFullPathName()); if (res == IDYES)