mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-25 23:05:13 +02:00
Use wide char version's function directely (part2)
ref: https://github.com/notepad-plus-plus/notepad-plus-plus/pull/12613#discussion_r1045153278
This commit is contained in:
parent
432dcb7f15
commit
6140865351
@ -275,7 +275,7 @@ bool isInList(const TCHAR *token, const TCHAR *list)
|
|||||||
word[j] = '\0';
|
word[j] = '\0';
|
||||||
j = 0;
|
j = 0;
|
||||||
|
|
||||||
if (!generic_stricmp(token, word))
|
if (!wcsicmp(token, word))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -37,24 +37,13 @@ const bool dirDown = false;
|
|||||||
#define BCKGRD_COLOR (RGB(255,102,102))
|
#define BCKGRD_COLOR (RGB(255,102,102))
|
||||||
#define TXT_COLOR (RGB(255,255,255))
|
#define TXT_COLOR (RGB(255,255,255))
|
||||||
|
|
||||||
#define generic_strncpy wcsncpy
|
|
||||||
#define generic_stricmp wcsicmp
|
|
||||||
#define generic_strncmp wcsncmp
|
|
||||||
#define generic_strnicmp wcsnicmp
|
|
||||||
#define generic_strncat wcsncat
|
|
||||||
#define generic_strchr wcschr
|
|
||||||
#define generic_atoi _wtoi
|
#define generic_atoi _wtoi
|
||||||
#define generic_itoa _itow
|
#define generic_itoa _itow
|
||||||
#define generic_atof _wtof
|
|
||||||
#define generic_strtok wcstok
|
|
||||||
#define generic_strftime wcsftime
|
|
||||||
#define generic_fprintf fwprintf
|
#define generic_fprintf fwprintf
|
||||||
#define generic_sprintf swprintf
|
#define generic_sprintf swprintf
|
||||||
#define generic_sscanf swscanf
|
|
||||||
#define generic_fopen _wfopen
|
#define generic_fopen _wfopen
|
||||||
#define generic_fgets fgetws
|
|
||||||
#define COPYDATA_FILENAMES COPYDATA_FILENAMESW
|
#define NPP_INTERNAL_FUCTION_STR L"Notepad++::InternalFunction"
|
||||||
#define NPP_INTERNAL_FUCTION_STR TEXT("Notepad++::InternalFunction")
|
|
||||||
|
|
||||||
typedef std::basic_string<TCHAR> generic_string;
|
typedef std::basic_string<TCHAR> generic_string;
|
||||||
typedef std::basic_stringstream<TCHAR> generic_stringstream;
|
typedef std::basic_stringstream<TCHAR> generic_stringstream;
|
||||||
|
@ -365,7 +365,7 @@ bool PluginsManager::loadPlugins(const TCHAR* dir, const PluginViewList* pluginU
|
|||||||
if (hFindFolder != INVALID_HANDLE_VALUE && (foundData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
if (hFindFolder != INVALID_HANDLE_VALUE && (foundData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY))
|
||||||
{
|
{
|
||||||
generic_string foundFileName = foundData.cFileName;
|
generic_string foundFileName = foundData.cFileName;
|
||||||
if (foundFileName != TEXT(".") && foundFileName != TEXT("..") && generic_stricmp(foundFileName.c_str(), TEXT("Config")) != 0)
|
if (foundFileName != TEXT(".") && foundFileName != TEXT("..") && wcsicmp(foundFileName.c_str(), TEXT("Config")) != 0)
|
||||||
{
|
{
|
||||||
generic_string pluginsFullPathFilter = pluginsFolder;
|
generic_string pluginsFullPathFilter = pluginsFolder;
|
||||||
pathAppend(pluginsFullPathFilter, foundFileName);
|
pathAppend(pluginsFullPathFilter, foundFileName);
|
||||||
@ -437,7 +437,7 @@ bool PluginsManager::loadPlugins(const TCHAR* dir, const PluginViewList* pluginU
|
|||||||
while (::FindNextFile(hFindFolder, &foundData))
|
while (::FindNextFile(hFindFolder, &foundData))
|
||||||
{
|
{
|
||||||
generic_string foundFileName2 = foundData.cFileName;
|
generic_string foundFileName2 = foundData.cFileName;
|
||||||
if (foundFileName2 != TEXT(".") && foundFileName2 != TEXT("..") && generic_stricmp(foundFileName2.c_str(), TEXT("Config")) != 0)
|
if (foundFileName2 != TEXT(".") && foundFileName2 != TEXT("..") && wcsicmp(foundFileName2.c_str(), TEXT("Config")) != 0)
|
||||||
{
|
{
|
||||||
generic_string pluginsFullPathFilter2 = pluginsFolder;
|
generic_string pluginsFullPathFilter2 = pluginsFolder;
|
||||||
pathAppend(pluginsFullPathFilter2, foundFileName2);
|
pathAppend(pluginsFullPathFilter2, foundFileName2);
|
||||||
@ -677,7 +677,7 @@ void PluginsManager::runPluginCommand(const TCHAR *pluginName, int commandID)
|
|||||||
{
|
{
|
||||||
for (size_t i = 0, len = _pluginsCommands.size() ; i < len ; ++i)
|
for (size_t i = 0, len = _pluginsCommands.size() ; i < len ; ++i)
|
||||||
{
|
{
|
||||||
if (!generic_stricmp(_pluginsCommands[i]._pluginName.c_str(), pluginName))
|
if (!wcsicmp(_pluginsCommands[i]._pluginName.c_str(), pluginName))
|
||||||
{
|
{
|
||||||
if (_pluginsCommands[i]._funcID == commandID)
|
if (_pluginsCommands[i]._funcID == commandID)
|
||||||
{
|
{
|
||||||
|
@ -151,7 +151,7 @@ private:
|
|||||||
|
|
||||||
bool isInLoadedDlls(const TCHAR *fn) const {
|
bool isInLoadedDlls(const TCHAR *fn) const {
|
||||||
for (size_t i = 0; i < _loadedDlls.size(); ++i)
|
for (size_t i = 0; i < _loadedDlls.size(); ++i)
|
||||||
if (generic_stricmp(fn, _loadedDlls[i]._fileName.c_str()) == 0)
|
if (wcsicmp(fn, _loadedDlls[i]._fileName.c_str()) == 0)
|
||||||
return true;
|
return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -232,7 +232,7 @@ intptr_t CALLBACK RegExtDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
|
|||||||
{
|
{
|
||||||
for (int i = 1 ; i < nbExtMax ; ++i)
|
for (int i = 1 ; i < nbExtMax ; ++i)
|
||||||
{
|
{
|
||||||
if (!generic_stricmp(ext2Sup, defExtArray[langIndex][i]))
|
if (!wcsicmp(ext2Sup, defExtArray[langIndex][i]))
|
||||||
{
|
{
|
||||||
::SendDlgItemMessage(_hSelf, IDC_REGEXT_LANGEXT_LIST, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(ext2Sup));
|
::SendDlgItemMessage(_hSelf, IDC_REGEXT_LANGEXT_LIST, LB_ADDSTRING, 0, reinterpret_cast<LPARAM>(ext2Sup));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@ -280,7 +280,7 @@ intptr_t CALLBACK RegExtDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM lPa
|
|||||||
|
|
||||||
::SendDlgItemMessage(_hSelf, LOWORD(wParam), LB_GETTEXT, i, reinterpret_cast<LPARAM>(itemName));
|
::SendDlgItemMessage(_hSelf, LOWORD(wParam), LB_GETTEXT, i, reinterpret_cast<LPARAM>(itemName));
|
||||||
|
|
||||||
if (!generic_stricmp(defExtArray[nbSupportedLang-1][0], itemName))
|
if (!wcsicmp(defExtArray[nbSupportedLang-1][0], itemName))
|
||||||
{
|
{
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_REGEXT_LANGEXT_LIST), SW_HIDE);
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_REGEXT_LANGEXT_LIST), SW_HIDE);
|
||||||
::ShowWindow(::GetDlgItem(_hSelf, IDC_CUSTOMEXT_EDIT), SW_SHOW);
|
::ShowWindow(::GetDlgItem(_hSelf, IDC_CUSTOMEXT_EDIT), SW_SHOW);
|
||||||
|
@ -2755,7 +2755,7 @@ void Notepad_plus::findMatchingBracePos(intptr_t& braceAtCaret, intptr_t& braceO
|
|||||||
charBefore = TCHAR(_pEditView->execute(SCI_GETCHARAT, caretPos - 1, 0));
|
charBefore = TCHAR(_pEditView->execute(SCI_GETCHARAT, caretPos - 1, 0));
|
||||||
}
|
}
|
||||||
// Priority goes to character before caret
|
// Priority goes to character before caret
|
||||||
if (charBefore && generic_strchr(TEXT("[](){}"), charBefore))
|
if (charBefore && wcschr(L"[](){}", charBefore))
|
||||||
{
|
{
|
||||||
braceAtCaret = caretPos - 1;
|
braceAtCaret = caretPos - 1;
|
||||||
}
|
}
|
||||||
@ -2764,7 +2764,7 @@ void Notepad_plus::findMatchingBracePos(intptr_t& braceAtCaret, intptr_t& braceO
|
|||||||
{
|
{
|
||||||
// No brace found so check other side
|
// No brace found so check other side
|
||||||
TCHAR charAfter = TCHAR(_pEditView->execute(SCI_GETCHARAT, caretPos, 0));
|
TCHAR charAfter = TCHAR(_pEditView->execute(SCI_GETCHARAT, caretPos, 0));
|
||||||
if (charAfter && generic_strchr(TEXT("[](){}"), charAfter))
|
if (charAfter && wcschr(L"[](){}", charAfter))
|
||||||
{
|
{
|
||||||
braceAtCaret = caretPos;
|
braceAtCaret = caretPos;
|
||||||
}
|
}
|
||||||
@ -2954,7 +2954,7 @@ bool isUrlSchemeSupported(INTERNET_SCHEME s, TCHAR *url)
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
while (p [i] && (p [i] != ' ')) i++;
|
while (p [i] && (p [i] != ' ')) i++;
|
||||||
if (i == 0) return false;
|
if (i == 0) return false;
|
||||||
if (generic_strnicmp (url, p, i) == 0) return true;
|
if (wcsnicmp(url, p, i) == 0) return true;
|
||||||
p += i;
|
p += i;
|
||||||
while (*p == ' ') p++;
|
while (*p == ' ') p++;
|
||||||
}
|
}
|
||||||
@ -5067,7 +5067,7 @@ bool Notepad_plus::doBlockComment(comment_mode currCommentMode)
|
|||||||
{
|
{
|
||||||
// In order to do get case insensitive comparison use strnicmp() instead case-sensitive comparison.
|
// In order to do get case insensitive comparison use strnicmp() instead case-sensitive comparison.
|
||||||
// Case insensitive comparison is needed e.g. for "REM" and "rem" in Batchfiles.
|
// Case insensitive comparison is needed e.g. for "REM" and "rem" in Batchfiles.
|
||||||
if (generic_strnicmp(linebufStr.c_str(), comment.c_str(), !(buf->getLangType() == L_BAANC) ? comment_length - 1 : comment_length) == 0)
|
if (wcsnicmp(linebufStr.c_str(), comment.c_str(), !(buf->getLangType() == L_BAANC) ? comment_length - 1 : comment_length) == 0)
|
||||||
{
|
{
|
||||||
size_t len = linebufStr[comment_length - 1] == aSpace[0] ? comment_length : !(buf->getLangType() == L_BAANC) ? comment_length - 1 : comment_length;
|
size_t len = linebufStr[comment_length - 1] == aSpace[0] ? comment_length : !(buf->getLangType() == L_BAANC) ? comment_length - 1 : comment_length;
|
||||||
|
|
||||||
@ -5103,8 +5103,8 @@ bool Notepad_plus::doBlockComment(comment_mode currCommentMode)
|
|||||||
}
|
}
|
||||||
else // isSingleLineAdvancedMode
|
else // isSingleLineAdvancedMode
|
||||||
{
|
{
|
||||||
if ((generic_strnicmp(linebufStr.c_str(), advCommentStart.c_str(), advCommentStart_length - 1) == 0) &&
|
if ((wcsnicmp(linebufStr.c_str(), advCommentStart.c_str(), advCommentStart_length - 1) == 0) &&
|
||||||
(generic_strnicmp(linebufStr.substr(linebufStr.length() - advCommentEnd_length + 1, advCommentEnd_length - 1).c_str(), advCommentEnd.substr(1, advCommentEnd_length - 1).c_str(), advCommentEnd_length - 1) == 0))
|
(wcsnicmp(linebufStr.substr(linebufStr.length() - advCommentEnd_length + 1, advCommentEnd_length - 1).c_str(), advCommentEnd.substr(1, advCommentEnd_length - 1).c_str(), advCommentEnd_length - 1) == 0))
|
||||||
{
|
{
|
||||||
size_t startLen = linebufStr[advCommentStart_length - 1] == aSpace[0] ? advCommentStart_length : advCommentStart_length - 1;
|
size_t startLen = linebufStr[advCommentStart_length - 1] == aSpace[0] ? advCommentStart_length : advCommentStart_length - 1;
|
||||||
size_t endLen = linebufStr[linebufStr.length() - advCommentEnd_length] == aSpace[0] ? advCommentEnd_length : advCommentEnd_length - 1;
|
size_t endLen = linebufStr[linebufStr.length() - advCommentEnd_length] == aSpace[0] ? advCommentEnd_length : advCommentEnd_length - 1;
|
||||||
@ -5929,7 +5929,7 @@ bool Notepad_plus::getIntegralDockingData(tTbData & dockData, int & iCont, bool
|
|||||||
{
|
{
|
||||||
const PluginDlgDockingInfo & pddi = dockingData._pluginDockInfo[i];
|
const PluginDlgDockingInfo & pddi = dockingData._pluginDockInfo[i];
|
||||||
|
|
||||||
if (!generic_stricmp(pddi._name.c_str(), dockData.pszModuleName) && (pddi._internalID == dockData.dlgID))
|
if (!wcsicmp(pddi._name.c_str(), dockData.pszModuleName) && (pddi._internalID == dockData.dlgID))
|
||||||
{
|
{
|
||||||
iCont = pddi._currContainer;
|
iCont = pddi._currContainer;
|
||||||
isVisible = pddi._isVisible;
|
isVisible = pddi._isVisible;
|
||||||
@ -8364,7 +8364,7 @@ bool Notepad_plus::undoStreamComment(bool tryBlockComment)
|
|||||||
//-- First delete end-comment, so that posStartCommentBefore does not change!
|
//-- First delete end-comment, so that posStartCommentBefore does not change!
|
||||||
//-- Get character before end-comment to decide, if there is a white character before the end-comment, which will be removed too!
|
//-- Get character before end-comment to decide, if there is a white character before the end-comment, which will be removed too!
|
||||||
_pEditView->getGenericText(charbuf, charbufLen, posEndComment-1, posEndComment);
|
_pEditView->getGenericText(charbuf, charbufLen, posEndComment-1, posEndComment);
|
||||||
if (generic_strncmp(charbuf, white_space.c_str(), white_space.length()) == 0)
|
if (wcsncmp(charbuf, white_space.c_str(), white_space.length()) == 0)
|
||||||
{
|
{
|
||||||
endCommentLength +=1;
|
endCommentLength +=1;
|
||||||
posEndComment-=1;
|
posEndComment-=1;
|
||||||
@ -8376,7 +8376,7 @@ bool Notepad_plus::undoStreamComment(bool tryBlockComment)
|
|||||||
|
|
||||||
//-- Get character after start-comment to decide, if there is a white character after the start-comment, which will be removed too!
|
//-- Get character after start-comment to decide, if there is a white character after the start-comment, which will be removed too!
|
||||||
_pEditView->getGenericText(charbuf, charbufLen, posStartComment+startCommentLength, posStartComment+startCommentLength+1);
|
_pEditView->getGenericText(charbuf, charbufLen, posStartComment+startCommentLength, posStartComment+startCommentLength+1);
|
||||||
if (generic_strncmp(charbuf, white_space.c_str(), white_space.length()) == 0)
|
if (wcsncmp(charbuf, white_space.c_str(), white_space.length()) == 0)
|
||||||
startCommentLength +=1;
|
startCommentLength +=1;
|
||||||
|
|
||||||
//-- Delete starting stream-comment string ---------
|
//-- Delete starting stream-comment string ---------
|
||||||
|
@ -744,16 +744,6 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case COPYDATA_FILENAMESA:
|
|
||||||
{
|
|
||||||
char *fileNamesA = static_cast<char *>(pCopyData->lpData);
|
|
||||||
const CmdLineParamsDTO & cmdLineParams = nppParam.getCmdLineParams();
|
|
||||||
WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance();
|
|
||||||
const wchar_t *fileNamesW = wmc.char2wchar(fileNamesA, CP_ACP);
|
|
||||||
loadCommandlineParams(fileNamesW, &cmdLineParams);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case COPYDATA_FILENAMESW:
|
case COPYDATA_FILENAMESW:
|
||||||
{
|
{
|
||||||
wchar_t *fileNamesW = static_cast<wchar_t *>(pCopyData->lpData);
|
wchar_t *fileNamesW = static_cast<wchar_t *>(pCopyData->lpData);
|
||||||
@ -2616,12 +2606,12 @@ LRESULT Notepad_plus::process(HWND hwnd, UINT message, WPARAM wParam, LPARAM lPa
|
|||||||
std::vector<tTbData *> tbData = dockContainer[i]->getDataOfAllTb();
|
std::vector<tTbData *> tbData = dockContainer[i]->getDataOfAllTb();
|
||||||
for (size_t j = 0, len2 = tbData.size() ; j < len2 ; ++j)
|
for (size_t j = 0, len2 = tbData.size() ; j < len2 ; ++j)
|
||||||
{
|
{
|
||||||
if (generic_stricmp(moduleName, tbData[j]->pszModuleName) == 0)
|
if (wcsicmp(moduleName, tbData[j]->pszModuleName) == 0)
|
||||||
{
|
{
|
||||||
if (!windowName)
|
if (!windowName)
|
||||||
return (LRESULT)tbData[j]->hClient;
|
return (LRESULT)tbData[j]->hClient;
|
||||||
|
|
||||||
if (generic_stricmp(windowName, tbData[j]->pszName) == 0)
|
if (wcsicmp(windowName, tbData[j]->pszName) == 0)
|
||||||
return (LRESULT)tbData[j]->hClient;
|
return (LRESULT)tbData[j]->hClient;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1609,7 +1609,7 @@ bool Notepad_plus::fileSave(BufferID id)
|
|||||||
today = localtime(<ime);
|
today = localtime(<ime);
|
||||||
if (today)
|
if (today)
|
||||||
{
|
{
|
||||||
generic_strftime(tmpbuf, temBufLen, TEXT("%Y-%m-%d_%H%M%S"), today);
|
wcsftime(tmpbuf, temBufLen, L"%Y-%m-%d_%H%M%S", today);
|
||||||
|
|
||||||
fn_bak += name;
|
fn_bak += name;
|
||||||
fn_bak += TEXT(".");
|
fn_bak += TEXT(".");
|
||||||
@ -2034,7 +2034,7 @@ bool Notepad_plus::isFileSession(const TCHAR * filename)
|
|||||||
}
|
}
|
||||||
usrSessionExt += definedSessionExt;
|
usrSessionExt += definedSessionExt;
|
||||||
|
|
||||||
if (!generic_stricmp(pExt, usrSessionExt.c_str()))
|
if (!wcsicmp(pExt, usrSessionExt.c_str()))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -2058,7 +2058,7 @@ bool Notepad_plus::isFileWorkspace(const TCHAR * filename)
|
|||||||
}
|
}
|
||||||
usrWorkspaceExt += definedWorkspaceExt;
|
usrWorkspaceExt += definedWorkspaceExt;
|
||||||
|
|
||||||
if (!generic_stricmp(pExt, usrWorkspaceExt.c_str()))
|
if (!wcsicmp(pExt, usrWorkspaceExt.c_str()))
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -267,7 +267,7 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
|||||||
quotFileName += _pEditView->getCurrentBuffer()->getFullPathName();
|
quotFileName += _pEditView->getCurrentBuffer()->getFullPathName();
|
||||||
quotFileName += TEXT("\"");
|
quotFileName += TEXT("\"");
|
||||||
COPYDATASTRUCT fileNamesData{};
|
COPYDATASTRUCT fileNamesData{};
|
||||||
fileNamesData.dwData = COPYDATA_FILENAMES;
|
fileNamesData.dwData = COPYDATA_FILENAMESW;
|
||||||
fileNamesData.lpData = (void *)quotFileName.c_str();
|
fileNamesData.lpData = (void *)quotFileName.c_str();
|
||||||
fileNamesData.cbData = long(quotFileName.length() + 1)*(sizeof(TCHAR));
|
fileNamesData.cbData = long(quotFileName.length() + 1)*(sizeof(TCHAR));
|
||||||
|
|
||||||
|
@ -1680,7 +1680,7 @@ const TCHAR* NppParameters::getUserDefinedLangNameFromExt(TCHAR *ext, TCHAR *ful
|
|||||||
// Force to use dark mode UDL in dark mode or to use light mode UDL in light mode
|
// Force to use dark mode UDL in dark mode or to use light mode UDL in light mode
|
||||||
for (size_t j = 0, len = extVect.size(); j < len; ++j)
|
for (size_t j = 0, len = extVect.size(); j < len; ++j)
|
||||||
{
|
{
|
||||||
if (!generic_stricmp(extVect[j].c_str(), ext) || (wcschr(fullName, '.') && !generic_stricmp(extVect[j].c_str(), fullName)))
|
if (!wcsicmp(extVect[j].c_str(), ext) || (wcschr(fullName, '.') && !wcsicmp(extVect[j].c_str(), fullName)))
|
||||||
{
|
{
|
||||||
// preserve ext matched UDL
|
// preserve ext matched UDL
|
||||||
iMatched = i;
|
iMatched = i;
|
||||||
@ -2033,7 +2033,7 @@ int NppParameters::getCmdIdFromMenuEntryItemName(HMENU mainMenuHadle, const gene
|
|||||||
{
|
{
|
||||||
TCHAR menuEntryString[64];
|
TCHAR menuEntryString[64];
|
||||||
::GetMenuString(mainMenuHadle, i, menuEntryString, 64, MF_BYPOSITION);
|
::GetMenuString(mainMenuHadle, i, menuEntryString, 64, MF_BYPOSITION);
|
||||||
if (generic_stricmp(menuEntryName.c_str(), purgeMenuItemString(menuEntryString).c_str()) == 0)
|
if (wcsicmp(menuEntryName.c_str(), purgeMenuItemString(menuEntryString).c_str()) == 0)
|
||||||
{
|
{
|
||||||
vector< pair<HMENU, int> > parentMenuPos;
|
vector< pair<HMENU, int> > parentMenuPos;
|
||||||
HMENU topMenu = ::GetSubMenu(mainMenuHadle, i);
|
HMENU topMenu = ::GetSubMenu(mainMenuHadle, i);
|
||||||
@ -2058,7 +2058,7 @@ int NppParameters::getCmdIdFromMenuEntryItemName(HMENU mainMenuHadle, const gene
|
|||||||
// Check current menu position.
|
// Check current menu position.
|
||||||
TCHAR cmdStr[256];
|
TCHAR cmdStr[256];
|
||||||
::GetMenuString(currMenu, currMenuPos, cmdStr, 256, MF_BYPOSITION);
|
::GetMenuString(currMenu, currMenuPos, cmdStr, 256, MF_BYPOSITION);
|
||||||
if (generic_stricmp(menuItemName.c_str(), purgeMenuItemString(cmdStr).c_str()) == 0)
|
if (wcsicmp(menuItemName.c_str(), purgeMenuItemString(cmdStr).c_str()) == 0)
|
||||||
{
|
{
|
||||||
return ::GetMenuItemID(currMenu, currMenuPos);
|
return ::GetMenuItemID(currMenu, currMenuPos);
|
||||||
}
|
}
|
||||||
@ -2093,7 +2093,7 @@ int NppParameters::getPluginCmdIdFromMenuEntryItemName(HMENU pluginsMenu, const
|
|||||||
{
|
{
|
||||||
TCHAR menuItemString[256];
|
TCHAR menuItemString[256];
|
||||||
::GetMenuString(pluginsMenu, i, menuItemString, 256, MF_BYPOSITION);
|
::GetMenuString(pluginsMenu, i, menuItemString, 256, MF_BYPOSITION);
|
||||||
if (generic_stricmp(pluginName.c_str(), purgeMenuItemString(menuItemString).c_str()) == 0)
|
if (wcsicmp(pluginName.c_str(), purgeMenuItemString(menuItemString).c_str()) == 0)
|
||||||
{
|
{
|
||||||
HMENU pluginMenu = ::GetSubMenu(pluginsMenu, i);
|
HMENU pluginMenu = ::GetSubMenu(pluginsMenu, i);
|
||||||
int nbPluginCmd = ::GetMenuItemCount(pluginMenu);
|
int nbPluginCmd = ::GetMenuItemCount(pluginMenu);
|
||||||
@ -2101,7 +2101,7 @@ int NppParameters::getPluginCmdIdFromMenuEntryItemName(HMENU pluginsMenu, const
|
|||||||
{
|
{
|
||||||
TCHAR pluginCmdStr[256];
|
TCHAR pluginCmdStr[256];
|
||||||
::GetMenuString(pluginMenu, j, pluginCmdStr, 256, MF_BYPOSITION);
|
::GetMenuString(pluginMenu, j, pluginCmdStr, 256, MF_BYPOSITION);
|
||||||
if (generic_stricmp(pluginCmdName.c_str(), purgeMenuItemString(pluginCmdStr).c_str()) == 0)
|
if (wcsicmp(pluginCmdName.c_str(), purgeMenuItemString(pluginCmdStr).c_str()) == 0)
|
||||||
{
|
{
|
||||||
return ::GetMenuItemID(pluginMenu, j);
|
return ::GetMenuItemID(pluginMenu, j);
|
||||||
}
|
}
|
||||||
@ -2823,7 +2823,7 @@ void NppParameters::feedPluginCustomizedCmds(TiXmlNode *node)
|
|||||||
for (size_t i = 0; i < len; ++i)
|
for (size_t i = 0; i < len; ++i)
|
||||||
{
|
{
|
||||||
PluginCmdShortcut & pscOrig = _pluginCommands[i];
|
PluginCmdShortcut & pscOrig = _pluginCommands[i];
|
||||||
if (!generic_strnicmp(pscOrig.getModuleName(), moduleName, lstrlen(moduleName)) && pscOrig.getInternalID() == internalID)
|
if (!wcsnicmp(pscOrig.getModuleName(), moduleName, lstrlen(moduleName)) && pscOrig.getInternalID() == internalID)
|
||||||
{
|
{
|
||||||
//Found matching command
|
//Found matching command
|
||||||
getShortcuts(childNode, _pluginCommands[i]);
|
getShortcuts(childNode, _pluginCommands[i]);
|
||||||
|
@ -116,7 +116,7 @@ const int LANG_INDEX_TYPE6 = 7;
|
|||||||
const int LANG_INDEX_TYPE7 = 8;
|
const int LANG_INDEX_TYPE7 = 8;
|
||||||
|
|
||||||
const int COPYDATA_PARAMS = 0;
|
const int COPYDATA_PARAMS = 0;
|
||||||
const int COPYDATA_FILENAMESA = 1;
|
//const int COPYDATA_FILENAMESA = 1; // obsolete, no more useful
|
||||||
const int COPYDATA_FILENAMESW = 2;
|
const int COPYDATA_FILENAMESW = 2;
|
||||||
const int COPYDATA_FULL_CMDLINE = 3;
|
const int COPYDATA_FULL_CMDLINE = 3;
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ bool AutoCompletion::showApiAndWordComplete()
|
|||||||
if (_ignoreCase)
|
if (_ignoreCase)
|
||||||
{
|
{
|
||||||
generic_string kwSufix = _keyWordArray[i].substr(0, len);
|
generic_string kwSufix = _keyWordArray[i].substr(0, len);
|
||||||
compareResult = generic_stricmp(beginChars, kwSufix.c_str());
|
compareResult = wcsicmp(beginChars, kwSufix.c_str());
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -449,7 +449,7 @@ void AutoCompletion::getWordArray(vector<generic_string> & wordArray, TCHAR *beg
|
|||||||
{
|
{
|
||||||
TCHAR w[bufSize];
|
TCHAR w[bufSize];
|
||||||
_pEditView->getGenericText(w, bufSize, wordStart, wordEnd);
|
_pEditView->getGenericText(w, bufSize, wordStart, wordEnd);
|
||||||
if (!allChars || (generic_strncmp (w, allChars, bufSize) != 0))
|
if (!allChars || (wcsncmp(w, allChars, bufSize) != 0))
|
||||||
{
|
{
|
||||||
if (!isInList(w, wordArray))
|
if (!isInList(w, wordArray))
|
||||||
wordArray.push_back(w);
|
wordArray.push_back(w);
|
||||||
|
@ -1001,9 +1001,9 @@ bool FileManager::backupCurrentBuffer()
|
|||||||
if (!today)
|
if (!today)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
generic_strftime(tmpbuf, temBufLen, TEXT("%Y-%m-%d_%H%M%S"), today);
|
wcsftime(tmpbuf, temBufLen, L"%Y-%m-%d_%H%M%S", today);
|
||||||
|
|
||||||
backupFilePath += TEXT("@");
|
backupFilePath += L"@";
|
||||||
backupFilePath += tmpbuf;
|
backupFilePath += tmpbuf;
|
||||||
|
|
||||||
// Set created file name in buffer
|
// Set created file name in buffer
|
||||||
|
@ -266,7 +266,7 @@ bool FunctionCallTip::getCursorFunction()
|
|||||||
if (_ignoreCase)
|
if (_ignoreCase)
|
||||||
same = testNameNoCase(_funcName, funcToken.token, lstrlen(_funcName)) == 0;
|
same = testNameNoCase(_funcName, funcToken.token, lstrlen(_funcName)) == 0;
|
||||||
else
|
else
|
||||||
same = generic_strncmp(_funcName, funcToken.token, lstrlen(_funcName)) == 0;
|
same = wcsncmp(_funcName, funcToken.token, lstrlen(_funcName)) == 0;
|
||||||
}
|
}
|
||||||
if (!same)
|
if (!same)
|
||||||
{ //check if we need to reload data
|
{ //check if we need to reload data
|
||||||
|
@ -571,7 +571,7 @@ XmlMatchedTagsHighlighter::FindResult XmlMatchedTagsHighlighter::findText(const
|
|||||||
search.chrg.cpMax = static_cast<Sci_Position>(end);
|
search.chrg.cpMax = static_cast<Sci_Position>(end);
|
||||||
|
|
||||||
LangType lang = (_pEditView->getCurrentBuffer())->getLangType();
|
LangType lang = (_pEditView->getCurrentBuffer())->getLangType();
|
||||||
if (lang == L_XML || (lang == L_HTML && generic_stricmp(PathFindExtension((_pEditView->getCurrentBuffer())->getFileName()), TEXT(".xhtml")) == 0))
|
if (lang == L_XML || (lang == L_HTML && wcsicmp(PathFindExtension((_pEditView->getCurrentBuffer())->getFileName()), TEXT(".xhtml")) == 0))
|
||||||
flags = flags | SCFIND_MATCHCASE;
|
flags = flags | SCFIND_MATCHCASE;
|
||||||
|
|
||||||
intptr_t result = _pEditView->execute(SCI_FINDTEXTFULL, flags, reinterpret_cast<LPARAM>(&search));
|
intptr_t result = _pEditView->execute(SCI_FINDTEXTFULL, flags, reinterpret_cast<LPARAM>(&search));
|
||||||
|
@ -495,7 +495,7 @@ const TCHAR * TiXmlElement::Attribute( const TCHAR * name, double* d ) const
|
|||||||
if ( d )
|
if ( d )
|
||||||
{
|
{
|
||||||
if ( s )
|
if ( s )
|
||||||
*d = generic_atof( s );
|
*d = _wtof( s );
|
||||||
else
|
else
|
||||||
*d = 0;
|
*d = 0;
|
||||||
}
|
}
|
||||||
@ -758,7 +758,7 @@ bool TiXmlDocument::LoadFile( const TCHAR* filename )
|
|||||||
const int BUF_SIZE = 2048;
|
const int BUF_SIZE = 2048;
|
||||||
TCHAR buf[BUF_SIZE];
|
TCHAR buf[BUF_SIZE];
|
||||||
|
|
||||||
while( generic_fgets( buf, BUF_SIZE, file ) )
|
while(fgetws( buf, BUF_SIZE, file ) )
|
||||||
{
|
{
|
||||||
data += buf;
|
data += buf;
|
||||||
}
|
}
|
||||||
@ -918,14 +918,14 @@ void TiXmlAttribute::StreamOut( TIXML_OSTREAM * stream ) const
|
|||||||
|
|
||||||
int TiXmlAttribute::QueryIntValue( int* ival ) const
|
int TiXmlAttribute::QueryIntValue( int* ival ) const
|
||||||
{
|
{
|
||||||
if ( generic_sscanf( value.c_str(), TEXT("%d"), ival ) == 1 )
|
if (swscanf( value.c_str(), L"%d", ival ) == 1 )
|
||||||
return TIXML_SUCCESS;
|
return TIXML_SUCCESS;
|
||||||
return TIXML_WRONG_TYPE;
|
return TIXML_WRONG_TYPE;
|
||||||
}
|
}
|
||||||
|
|
||||||
int TiXmlAttribute::QueryDoubleValue( double* dval ) const
|
int TiXmlAttribute::QueryDoubleValue( double* dval ) const
|
||||||
{
|
{
|
||||||
if ( generic_sscanf( value.c_str(), TEXT("%lf"), dval ) == 1 )
|
if (swscanf( value.c_str(), L"%lf", dval ) == 1 )
|
||||||
return TIXML_SUCCESS;
|
return TIXML_SUCCESS;
|
||||||
return TIXML_WRONG_TYPE;
|
return TIXML_WRONG_TYPE;
|
||||||
}
|
}
|
||||||
@ -951,7 +951,7 @@ const int TiXmlAttribute::IntValue() const
|
|||||||
|
|
||||||
const double TiXmlAttribute::DoubleValue() const
|
const double TiXmlAttribute::DoubleValue() const
|
||||||
{
|
{
|
||||||
return generic_atof (value.c_str ());
|
return _wtof(value.c_str ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void TiXmlComment::Print( std::string& outputStream, int depth ) const
|
void TiXmlComment::Print( std::string& outputStream, int depth ) const
|
||||||
|
@ -228,9 +228,9 @@ const TCHAR* TiXmlBase::GetEntity( const TCHAR* p, TCHAR* value )
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
// Handle the &#x entities.
|
// Handle the &#x entities.
|
||||||
if (generic_strncmp( TEXT("&#x"), p, 3 ) == 0)
|
if (wcsncmp( TEXT("&#x"), p, 3 ) == 0)
|
||||||
{
|
{
|
||||||
const TCHAR* end = generic_strchr(p+3, TEXT(';'));
|
const TCHAR* end = wcschr(p+3, L';');
|
||||||
if (end && end - p <= 3 + 4)
|
if (end && end - p <= 3 + 4)
|
||||||
{
|
{
|
||||||
TCHAR* hexend;
|
TCHAR* hexend;
|
||||||
@ -246,7 +246,7 @@ const TCHAR* TiXmlBase::GetEntity( const TCHAR* p, TCHAR* value )
|
|||||||
// Now try to match it.
|
// Now try to match it.
|
||||||
for (i=0; i<NUM_ENTITY; ++i)
|
for (i=0; i<NUM_ENTITY; ++i)
|
||||||
{
|
{
|
||||||
if ( generic_strncmp( entity[i].str, p, entity[i].strLength ) == 0 )
|
if (wcsncmp( entity[i].str, p, entity[i].strLength ) == 0 )
|
||||||
{
|
{
|
||||||
assert(static_cast<unsigned int>(lstrlen(entity[i].str)) == entity[i].strLength );
|
assert(static_cast<unsigned int>(lstrlen(entity[i].str)) == entity[i].strLength );
|
||||||
*value = entity[i].chr;
|
*value = entity[i].chr;
|
||||||
|
@ -560,7 +560,7 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE, PWSTR pCmdLine, int)
|
|||||||
::SendMessage(hNotepad_plus, WM_COPYDATA, reinterpret_cast<WPARAM>(hInstance), reinterpret_cast<LPARAM>(&cmdLineData));
|
::SendMessage(hNotepad_plus, WM_COPYDATA, reinterpret_cast<WPARAM>(hInstance), reinterpret_cast<LPARAM>(&cmdLineData));
|
||||||
|
|
||||||
COPYDATASTRUCT fileNamesData;
|
COPYDATASTRUCT fileNamesData;
|
||||||
fileNamesData.dwData = COPYDATA_FILENAMES;
|
fileNamesData.dwData = COPYDATA_FILENAMESW;
|
||||||
fileNamesData.lpData = (void *)quotFileName.c_str();
|
fileNamesData.lpData = (void *)quotFileName.c_str();
|
||||||
fileNamesData.cbData = long(quotFileName.length() + 1) * (sizeof(TCHAR));
|
fileNamesData.cbData = long(quotFileName.length() + 1) * (sizeof(TCHAR));
|
||||||
::SendMessage(hNotepad_plus, WM_COPYDATA, reinterpret_cast<WPARAM>(hInstance), reinterpret_cast<LPARAM>(&fileNamesData));
|
::SendMessage(hNotepad_plus, WM_COPYDATA, reinterpret_cast<WPARAM>(hInstance), reinterpret_cast<LPARAM>(&fileNamesData));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user