From 0d07533cec6a41fbcd8ff076f4b2e7e7112d7639 Mon Sep 17 00:00:00 2001 From: donho Date: Thu, 8 Jan 2009 01:55:46 +0000 Subject: [PATCH] [BUG_FIXED] Fix localization feature bug while doLocalConf;xml is present. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository@388 f5eea248-9336-0410-98b8-ebc06183d4e3 --- PowerEditor/src/Notepad_plus.cpp | 10 ++++++---- PowerEditor/src/Parameters.cpp | 2 +- .../src/WinControls/Preference/preferenceDlg.cpp | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/PowerEditor/src/Notepad_plus.cpp b/PowerEditor/src/Notepad_plus.cpp index 6ff77b9d9..e88c9a2cf 100644 --- a/PowerEditor/src/Notepad_plus.cpp +++ b/PowerEditor/src/Notepad_plus.cpp @@ -4606,10 +4606,12 @@ bool Notepad_plus::reloadLang() ::ModifyMenu(_mainMenuHandle, indexWindow - 1, MF_BYPOSITION, 0, pluginsTrans.c_str()); } - ::ModifyMenu(_mainMenuHandle, indexWindow, MF_BYPOSITION, 0, windowTrans.c_str()); - windowTrans += TEXT("..."); - ::ModifyMenu(_mainMenuHandle, IDM_WINDOW_WINDOWS, MF_BYCOMMAND, IDM_WINDOW_WINDOWS, windowTrans.c_str()); - + if (windowTrans != TEXT("")) + { + ::ModifyMenu(_mainMenuHandle, indexWindow, MF_BYPOSITION, 0, windowTrans.c_str()); + windowTrans += TEXT("..."); + ::ModifyMenu(_mainMenuHandle, IDM_WINDOW_WINDOWS, MF_BYCOMMAND, IDM_WINDOW_WINDOWS, windowTrans.c_str()); + } // Update scintilla context menu strings vector & tmp = pNppParam->getContextMenuItems(); size_t len = tmp.size(); diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 95690d704..b4bf8be87 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -337,7 +337,7 @@ LocalizationSwicher::LocalizationSwicher() TCHAR localConfPath[MAX_PATH]; TCHAR nppPath[MAX_PATH]; ::GetModuleFileName(NULL, nppPath, MAX_PATH); - + PathRemoveFileSpec(nppPath); lstrcpy(localConfPath, nppPath); PathAppend(localConfPath, localConfFile); diff --git a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp index ce75b13a1..3d8540657 100644 --- a/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp +++ b/PowerEditor/src/WinControls/Preference/preferenceDlg.cpp @@ -175,7 +175,7 @@ BOOL CALLBACK BarsDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lParam) ::EnableWindow(::GetDlgItem(_hSelf, IDC_COMBO_LOCALIZATION), FALSE); #else LocalizationSwicher & localizationSwitcher = pNppParam->getLocalizationSwitcher(); - + for (size_t i = 0 ; i < localizationSwitcher.size() ; i++) { pair localizationInfo = localizationSwitcher.getElementFromIndex(i);