From 1549b4f89f1f286c8b873cbb7f468af1fc144884 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 17 Oct 2010 18:41:59 +0000 Subject: [PATCH] [BUG_FIXED] Fix crash issue : crash in the next launch after setting MS-DOS-Style as default language. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@683 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 7 ++++++- PowerEditor/src/Notepad_plus.rc | 2 +- PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 3 ++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index e7c7e05cc..65320ed62 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -3949,7 +3949,12 @@ void Notepad_plus::drawTabbarColoursFromStylerArray() TabBarPlus::setColour(stInact->_bgColor, TabBarPlus::inactiveBg); } -void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask) { +void Notepad_plus::notifyBufferChanged(Buffer * buffer, int mask) +{ + // To avoid to crash while MS-DOS style is set as default language, + // Checking the validity of current instance is necessary. + if (!this) return; + NppParameters *pNppParam = NppParameters::getInstance(); const NppGUI & nppGUI = pNppParam->getNppGUI(); diff --git a/PowerEditor/src/Notepad_plus.rc b/PowerEditor/src/Notepad_plus.rc index d1f2fd4f7..4067df18c 100644 --- a/PowerEditor/src/Notepad_plus.rc +++ b/PowerEditor/src/Notepad_plus.rc @@ -185,7 +185,7 @@ BEGIN MENUITEM "Sav&e All", IDM_FILE_SAVEALL MENUITEM "Rename...", IDM_FILE_RENAME MENUITEM "&Close", IDM_FILE_CLOSE - MENUITEM "Cl&ose All", IDM_FILE_CLOSEALL + MENUITEM "Clos&e All", IDM_FILE_CLOSEALL MENUITEM "Close All but Active Document", IDM_FILE_CLOSEALL_BUT_CURRENT MENUITEM "Delete from Disk", IDM_FILE_DELETE MENUITEM SEPARATOR diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index afd2a1c9b..06fbd6393 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1501,7 +1501,8 @@ void ScintillaEditView::activateBuffer(BufferID buffer) return; //all done } -void ScintillaEditView::bufferUpdated(Buffer * buffer, int mask) { +void ScintillaEditView::bufferUpdated(Buffer * buffer, int mask) +{ //actually only care about language and lexing etc if (buffer == _currentBuffer) {