[BUG_FIXED] Fix Language Switcher not working bug while localization command option is used.

git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@1085 f5eea248-9336-0410-98b8-ebc06183d4e3
remotes/trunk
Don Ho 12 years ago
parent 1a534cd927
commit 7465e1dc8f

@ -748,12 +748,7 @@ bool NppParameters::reloadStylers(TCHAR *stylePath)
bool NppParameters::reloadLang()
{
// use user path
#ifdef UNICODE
generic_string nativeLangPath(_localizationSwitcher._nativeLangPath);
#else
generic_string nativeLangPath(_userPath);
PathAppend(nativeLangPath, generic_string(TEXT("nativeLang.xml")));
#endif
// if "nativeLang.xml" does not exist, use npp path
if (!PathFileExists(nativeLangPath.c_str()))
@ -989,21 +984,21 @@ bool NppParameters::load()
//----------------------------------------------//
generic_string nativeLangPath;
nativeLangPath = _userPath;
PathAppend(nativeLangPath, TEXT("nativeLang.xml"));
// LocalizationSwitcher should use always user path
_localizationSwitcher._nativeLangPath = nativeLangPath;
if (_startWithLocFileName != TEXT("")) // localization argument detected, use user wished localization
{
// overwrite nativeLangPath variable
nativeLangPath = _nppPath;
PathAppend(nativeLangPath, TEXT("localization\\"));
PathAppend(nativeLangPath, _startWithLocFileName);
}
else // use %appdata% location, or (if absence then) npp installed location
{
nativeLangPath = _userPath;
PathAppend(nativeLangPath, TEXT("nativeLang.xml"));
// LocalizationSwitcher should use always user path
_localizationSwitcher._nativeLangPath = nativeLangPath;
if (!PathFileExists(nativeLangPath.c_str()))
{
nativeLangPath = _nppPath;

@ -478,7 +478,6 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
{
case IDC_COMBO_LOCALIZATION :
{
#ifdef UNICODE
LocalizationSwitcher & localizationSwitcher = pNppParam->getLocalizationSwitcher();
int index = ::SendDlgItemMessage(_hSelf, IDC_COMBO_LOCALIZATION, CB_GETCURSEL, 0, 0);
wchar_t langName[MAX_PATH];
@ -498,7 +497,6 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM)
::InvalidateRect(_hParent, NULL, TRUE);
}
}
#endif
}
return TRUE;
default:

Loading…
Cancel
Save