From 1f33dd89f1090e134aab382c717ac39372eabfbe Mon Sep 17 00:00:00 2001 From: Don Ho Date: Thu, 28 May 2009 23:18:28 +0000 Subject: [PATCH] [BUG_FIXED] Fix the localization switcher bug while w/o doLocalConf.xml. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@484 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Parameters.cpp | 7 +++++-- PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp | 6 +++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 8b579b2ab..c1d183b3e 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -592,12 +592,15 @@ bool NppParameters::reloadStylers(TCHAR *stylePath) bool NppParameters::reloadLang() { TCHAR nativeLangPath[MAX_PATH]; - lstrcpy(nativeLangPath, _userPath); + lstrcpy(nativeLangPath, _nppPath); PathAppend(nativeLangPath, TEXT("nativeLang.xml")); if (!PathFileExists(nativeLangPath)) { - return false; + lstrcpy(nativeLangPath, _userPath); + PathAppend(nativeLangPath, TEXT("nativeLang.xml")); + if (!PathFileExists(nativeLangPath)) + return false; } if (_pXmlNativeLangDocA) diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp index f23a27b9a..bd3396bdd 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.cpp @@ -1087,10 +1087,10 @@ void ScintillaEditView::defineDocType(LangType typeDoc) { if (getCurrentBuffer()->getUnicodeMode() == uni8Bit) { - if (typeDoc != L_CSS || typeDoc != L_CAML || typeDoc != L_ASM || typeDoc != L_MATLAB) - execute(SCI_SETCODEPAGE, _codepage); - else + if (typeDoc == L_CSS || typeDoc == L_CAML || typeDoc == L_ASM || typeDoc == L_MATLAB) execute(SCI_SETCODEPAGE, CP_ACP); + else + execute(SCI_SETCODEPAGE, _codepage); } }