diff --git a/PowerEditor/src/NppIO.cpp b/PowerEditor/src/NppIO.cpp index 6755249f1..dab77fde0 100644 --- a/PowerEditor/src/NppIO.cpp +++ b/PowerEditor/src/NppIO.cpp @@ -35,7 +35,7 @@ using namespace std; // https://docs.microsoft.com/en-us/windows/desktop/FileIO/naming-a-file // Reserved characters: < > : " / \ | ? * tab // ("tab" is not in the official list, but it is good to avoid it) -const std::wstring filenameReservedChars = TEXT("<>:\"/\\|\?*\t"); +const std::wstring filenameReservedChars = L"<>:\"/\\|\?*\t"; DWORD WINAPI Notepad_plus::monitorFileOnChange(void * params) { @@ -43,7 +43,7 @@ DWORD WINAPI Notepad_plus::monitorFileOnChange(void * params) Buffer *buf = monitorInfo->_buffer; HWND h = monitorInfo->_nppHandle; - const TCHAR *fullFileName = (const TCHAR *)buf->getFullPathName(); + const wchar_t *fullFileName = (const wchar_t *)buf->getFullPathName(); //The folder to watch : WCHAR folderToMonitor[MAX_PATH]{}; @@ -80,14 +80,14 @@ DWORD WINAPI Notepad_plus::monitorFileOnChange(void * params) // We've received a notification in the queue. { DWORD dwAction = 0; - generic_string fn; + wstring fn; // Process all available changes, ignore User actions while (dirChanges.Pop(dwAction, fn)) { // Fix monitoring files which are under root problem - size_t pos = fn.find(TEXT("\\\\")); + size_t pos = fn.find(L"\\\\"); if (pos == 2) - fn.replace(pos, 2, TEXT("\\")); + fn.replace(pos, 2, L"\\"); if (wcscmp(fullFileName, fn.c_str()) == 0) { @@ -177,13 +177,13 @@ bool resolveLinkFile(std::wstring& linkFilePath) return isResolved; } -BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, bool isReadOnly, int encoding, const TCHAR *backupFileName, FILETIME fileNameTimestamp) +BufferID Notepad_plus::doOpen(const wstring& fileName, bool isRecursive, bool isReadOnly, int encoding, const wchar_t *backupFileName, FILETIME fileNameTimestamp) { const rsize_t longFileNameBufferSize = MAX_PATH; // TODO stop using fixed-size buffer if (fileName.size() >= longFileNameBufferSize - 1) // issue with all other sub-routines return BUFFER_INVALID; - generic_string targetFileName = fileName; + wstring targetFileName = fileName; bool isResolvedLinkFileName = resolveLinkFile(targetFileName); bool isRawFileName; @@ -201,8 +201,8 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, //{ // int answer = _nativeLangSpeaker.messageBox("OpenNonconformingWin32FileName", // _pPublicInterface->getHSelf(), - // TEXT("You are about to open a file with unusual filename:\n\"$STR_REPLACE$\""), - // TEXT("Open Nonconforming Win32-Filename"), + // L"You are about to open a file with unusual filename:\n\"$STR_REPLACE$\"", + // L"Open Nonconforming Win32-Filename", // MB_OKCANCEL | MB_ICONWARNING | MB_APPLMODAL, // 0, // isResolvedLinkFileName ? targetFileName.c_str() : fileName.c_str()); @@ -214,8 +214,8 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, // unsupported, use the existing Notepad++ file dialog to report _nativeLangSpeaker.messageBox("OpenFileError", _pPublicInterface->getHSelf(), - TEXT("Cannot open file \"$STR_REPLACE$\"."), - TEXT("ERROR"), + L"Cannot open file \"$STR_REPLACE$\".", + L"ERROR", MB_OK, 0, isResolvedLinkFileName ? targetFileName.c_str() : fileName.c_str()); @@ -262,8 +262,8 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, } _lastRecentFileList.remove(longFileName); - generic_string fileName2Find; - generic_string gs_fileName{ targetFileName }; + wstring fileName2Find; + wstring gs_fileName{ targetFileName }; // "fileName" could be: @@ -321,15 +321,15 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, bool globbing; if (isRawFileName) - globbing = (wcsrchr(longFileName, TCHAR('*')) || (abs(longFileName - wcsrchr(longFileName, TCHAR('?'))) > 3)); + globbing = (wcsrchr(longFileName, wchar_t('*')) || (abs(longFileName - wcsrchr(longFileName, wchar_t('?'))) > 3)); else - globbing = (wcsrchr(longFileName, TCHAR('*')) || wcsrchr(longFileName, TCHAR('?'))); + globbing = (wcsrchr(longFileName, wchar_t('*')) || wcsrchr(longFileName, wchar_t('?'))); if (!isSnapshotMode) // if not backup mode, or backupfile path is invalid { if (!PathFileExists(longFileName) && !globbing) { - generic_string longFileDir(longFileName); + wstring longFileDir(longFileName); PathRemoveFileSpec(longFileDir); bool isCreateFileSuccessful = false; @@ -337,8 +337,8 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, { int res = _nativeLangSpeaker.messageBox("CreateNewFileOrNot", _pPublicInterface->getHSelf(), - TEXT("\"$STR_REPLACE$\" doesn't exist. Create it?"), - TEXT("Create new file"), + L"\"$STR_REPLACE$\" doesn't exist. Create it?", + L"Create new file", MB_YESNO, 0, longFileName); @@ -354,8 +354,8 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, { _nativeLangSpeaker.messageBox("CreateNewFileError", _pPublicInterface->getHSelf(), - TEXT("Cannot create the file \"$STR_REPLACE$\"."), - TEXT("Create new file"), + L"Cannot create the file \"$STR_REPLACE$\".", + L"Create new file", MB_OK, 0, longFileName); @@ -364,20 +364,20 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, } else { - generic_string msg, title; + wstring msg, title; if (!_nativeLangSpeaker.getMsgBoxLang("OpenFileNoFolderError", title, msg)) { - title = TEXT("Cannot open file"); - msg = TEXT("\""); + title = L"Cannot open file"; + msg = L"\""; msg += longFileName; - msg += TEXT("\" cannot be opened:\nFolder \""); + msg += L"\" cannot be opened:\nFolder \""; msg += longFileDir; - msg += TEXT("\" doesn't exist."); + msg += L"\" doesn't exist."; } else { - msg = stringReplace(msg, TEXT("$STR_REPLACE1$"), longFileName); - msg = stringReplace(msg, TEXT("$STR_REPLACE2$"), longFileDir); + msg = stringReplace(msg, L"$STR_REPLACE1$", longFileName); + msg = stringReplace(msg, L"$STR_REPLACE2$", longFileDir); } ::MessageBox(_pPublicInterface->getHSelf(), msg.c_str(), title.c_str(), MB_OK); } @@ -475,17 +475,17 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, { if (globbing || ::PathIsDirectory(targetFileName.c_str())) { - vector fileNames; - vector patterns; + vector fileNames; + vector patterns; if (globbing) { - const TCHAR * substring = wcsrchr(targetFileName.c_str(), TCHAR('\\')); + const wchar_t * substring = wcsrchr(targetFileName.c_str(), wchar_t('\\')); if (substring) { size_t pos = substring - targetFileName.c_str(); patterns.push_back(substring + 1); - generic_string dir(targetFileName.c_str(), pos + 1); // use char * to evoke: + wstring dir(targetFileName.c_str(), pos + 1); // use char * to evoke: // string (const char* s, size_t n); // and avoid to call (if pass string) : // string (const string& str, size_t pos, size_t len = npos); @@ -495,11 +495,11 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, } else { - generic_string fileNameStr = targetFileName; + wstring fileNameStr = targetFileName; if (targetFileName[targetFileName.size() - 1] != '\\') - fileNameStr += TEXT("\\"); + fileNameStr += L"\\"; - patterns.push_back(TEXT("*")); + patterns.push_back(L"*"); getMatchedFileNames(fileNameStr.c_str(), 0, patterns, fileNames, true, false); } @@ -510,8 +510,8 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, { ok2Open = IDYES == _nativeLangSpeaker.messageBox("NbFileToOpenImportantWarning", _pPublicInterface->getHSelf(), - TEXT("$INT_REPLACE$ files are about to be opened.\rAre you sure to open them?"), - TEXT("Amount of files to open is too large"), + L"$INT_REPLACE$ files are about to be opened.\rAre you sure to open them?", + L"Amount of files to open is too large", MB_YESNO|MB_APPLMODAL, static_cast(nbFiles2Open)); } @@ -526,8 +526,8 @@ BufferID Notepad_plus::doOpen(const generic_string& fileName, bool isRecursive, { _nativeLangSpeaker.messageBox("OpenFileError", _pPublicInterface->getHSelf(), - TEXT("Can not open file \"$STR_REPLACE$\"."), - TEXT("ERROR"), + L"Can not open file \"$STR_REPLACE$\".", + L"ERROR", MB_OK, 0, longFileName); @@ -554,8 +554,8 @@ bool Notepad_plus::doReload(BufferID id, bool alert) { int answer = _nativeLangSpeaker.messageBox("DocReloadWarning", _pPublicInterface->getHSelf(), - TEXT("Are you sure you want to reload the current file and lose the changes made in Notepad++?"), - TEXT("Reload"), + L"Are you sure you want to reload the current file and lose the changes made in Notepad++?", + L"Reload", MB_YESNO | MB_ICONEXCLAMATION | MB_APPLMODAL); if (answer != IDYES) return false; @@ -607,15 +607,15 @@ bool Notepad_plus::doReload(BufferID id, bool alert) return res; } -bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy) +bool Notepad_plus::doSave(BufferID id, const wchar_t * filename, bool isCopy) { const int index = MainFileManager.getBufferIndexByID(id); if (index == -1) { _nativeLangSpeaker.messageBox("BufferInvalidWarning", _pPublicInterface->getHSelf(), - TEXT("Cannot save: Buffer is invalid."), - TEXT("Save failed"), + L"Cannot save: Buffer is invalid.", + L"Save failed", MB_OK | MB_ICONWARNING); return false; @@ -644,14 +644,14 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy) { _nativeLangSpeaker.messageBox("NotEnoughRoom4Saving", _pPublicInterface->getHSelf(), - TEXT("Failed to save file.\nIt seems there's not enough space on disk to save file. Your file is not saved."), - TEXT("Save failed"), + L"Failed to save file.\nIt seems there's not enough space on disk to save file. Your file is not saved.", + L"Save failed", MB_OK); } else if (res == SavingStatus::SaveWritingFailed) { wstring errorMessage = GetLastErrorAsString(GetLastError()); - ::MessageBox(_pPublicInterface->getHSelf(), errorMessage.c_str(), TEXT("Save failed"), MB_OK | MB_ICONWARNING); + ::MessageBox(_pPublicInterface->getHSelf(), errorMessage.c_str(), L"Save failed", MB_OK | MB_ICONWARNING); } else if (res == SavingStatus::SaveOpenFailed) { @@ -660,8 +660,8 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy) // Already in admin mode? File is probably locked. _nativeLangSpeaker.messageBox("FileLockedWarning", _pPublicInterface->getHSelf(), - TEXT("Please check whether if this file is opened in another program"), - TEXT("Save failed"), + L"Please check whether if this file is opened in another program", + L"Save failed", MB_OK | MB_ICONWARNING); } else @@ -675,17 +675,17 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy) int openInAdminModeRes = _nativeLangSpeaker.messageBox("OpenInAdminMode", _pPublicInterface->getHSelf(), - TEXT("This file cannot be saved and it may be protected.\rDo you want to launch Notepad++ in Administrator mode?"), - TEXT("Save failed"), + L"This file cannot be saved and it may be protected.\rDo you want to launch Notepad++ in Administrator mode?", + L"Save failed", MB_YESNO); if (openInAdminModeRes == IDYES) { - TCHAR nppFullPath[MAX_PATH]{}; + wchar_t nppFullPath[MAX_PATH]{}; ::GetModuleFileName(NULL, nppFullPath, MAX_PATH); - generic_string args = TEXT("-multiInst"); - size_t shellExecRes = (size_t)::ShellExecute(_pPublicInterface->getHSelf(), TEXT("runas"), nppFullPath, args.c_str(), TEXT("."), SW_SHOW); + wstring args = L"-multiInst"; + size_t shellExecRes = (size_t)::ShellExecute(_pPublicInterface->getHSelf(), L"runas", nppFullPath, args.c_str(), L".", SW_SHOW); // If the function succeeds, it returns a value greater than 32. If the function fails, // it returns an error value that indicates the cause of the failure. @@ -695,8 +695,8 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy) { _nativeLangSpeaker.messageBox("OpenInAdminModeFailed", _pPublicInterface->getHSelf(), - TEXT("Notepad++ cannot be opened in Administrator mode."), - TEXT("Open in Administrator mode failed"), + L"Notepad++ cannot be opened in Administrator mode.", + L"Open in Administrator mode failed", MB_OK); } else @@ -711,26 +711,26 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy) int openInAdminModeRes = _nativeLangSpeaker.messageBox("OpenInAdminModeWithoutCloseCurrent", _pPublicInterface->getHSelf(), - TEXT("The file cannot be saved and it may be protected.\rDo you want to launch Notepad++ in Administrator mode?"), - TEXT("Save failed"), + L"The file cannot be saved and it may be protected.\rDo you want to launch Notepad++ in Administrator mode?", + L"Save failed", MB_YESNO); if (openInAdminModeRes == IDYES) { - TCHAR nppFullPath[MAX_PATH]{}; + wchar_t nppFullPath[MAX_PATH]{}; ::GetModuleFileName(NULL, nppFullPath, MAX_PATH); BufferID bufferID = _pEditView->getCurrentBufferID(); Buffer * buf = MainFileManager.getBufferByID(bufferID); //process the fileNamePath into LRF - generic_string fileNamePath = buf->getFullPathName(); + wstring fileNamePath = buf->getFullPathName(); - generic_string args = TEXT("-multiInst -nosession "); - args += TEXT("\""); + wstring args = L"-multiInst -nosession "; + args += L"\""; args += fileNamePath; - args += TEXT("\""); - size_t shellExecRes = (size_t)::ShellExecute(_pPublicInterface->getHSelf(), TEXT("runas"), nppFullPath, args.c_str(), TEXT("."), SW_SHOW); + args += L"\""; + size_t shellExecRes = (size_t)::ShellExecute(_pPublicInterface->getHSelf(), L"runas", nppFullPath, args.c_str(), L".", SW_SHOW); // If the function succeeds, it returns a value greater than 32. If the function fails, // it returns an error value that indicates the cause of the failure. @@ -740,8 +740,8 @@ bool Notepad_plus::doSave(BufferID id, const TCHAR * filename, bool isCopy) { _nativeLangSpeaker.messageBox("OpenInAdminModeFailed", _pPublicInterface->getHSelf(), - TEXT("Notepad++ cannot be opened in Administrator mode."), - TEXT("Open in Administrator mode failed"), + L"Notepad++ cannot be opened in Administrator mode.", + L"Open in Administrator mode failed", MB_OK); } } @@ -784,14 +784,14 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup) // Add to recent file history only if file is removed from all the views // There might be cases when file is cloned/moved to view. // Don't add to recent list unless file is removed from all the views - generic_string fileFullPath; + wstring fileFullPath; if (!buf->isUntitled()) { // if the file doesn't exist, it could be redirected // So we turn Wow64 off bool isWow64Off = false; NppParameters& nppParam = NppParameters::getInstance(); - const TCHAR *fn = buf->getFullPathName(); + const wchar_t *fn = buf->getFullPathName(); if (!PathFileExists(fn)) { nppParam.safeWow64EnableWow64FsRedirection(FALSE); @@ -868,11 +868,11 @@ void Notepad_plus::doClose(BufferID id, int whichOne, bool doDeleteBackup) return; } -generic_string Notepad_plus::exts2Filters(const generic_string& exts, int maxExtsLen) const +wstring Notepad_plus::exts2Filters(const wstring& exts, int maxExtsLen) const { - const TCHAR *extStr = exts.c_str(); - TCHAR aExt[MAX_PATH] = { '\0' }; - generic_string filters(TEXT("")); + const wchar_t *extStr = exts.c_str(); + wchar_t aExt[MAX_PATH] = { '\0' }; + wstring filters(L""); int j = 0; bool stop = false; @@ -888,15 +888,15 @@ generic_string Notepad_plus::exts2Filters(const generic_string& exts, int maxExt if (aExt[0]) { - filters += TEXT("*."); + filters += L"*."; filters += aExt; - filters += TEXT(";"); + filters += L";"; } j = 0; if (maxExtsLen != -1 && i >= static_cast(maxExtsLen)) { - filters += TEXT(" ... "); + filters += L" ... "; break; } } @@ -914,9 +914,9 @@ generic_string Notepad_plus::exts2Filters(const generic_string& exts, int maxExt aExt[j] = '\0'; if (aExt[0]) { - filters += TEXT("*."); + filters += L"*."; filters += aExt; - filters += TEXT(";"); + filters += L";"; } } @@ -952,27 +952,27 @@ int Notepad_plus::setFileOpenSaveDlgFilters(CustomFileDialog & fDlg, bool showAl if (!inExcludedList) { - const TCHAR *defList = l->getDefaultExtList(); - const TCHAR *userList = NULL; + const wchar_t *defList = l->getDefaultExtList(); + const wchar_t *userList = NULL; LexerStylerArray &lsa = (NppParameters::getInstance()).getLStylerArray(); - const TCHAR *lName = l->getLangName(); + const wchar_t *lName = l->getLangName(); LexerStyler *pLS = lsa.getLexerStylerByName(lName); if (pLS) userList = pLS->getLexerUserExt(); - generic_string list(TEXT("")); + wstring list(L""); if (defList) list += defList; if (userList) { - list += TEXT(" "); + list += L" "; list += userList; } - generic_string stringFilters = exts2Filters(list, showAllExt ? -1 : 40); - const TCHAR *filters = stringFilters.c_str(); + wstring stringFilters = exts2Filters(list, showAllExt ? -1 : 40); + const wchar_t *filters = stringFilters.c_str(); if (filters[0]) { fDlg.setExtFilter(getLangDesc(lid, false).c_str(), filters); @@ -1013,7 +1013,7 @@ bool Notepad_plus::fileClose(BufferID id, int curView) } else if (buf->isDirty()) { - const TCHAR* fileNamePath = buf->getFullPathName(); + const wchar_t* fileNamePath = buf->getFullPathName(); int res = doSaveOrNot(fileNamePath); if (res == IDYES) @@ -1068,7 +1068,7 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode) { if (isSnapshotMode) { - if (buf->getBackupFileName() == TEXT("") || !::PathFileExists(buf->getBackupFileName().c_str())) //backup file has been deleted from outside + if (buf->getBackupFileName() == L"" || !::PathFileExists(buf->getBackupFileName().c_str())) //backup file has been deleted from outside { // warning user and save it if user want it. activateBuffer(id, MAIN_VIEW); @@ -1077,8 +1077,8 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode) int res = _nativeLangSpeaker.messageBox("NoBackupDoSaveFile", _pPublicInterface->getHSelf(), - TEXT("Your backup file cannot be found (deleted from outside).\rSave it otherwise your data will be lost\rDo you want to save file \"$STR_REPLACE$\" ?"), - TEXT("Save"), + L"Your backup file cannot be found (deleted from outside).\rSave it otherwise your data will be lost\rDo you want to save file \"$STR_REPLACE$\" ?", + L"Save", MB_YESNOCANCEL | MB_ICONQUESTION | MB_APPLMODAL, 0, // not used buf->getFullPathName()); @@ -1152,7 +1152,7 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode) { if (isSnapshotMode) { - if (buf->getBackupFileName() == TEXT("") || !::PathFileExists(buf->getBackupFileName().c_str())) //backup file has been deleted from outside + if (buf->getBackupFileName() == L"" || !::PathFileExists(buf->getBackupFileName().c_str())) //backup file has been deleted from outside { // warning user and save it if user want it. activateBuffer(id, SUB_VIEW); @@ -1160,8 +1160,8 @@ bool Notepad_plus::fileCloseAll(bool doDeleteBackup, bool isSnapshotMode) int res = _nativeLangSpeaker.messageBox("NoBackupDoSaveFile", _pPublicInterface->getHSelf(), - TEXT("Your backup file cannot be found (deleted from outside).\rSave it otherwise your data will be lost\rDo you want to save file \"$STR_REPLACE$\" ?"), - TEXT("Save"), + L"Your backup file cannot be found (deleted from outside).\rSave it otherwise your data will be lost\rDo you want to save file \"$STR_REPLACE$\" ?", + L"Save", MB_YESNOCANCEL | MB_ICONQUESTION | MB_APPLMODAL, 0, // not used buf->getFullPathName()); @@ -1588,34 +1588,34 @@ bool Notepad_plus::fileSave(BufferID id) if (backup != bak_none && !buf->isLargeFile()) { - const TCHAR *fn = buf->getFullPathName(); - TCHAR *name = ::PathFindFileName(fn); - generic_string fn_bak; + const wchar_t *fn = buf->getFullPathName(); + wchar_t *name = ::PathFindFileName(fn); + wstring fn_bak; if (nppgui._useDir && !nppgui._backupDir.empty()) { // Get the custom directory, make sure it has a trailing slash fn_bak = nppgui._backupDir; - if (fn_bak.back() != TEXT('\\')) - fn_bak += TEXT("\\"); + if (fn_bak.back() != L'\\') + fn_bak += L"\\"; } else { // Get the current file's directory - generic_string path = fn; + wstring path = fn; ::PathRemoveFileSpec(path); fn_bak = path.c_str(); - fn_bak += TEXT("\\"); + fn_bak += L"\\"; // If verbose, save it in a sub folder if (backup == bak_verbose) { - fn_bak += TEXT("nppBackup\\"); + fn_bak += L"nppBackup\\"; } } // Expand any environment variables - TCHAR fn_bak_expanded[MAX_PATH] = { '\0' }; + wchar_t fn_bak_expanded[MAX_PATH] = { '\0' }; ::ExpandEnvironmentStrings(fn_bak.c_str(), fn_bak_expanded, MAX_PATH); fn_bak = fn_bak_expanded; @@ -1629,12 +1629,12 @@ bool Notepad_plus::fileSave(BufferID id) if (backup == bak_simple) { fn_bak += name; - fn_bak += TEXT(".bak"); + fn_bak += L".bak"; } else if (backup == bak_verbose) { constexpr int temBufLen = 32; - TCHAR tmpbuf[temBufLen]{}; + wchar_t tmpbuf[temBufLen]{}; time_t ltime = time(0); const struct tm* today; @@ -1644,9 +1644,9 @@ bool Notepad_plus::fileSave(BufferID id) wcsftime(tmpbuf, temBufLen, L"%Y-%m-%d_%H%M%S", today); fn_bak += name; - fn_bak += TEXT("."); + fn_bak += L"."; fn_bak += tmpbuf; - fn_bak += TEXT(".bak"); + fn_bak += L".bak"; } } @@ -1655,8 +1655,8 @@ bool Notepad_plus::fileSave(BufferID id) { int res = _nativeLangSpeaker.messageBox("FileBackupFailed", _pPublicInterface->getHSelf(), - TEXT("The previous version of the file could not be saved into the backup directory at \"$STR_REPLACE$\".\r\rDo you want to save the current file anyways?"), - TEXT("File Backup Failed"), + L"The previous version of the file could not be saved into the backup directory at \"$STR_REPLACE$\".\r\rDo you want to save the current file anyways?", + L"File Backup Failed", MB_YESNO | MB_ICONERROR, 0, fn_bak.c_str()); @@ -1673,7 +1673,7 @@ bool Notepad_plus::fileSave(BufferID id) return false; } -bool Notepad_plus::fileSaveSpecific(const generic_string& fileNameToSave) +bool Notepad_plus::fileSaveSpecific(const wstring& fileNameToSave) { BufferID idToSave = _mainDocTab.findBufferByName(fileNameToSave.c_str()); if (idToSave == BUFFER_INVALID) @@ -1788,12 +1788,12 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy) bufferID = _pEditView->getCurrentBufferID(); Buffer * buf = MainFileManager.getBufferByID(bufferID); - generic_string origPathname = buf->getFullPathName(); + wstring origPathname = buf->getFullPathName(); bool wasUntitled = buf->isUntitled(); CustomFileDialog fDlg(_pPublicInterface->getHSelf()); - fDlg.setExtFilter(TEXT("All types"), TEXT(".*")); + fDlg.setExtFilter(L"All types", L".*"); LangType langType = buf->getLangType(); @@ -1804,7 +1804,7 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy) fDlg.setExtIndex(langTypeIndex + 1); // +1 for "All types" - generic_string localizedTitle; + wstring localizedTitle; if (isSaveCopy) { localizedTitle = _nativeLangSpeaker.getNativeLangMenuString(IDM_FILE_SAVECOPYAS, L"Save a Copy As", true); @@ -1815,8 +1815,8 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy) } fDlg.setTitle(localizedTitle.c_str()); - const generic_string checkboxLabel = _nativeLangSpeaker.getLocalizedStrFromID("file-save-assign-type", - TEXT("&Append extension")); + const wstring checkboxLabel = _nativeLangSpeaker.getLocalizedStrFromID("file-save-assign-type", + L"&Append extension"); fDlg.enableFileTypeCheckbox(checkboxLabel, !defaultAllTypes); // Disable file autodetection before opening save dialog to prevent use-after-delete bug. @@ -1824,7 +1824,7 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy) auto cdBefore = nppParam.getNppGUI()._fileAutoDetection; (nppParam.getNppGUI())._fileAutoDetection = cdDisabled; - generic_string fn = fDlg.doSaveDlg(); + wstring fn = fDlg.doSaveDlg(); // Remember the selected state (nppParam.getNppGUI())._setSaveDlgExtFiltToAllTypes = !fDlg.getFileTypeCheckboxValue(); @@ -1860,8 +1860,8 @@ bool Notepad_plus::fileSaveAs(BufferID id, bool isSaveCopy) { _nativeLangSpeaker.messageBox("FileAlreadyOpenedInNpp", _pPublicInterface->getHSelf(), - TEXT("The file is already opened in Notepad++."), - TEXT("ERROR"), + L"The file is already opened in Notepad++.", + L"ERROR", MB_OK | MB_ICONSTOP); switchToFile(other); return false; @@ -1892,7 +1892,7 @@ bool Notepad_plus::fileRename(BufferID id) { CustomFileDialog fDlg(_pPublicInterface->getHSelf()); - fDlg.setExtFilter(TEXT("All types"), TEXT(".*")); + fDlg.setExtFilter(L"All types", L".*"); setFileOpenSaveDlgFilters(fDlg, false); fDlg.setFolder(buf->getFullPathName()); fDlg.setDefFileName(buf->getFileName()); @@ -1964,7 +1964,7 @@ bool Notepad_plus::fileRename(BufferID id) std::wstring oldBackUpFile = buf->getBackupFileName(); // Change the backup file name and let MainFileManager decide the new filename - buf->setBackupFileName(TEXT("")); + buf->setBackupFileName(L""); // Create new backup buf->setModifiedStatus(true); @@ -2033,7 +2033,7 @@ bool Notepad_plus::fileRenameUntitled(BufferID id, const wchar_t* tabNewName) std::wstring oldBackUpFile = buf->getBackupFileName(); // Change the backup file name and let MainFileManager decide the new filename - buf->setBackupFileName(TEXT("")); + buf->setBackupFileName(L""); // Create new backup buf->setModifiedStatus(true); @@ -2057,7 +2057,7 @@ bool Notepad_plus::fileDelete(BufferID id) bufferID = _pEditView->getCurrentBufferID(); Buffer * buf = MainFileManager.getBufferByID(bufferID); - const TCHAR *fileNamePath = buf->getFullPathName(); + const wchar_t *fileNamePath = buf->getFullPathName(); winVer winVersion = (NppParameters::getInstance()).getWinVersion(); bool goAhead = true; @@ -2079,8 +2079,8 @@ bool Notepad_plus::fileDelete(BufferID id) { _nativeLangSpeaker.messageBox("DeleteFileFailed", _pPublicInterface->getHSelf(), - TEXT("Delete File failed"), - TEXT("Delete File"), + L"Delete File failed", + L"Delete File", MB_OK); scnN.nmhdr.code = NPPN_FILEDELETEFAILED; @@ -2106,7 +2106,7 @@ void Notepad_plus::fileOpen() CustomFileDialog fDlg(_pPublicInterface->getHSelf()); wstring localizedTitle = _nativeLangSpeaker.getNativeLangMenuString(IDM_FILE_OPEN, L"Open", true); fDlg.setTitle(localizedTitle.c_str()); - fDlg.setExtFilter(TEXT("All types"), TEXT(".*")); + fDlg.setExtFilter(L"All types", L".*"); setFileOpenSaveDlgFilters(fDlg, true); @@ -2144,19 +2144,19 @@ bool Notepad_plus::fileReload() } -bool Notepad_plus::isFileSession(const TCHAR * filename) +bool Notepad_plus::isFileSession(const wchar_t * filename) { // if file2open matches the ext of user defined session file ext, then it'll be opened as a session - const TCHAR *definedSessionExt = NppParameters::getInstance().getNppGUI()._definedSessionExt.c_str(); + const wchar_t *definedSessionExt = NppParameters::getInstance().getNppGUI()._definedSessionExt.c_str(); if (*definedSessionExt != '\0') { - generic_string fncp = filename; - TCHAR *pExt = PathFindExtension(fncp.c_str()); + wstring fncp = filename; + wchar_t *pExt = PathFindExtension(fncp.c_str()); - generic_string usrSessionExt = TEXT(""); + wstring usrSessionExt = L""; if (*definedSessionExt != '.') { - usrSessionExt += TEXT("."); + usrSessionExt += L"."; } usrSessionExt += definedSessionExt; @@ -2168,19 +2168,19 @@ bool Notepad_plus::isFileSession(const TCHAR * filename) return false; } -bool Notepad_plus::isFileWorkspace(const TCHAR * filename) +bool Notepad_plus::isFileWorkspace(const wchar_t * filename) { // if filename matches the ext of user defined workspace file ext, then it'll be opened as a workspace - const TCHAR *definedWorkspaceExt = NppParameters::getInstance().getNppGUI()._definedWorkspaceExt.c_str(); + const wchar_t *definedWorkspaceExt = NppParameters::getInstance().getNppGUI()._definedWorkspaceExt.c_str(); if (*definedWorkspaceExt != '\0') { - generic_string fncp = filename; - TCHAR *pExt = PathFindExtension(fncp.c_str()); + wstring fncp = filename; + wchar_t *pExt = PathFindExtension(fncp.c_str()); - generic_string usrWorkspaceExt = TEXT(""); + wstring usrWorkspaceExt = L""; if (*definedWorkspaceExt != '.') { - usrWorkspaceExt += TEXT("."); + usrWorkspaceExt += L"."; } usrWorkspaceExt += definedWorkspaceExt; @@ -2231,7 +2231,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch for (size_t i = 0; i < session.nbMainFiles() ; ) { - const TCHAR *pFn = session._mainViewFiles[i]._fileName.c_str(); + const wchar_t *pFn = session._mainViewFiles[i]._fileName.c_str(); if (isFileSession(pFn) || isFileWorkspace(pFn)) { @@ -2248,7 +2248,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch } if (PathFileExists(pFn)) { - if (isSnapshotMode && session._mainViewFiles[i]._backupFilePath != TEXT("")) + if (isSnapshotMode && !session._mainViewFiles[i]._backupFilePath.empty()) lastOpened = doOpen(pFn, false, false, session._mainViewFiles[i]._encoding, session._mainViewFiles[i]._backupFilePath.c_str(), session._mainViewFiles[i]._originalFileLastModifTimestamp); else lastOpened = doOpen(pFn, false, false, session._mainViewFiles[i]._encoding); @@ -2319,7 +2319,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch buf->setUserReadOnly(session._mainViewFiles[i]._isUserReadOnly); - if (isSnapshotMode && session._mainViewFiles[i]._backupFilePath != TEXT("") && PathFileExists(session._mainViewFiles[i]._backupFilePath.c_str())) + if (isSnapshotMode && session._mainViewFiles[i]._backupFilePath.empty() && PathFileExists(session._mainViewFiles[i]._backupFilePath.c_str())) buf->setDirty(true); buf->setRTL(session._mainViewFiles[i]._isRTL); @@ -2360,7 +2360,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch for (size_t k = 0 ; k < session.nbSubFiles() ; ) { - const TCHAR *pFn = session._subViewFiles[k]._fileName.c_str(); + const wchar_t *pFn = session._subViewFiles[k]._fileName.c_str(); if (isFileSession(pFn) || isFileWorkspace(pFn)) { @@ -2387,7 +2387,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch } else { - if (isSnapshotMode && session._subViewFiles[k]._backupFilePath != TEXT("")) + if (isSnapshotMode && !session._subViewFiles[k]._backupFilePath.empty()) lastOpened = doOpen(pFn, false, false, session._subViewFiles[k]._encoding, session._subViewFiles[k]._backupFilePath.c_str(), session._subViewFiles[k]._originalFileLastModifTimestamp); else lastOpened = doOpen(pFn, false, false, session._subViewFiles[k]._encoding); @@ -2415,7 +2415,7 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch showView(SUB_VIEW); if (canHideView(MAIN_VIEW)) hideView(MAIN_VIEW); - const TCHAR *pLn = session._subViewFiles[k]._langName.c_str(); + const wchar_t *pLn = session._subViewFiles[k]._langName.c_str(); int id = getLangFromMenuName(pLn); LangType typeToSet = L_TEXT; @@ -2441,16 +2441,16 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch buf->setMapPosition(session._subViewFiles[k]._mapPos); if (typeToSet == L_USER) { - if (!lstrcmp(pLn, TEXT("User Defined"))) + if (!lstrcmp(pLn, L"User Defined")) { - pLn = TEXT(""); //default user defined + pLn = L""; //default user defined } } buf->setLangType(typeToSet, pLn); buf->setEncoding(session._subViewFiles[k]._encoding); buf->setUserReadOnly(session._subViewFiles[k]._isUserReadOnly); - if (isSnapshotMode && session._subViewFiles[k]._backupFilePath != TEXT("") && PathFileExists(session._subViewFiles[k]._backupFilePath.c_str())) + if (isSnapshotMode && !session._subViewFiles[k]._backupFilePath.empty() && PathFileExists(session._subViewFiles[k]._backupFilePath.c_str())) buf->setDirty(true); buf->setRTL(session._subViewFiles[k]._isRTL); @@ -2537,24 +2537,24 @@ bool Notepad_plus::loadSession(Session & session, bool isSnapshotMode, const wch return allSessionFilesLoaded; } -bool Notepad_plus::fileLoadSession(const TCHAR *fn) +bool Notepad_plus::fileLoadSession(const wchar_t *fn) { bool result = false; - generic_string sessionFileName; + wstring sessionFileName; if (fn == NULL) { CustomFileDialog fDlg(_pPublicInterface->getHSelf()); - const TCHAR *ext = NppParameters::getInstance().getNppGUI()._definedSessionExt.c_str(); - generic_string sessionExt = TEXT(""); + const wchar_t *ext = NppParameters::getInstance().getNppGUI()._definedSessionExt.c_str(); + wstring sessionExt = L""; if (*ext != '\0') { if (*ext != '.') - sessionExt += TEXT("."); + sessionExt += L"."; sessionExt += ext; - fDlg.setExtFilter(TEXT("Session file"), sessionExt.c_str()); + fDlg.setExtFilter(L"Session file", sessionExt.c_str()); fDlg.setDefExt(ext); } - fDlg.setExtFilter(TEXT("All types"), TEXT(".*")); + fDlg.setExtFilter(L"All types", L".*"); wstring localizedTitle = _nativeLangSpeaker.getNativeLangMenuString(IDM_FILE_LOADSESSION, L"Load Session", true); fDlg.setTitle(localizedTitle.c_str()); sessionFileName = fDlg.doOpenSingleFileDlg(); @@ -2578,14 +2578,14 @@ bool Notepad_plus::fileLoadSession(const TCHAR *fn) } if (!isEmptyNpp && (nppGUI._multiInstSetting == multiInstOnSession || nppGUI._multiInstSetting == multiInst)) { - TCHAR nppFullPath[MAX_PATH]{}; + wchar_t nppFullPath[MAX_PATH]{}; ::GetModuleFileName(NULL, nppFullPath, MAX_PATH); - generic_string args = TEXT("-multiInst -nosession -openSession "); - args += TEXT("\""); + wstring args = L"-multiInst -nosession -openSession "; + args += L"\""; args += sessionFileName; - args += TEXT("\""); - if (::ShellExecute(_pPublicInterface->getHSelf(), TEXT("open"), nppFullPath, args.c_str(), TEXT("."), SW_SHOW) > (HINSTANCE)32) + args += L"\""; + if (::ShellExecute(_pPublicInterface->getHSelf(), L"open", nppFullPath, args.c_str(), L".", SW_SHOW) > (HINSTANCE)32) result = true; } else @@ -2606,7 +2606,7 @@ bool Notepad_plus::fileLoadSession(const TCHAR *fn) return result; } -const TCHAR * Notepad_plus::fileSaveSession(size_t nbFile, TCHAR ** fileNames, const TCHAR *sessionFile2save, bool includeFileBrowser) +const wchar_t * Notepad_plus::fileSaveSession(size_t nbFile, wchar_t ** fileNames, const wchar_t *sessionFile2save, bool includeFileBrowser) { if (sessionFile2save && (lstrlen(sessionFile2save) > 0)) { @@ -2616,7 +2616,7 @@ const TCHAR * Notepad_plus::fileSaveSession(size_t nbFile, TCHAR ** fileNames, c for (size_t i = 0 ; i < nbFile ; ++i) { if (PathFileExists(fileNames[i])) - currentSession._mainViewFiles.push_back(generic_string(fileNames[i])); + currentSession._mainViewFiles.push_back(wstring(fileNames[i])); } } else @@ -2638,28 +2638,28 @@ const TCHAR * Notepad_plus::fileSaveSession(size_t nbFile, TCHAR ** fileNames, c return NULL; } -const TCHAR * Notepad_plus::fileSaveSession(size_t nbFile, TCHAR ** fileNames) +const wchar_t * Notepad_plus::fileSaveSession(size_t nbFile, wchar_t ** fileNames) { CustomFileDialog fDlg(_pPublicInterface->getHSelf()); - const TCHAR *ext = NppParameters::getInstance().getNppGUI()._definedSessionExt.c_str(); + const wchar_t *ext = NppParameters::getInstance().getNppGUI()._definedSessionExt.c_str(); - generic_string sessionExt = TEXT(""); + wstring sessionExt = L""; if (*ext != '\0') { if (*ext != '.') - sessionExt += TEXT("."); + sessionExt += L"."; sessionExt += ext; - fDlg.setExtFilter(TEXT("Session file"), sessionExt.c_str()); + fDlg.setExtFilter(L"Session file", sessionExt.c_str()); fDlg.setDefExt(ext); fDlg.setExtIndex(0); // 0 index for "custom extension types" } - fDlg.setExtFilter(TEXT("All types"), TEXT(".*")); + fDlg.setExtFilter(L"All types", L".*"); const bool isCheckboxActive = _pFileBrowser && !_pFileBrowser->isClosed(); - const generic_string checkboxLabel = _nativeLangSpeaker.getLocalizedStrFromID("session-save-folder-as-workspace", L"Save Folder as Workspace"); + const wstring checkboxLabel = _nativeLangSpeaker.getLocalizedStrFromID("session-save-folder-as-workspace", L"Save Folder as Workspace"); fDlg.setCheckbox(checkboxLabel.c_str(), isCheckboxActive); wstring localizedTitle = _nativeLangSpeaker.getNativeLangMenuString(IDM_FILE_SAVESESSION, L"Save Session", true); fDlg.setTitle(localizedTitle.c_str()); - generic_string sessionFileName = fDlg.doSaveDlg(); + wstring sessionFileName = fDlg.doSaveDlg(); if (!sessionFileName.empty()) return fileSaveSession(nbFile, fileNames, sessionFileName.c_str(), fDlg.getCheckboxState()); diff --git a/PowerEditor/src/NppNotification.cpp b/PowerEditor/src/NppNotification.cpp index f4eaef60c..165fe8cf0 100644 --- a/PowerEditor/src/NppNotification.cpp +++ b/PowerEditor/src/NppNotification.cpp @@ -238,8 +238,8 @@ BOOL Notepad_plus::notify(SCNotification *notification) { if (!_tabPopupDropMenu.isCreated()) { - TCHAR goToView[32] = TEXT("Move to Other View"); - TCHAR cloneToView[32] = TEXT("Clone to Other View"); + wchar_t goToView[32] = L"Move to Other View"; + wchar_t cloneToView[32] = L"Clone to Other View"; vector itemUnitArray; itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_ANOTHER_VIEW, goToView)); itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_CLONE_TO_ANOTHER_VIEW, cloneToView)); @@ -263,17 +263,17 @@ BOOL Notepad_plus::notify(SCNotification *notification) // Do nothing return TRUE; } - generic_string quotFileName = TEXT("\""); + wstring quotFileName = L"\""; quotFileName += _pEditView->getCurrentBuffer()->getFullPathName(); - quotFileName += TEXT("\""); + quotFileName += L"\""; COPYDATASTRUCT fileNamesData{}; fileNamesData.dwData = COPYDATA_FILENAMESW; fileNamesData.lpData = (void *)quotFileName.c_str(); - fileNamesData.cbData = static_cast((quotFileName.length() + 1) * sizeof(TCHAR)); + fileNamesData.cbData = static_cast((quotFileName.length() + 1) * sizeof(wchar_t)); HWND hWinParent = ::GetParent(hWin); const rsize_t classNameBufferSize = MAX_PATH; - TCHAR className[classNameBufferSize]; + wchar_t className[classNameBufferSize]; ::GetClassName(hWinParent,className, classNameBufferSize); if (lstrcmp(className, _pPublicInterface->getClassName()) == 0 && hWinParent != _pPublicInterface->getHSelf()) // another Notepad++ { @@ -283,11 +283,11 @@ BOOL Notepad_plus::notify(SCNotification *notification) int iView = isFromPrimary?MAIN_VIEW:SUB_VIEW; if (buf->isDirty()) { - generic_string msg, title; + wstring msg, title; _nativeLangSpeaker.messageBox("CannotMoveDoc", _pPublicInterface->getHSelf(), - TEXT("Document is modified, save it then try again."), - TEXT("Move to new Notepad++ Instance"), + L"Document is modified, save it then try again.", + L"Move to new Notepad++ Instance", MB_OK); } else @@ -368,7 +368,7 @@ BOOL Notepad_plus::notify(SCNotification *notification) { bool isOverTypeMode = (_pEditView->execute(SCI_GETOVERTYPE) != 0); _pEditView->execute(SCI_SETOVERTYPE, !isOverTypeMode); - _statusBar.setText((_pEditView->execute(SCI_GETOVERTYPE))?TEXT("OVR"):TEXT("INS"), STATUSBAR_TYPING_MODE); + _statusBar.setText((_pEditView->execute(SCI_GETOVERTYPE)) ? L"OVR" : L"INS", STATUSBAR_TYPING_MODE); } } else if (notification->nmhdr.hwndFrom == _mainDocTab.getHSelf() && _activeView == SUB_VIEW) @@ -494,14 +494,14 @@ BOOL Notepad_plus::notify(SCNotification *notification) if (!_fileSwitcherMultiFilePopupMenu.isCreated()) { vector itemUnitArray; - itemUnitArray.push_back(MenuItemUnit(IDM_DOCLIST_FILESCLOSE, TEXT("Close Selected files"))); - itemUnitArray.push_back(MenuItemUnit(IDM_DOCLIST_FILESCLOSEOTHERS, TEXT("Close Other files"))); - itemUnitArray.push_back(MenuItemUnit(IDM_DOCLIST_COPYNAMES, TEXT("Copy Selected Names"))); - itemUnitArray.push_back(MenuItemUnit(IDM_DOCLIST_COPYPATHS, TEXT("Copy Selected Pathnames"))); + itemUnitArray.push_back(MenuItemUnit(IDM_DOCLIST_FILESCLOSE, L"Close Selected files")); + itemUnitArray.push_back(MenuItemUnit(IDM_DOCLIST_FILESCLOSEOTHERS, L"Close Other files")); + itemUnitArray.push_back(MenuItemUnit(IDM_DOCLIST_COPYNAMES, L"Copy Selected Names")); + itemUnitArray.push_back(MenuItemUnit(IDM_DOCLIST_COPYPATHS, L"Copy Selected Pathnames")); for (auto&& x : itemUnitArray) { - const generic_string menuItem = _nativeLangSpeaker.getNativeLangMenuString(x._cmdID); + const wstring menuItem = _nativeLangSpeaker.getNativeLangMenuString(x._cmdID); if (!menuItem.empty()) x._itemName = menuItem; } @@ -529,42 +529,42 @@ BOOL Notepad_plus::notify(SCNotification *notification) { // IMPORTANT: If any submenu entry is added/moved/removed, you have to change the value of tabCmSubMenuEntryPos[] in localization.cpp file - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSE, TEXT("Close"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_BUT_CURRENT, TEXT("Close All BUT This"), TEXT("Close Multiple Tabs"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_TOLEFT, TEXT("Close All to the Left"), TEXT("Close Multiple Tabs"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_TORIGHT, TEXT("Close All to the Right"), TEXT("Close Multiple Tabs"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_UNCHANGED, TEXT("Close All Unchanged"), TEXT("Close Multiple Tabs"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_SAVE, TEXT("Save"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_SAVEAS, TEXT("Save As..."))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_FOLDER, TEXT("Open Containing Folder in Explorer"), TEXT("Open into"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_CMD, TEXT("Open Containing Folder in cmd"), TEXT("Open into"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CONTAININGFOLDERASWORKSPACE, TEXT("Open Containing Folder as Workspace"), TEXT("Open into"))); - itemUnitArray.push_back(MenuItemUnit(0, NULL, TEXT("Open into"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_DEFAULT_VIEWER, TEXT("Open in Default Viewer"), TEXT("Open into"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_RENAME, TEXT("Rename"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_DELETE, TEXT("Move to Recycle Bin"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_RELOAD, TEXT("Reload"))); - itemUnitArray.push_back(MenuItemUnit(IDM_FILE_PRINT, TEXT("Print"))); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSE, L"Close")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_BUT_CURRENT, L"Close All BUT This", L"Close Multiple Tabs")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_TOLEFT, L"Close All to the Left", L"Close Multiple Tabs")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_TORIGHT, L"Close All to the Right", L"Close Multiple Tabs")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CLOSEALL_UNCHANGED, L"Close All Unchanged", L"Close Multiple Tabs")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_SAVE, L"Save")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_SAVEAS, L"Save As...")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_FOLDER, L"Open Containing Folder in Explorer", L"Open into")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_CMD, L"Open Containing Folder in cmd", L"Open into")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_CONTAININGFOLDERASWORKSPACE, L"Open Containing Folder as Workspace", L"Open into")); + itemUnitArray.push_back(MenuItemUnit(0, NULL, L"Open into")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_OPEN_DEFAULT_VIEWER, L"Open in Default Viewer", L"Open into")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_RENAME, L"Rename")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_DELETE, L"Move to Recycle Bin")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_RELOAD, L"Reload")); + itemUnitArray.push_back(MenuItemUnit(IDM_FILE_PRINT, L"Print")); itemUnitArray.push_back(MenuItemUnit(0, NULL)); - itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_SETREADONLY, TEXT("Read-Only"))); - itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_CLEARREADONLY, TEXT("Clear Read-Only Flag"))); + itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_SETREADONLY, L"Read-Only")); + itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_CLEARREADONLY, L"Clear Read-Only Flag")); itemUnitArray.push_back(MenuItemUnit(0, NULL)); - itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_FULLPATHTOCLIP, TEXT("Copy Full File Path"), TEXT("Copy to Clipboard"))); - itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_FILENAMETOCLIP, TEXT("Copy Filename"), TEXT("Copy to Clipboard"))); - itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_CURRENTDIRTOCLIP, TEXT("Copy Current Dir. Path"), TEXT("Copy to Clipboard"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_START, TEXT("Move to Start"), TEXT("Move Document"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_END, TEXT("Move to End"), TEXT("Move Document"))); - itemUnitArray.push_back(MenuItemUnit(0, NULL, TEXT("Move Document"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_ANOTHER_VIEW, TEXT("Move to Other View"), TEXT("Move Document"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_CLONE_TO_ANOTHER_VIEW, TEXT("Clone to Other View"), TEXT("Move Document"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_NEW_INSTANCE, TEXT("Move to New Instance"), TEXT("Move Document"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_LOAD_IN_NEW_INSTANCE, TEXT("Open in New Instance"), TEXT("Move Document"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_1, TEXT("Apply Color 1"), TEXT("Apply Color to Tab"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_2, TEXT("Apply Color 2"), TEXT("Apply Color to Tab"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_3, TEXT("Apply Color 3"), TEXT("Apply Color to Tab"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_4, TEXT("Apply Color 4"), TEXT("Apply Color to Tab"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_5, TEXT("Apply Color 5"), TEXT("Apply Color to Tab"))); - itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_NONE, TEXT("Remove Color"), TEXT("Apply Color to Tab"))); + itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_FULLPATHTOCLIP, L"Copy Full File Path", L"Copy to Clipboard")); + itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_FILENAMETOCLIP, L"Copy Filename", L"Copy to Clipboard")); + itemUnitArray.push_back(MenuItemUnit(IDM_EDIT_CURRENTDIRTOCLIP, L"Copy Current Dir. Path", L"Copy to Clipboard")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_START, L"Move to Start", L"Move Document")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_END, L"Move to End", L"Move Document")); + itemUnitArray.push_back(MenuItemUnit(0, NULL, L"Move Document")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_ANOTHER_VIEW, L"Move to Other View", L"Move Document")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_CLONE_TO_ANOTHER_VIEW, L"Clone to Other View", L"Move Document")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_GOTO_NEW_INSTANCE, L"Move to New Instance", L"Move Document")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_LOAD_IN_NEW_INSTANCE, L"Open in New Instance", L"Move Document")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_1, L"Apply Color 1", L"Apply Color to Tab")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_2, L"Apply Color 2", L"Apply Color to Tab")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_3, L"Apply Color 3", L"Apply Color to Tab")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_4, L"Apply Color 4", L"Apply Color to Tab")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_5, L"Apply Color 5", L"Apply Color to Tab")); + itemUnitArray.push_back(MenuItemUnit(IDM_VIEW_TAB_COLOUR_NONE, L"Remove Color", L"Apply Color to Tab")); // IMPORTANT: If any submenu entry is added/moved/removed, you have to change the value of tabCmSubMenuEntryPos[] in localization.cpp file } @@ -694,7 +694,7 @@ BOOL Notepad_plus::notify(SCNotification *notification) const NppGUI & nppGui = NppParameters::getInstance().getNppGUI(); bool indentMaintain = nppGui._maintainIndent; if (indentMaintain) - maintainIndentation(static_cast(notification->ch)); + maintainIndentation(static_cast(notification->ch)); Buffer* currentBuf = _pEditView->getCurrentBuffer(); if (currentBuf->allowAutoCompletion()) @@ -882,8 +882,8 @@ BOOL Notepad_plus::notify(SCNotification *notification) notifyView->execute(SCI_SETSEL, notification->position, notification->position); // Open URL - generic_string url = notifyView->getGenericTextAsString(static_cast(startPos), static_cast(endPos)); - ::ShellExecute(_pPublicInterface->getHSelf(), TEXT("open"), url.c_str(), NULL, NULL, SW_SHOW); + wstring url = notifyView->getGenericTextAsString(static_cast(startPos), static_cast(endPos)); + ::ShellExecute(_pPublicInterface->getHSelf(), L"open", url.c_str(), NULL, NULL, SW_SHOW); } break; } @@ -911,8 +911,8 @@ BOOL Notepad_plus::notify(SCNotification *notification) { if (nppGui._smartHiliteOnAnotherView) { - TCHAR selectedText[1024]; - _pEditView->getGenericSelectedText(selectedText, sizeof(selectedText)/sizeof(TCHAR), false); + wchar_t selectedText[1024]; + _pEditView->getGenericSelectedText(selectedText, sizeof(selectedText)/sizeof(wchar_t), false); _smartHighlighter.highlightViewWithWord(notifyView, selectedText); } break; @@ -965,10 +965,10 @@ BOOL Notepad_plus::notify(SCNotification *notification) ::MapWindowPoints(NULL, _pPublicInterface->getHSelf(), &p, 1); HWND hWin = ::ChildWindowFromPointEx(_pPublicInterface->getHSelf(), p, CWP_SKIPINVISIBLE); const int tipMaxLen = 1024; - static TCHAR docTip[tipMaxLen]; + static wchar_t docTip[tipMaxLen]; docTip[0] = '\0'; - generic_string tipTmp(TEXT("")); + wstring tipTmp(L""); int id = int(lpttt->hdr.idFrom); if (hWin == _rebarTop.getHSelf()) @@ -1015,7 +1015,7 @@ BOOL Notepad_plus::notify(SCNotification *notification) } catch (...) { - //printStr(TEXT("ToolTip crash is caught!")); + //printStr(L"ToolTip crash is caught!")); } break; } diff --git a/PowerEditor/src/Parameters.cpp b/PowerEditor/src/Parameters.cpp index 785479501..8912993ea 100644 --- a/PowerEditor/src/Parameters.cpp +++ b/PowerEditor/src/Parameters.cpp @@ -43,7 +43,7 @@ struct WinMenuKeyDefinition // more or less matches accelerator table definition bool isCtrl = false; bool isAlt = false; bool isShift = false; - const TCHAR * specialName = nullptr; // Used when no real menu name exists (in case of toggle for example) + const wchar_t * specialName = nullptr; // Used when no real menu name exists (in case of toggle for example) }; @@ -59,8 +59,8 @@ static const WinMenuKeyDefinition winKeyDefs[] = // { VK_N, IDM_FILE_NEW, true, false, false, nullptr }, { VK_O, IDM_FILE_OPEN, true, false, false, nullptr }, - { VK_NULL, IDM_FILE_OPEN_FOLDER, false, false, false, TEXT("Open containing folder in Explorer") }, - { VK_NULL, IDM_FILE_OPEN_CMD, false, false, false, TEXT("Open containing folder in Command Prompt") }, + { VK_NULL, IDM_FILE_OPEN_FOLDER, false, false, false, L"Open containing folder in Explorer" }, + { VK_NULL, IDM_FILE_OPEN_CMD, false, false, false, L"Open containing folder in Command Prompt" }, { VK_NULL, IDM_FILE_OPEN_DEFAULT_VIEWER, false, false, false, nullptr }, { VK_NULL, IDM_FILE_OPENFOLDERASWORSPACE, false, false, false, nullptr }, { VK_R, IDM_FILE_RELOAD, true, false, false, nullptr }, @@ -80,7 +80,7 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_NULL, IDM_FILE_SAVESESSION, false, false, false, nullptr }, { VK_P, IDM_FILE_PRINT, true, false, false, nullptr }, { VK_NULL, IDM_FILE_PRINTNOW, false, false, false, nullptr }, - { VK_T, IDM_FILE_RESTORELASTCLOSEDFILE, true, false, true, TEXT("Restore Recent Closed File")}, + { VK_T, IDM_FILE_RESTORELASTCLOSEDFILE, true, false, true, L"Restore Recent Closed File" }, { VK_F4, IDM_FILE_EXIT, false, true, false, nullptr }, // { VK_NULL, IDM_EDIT_UNDO, false, false, false, nullptr }, @@ -152,9 +152,9 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_NULL, IDM_EDIT_INSERT_DATETIME_SHORT, false, false, false, nullptr }, { VK_NULL, IDM_EDIT_INSERT_DATETIME_LONG, false, false, false, nullptr }, { VK_NULL, IDM_EDIT_INSERT_DATETIME_CUSTOMIZED, false, false, false, nullptr }, - { VK_NULL, IDM_FORMAT_TODOS, false, false, false, TEXT("EOL Conversion to Windows (CR LF)") }, - { VK_NULL, IDM_FORMAT_TOUNIX, false, false, false, TEXT("EOL Conversion to Unix (LF)") }, - { VK_NULL, IDM_FORMAT_TOMAC, false, false, false, TEXT("EOL Conversion to Macintosh (CR)") }, + { VK_NULL, IDM_FORMAT_TODOS, false, false, false, L"EOL Conversion to Windows (CR LF)" }, + { VK_NULL, IDM_FORMAT_TOUNIX, false, false, false, L"EOL Conversion to Unix (LF)" }, + { VK_NULL, IDM_FORMAT_TOMAC, false, false, false, L"EOL Conversion to Macintosh (CR)" }, { VK_NULL, IDM_EDIT_TRIMTRAILING, false, false, false, nullptr }, { VK_NULL, IDM_EDIT_TRIMLINEHEAD, false, false, false, nullptr }, { VK_NULL, IDM_EDIT_TRIM_BOTH, false, false, false, nullptr }, @@ -172,20 +172,20 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_NULL, IDM_EDIT_OPENINFOLDER, false, false, false, nullptr }, { VK_NULL, IDM_EDIT_SEARCHONINTERNET, false, false, false, nullptr }, { VK_NULL, IDM_EDIT_CHANGESEARCHENGINE, false, false, false, nullptr }, - { VK_NULL, IDM_EDIT_MULTISELECTALL, false, false, false, TEXT("Multi-select All: Ignore Case and Whole Word") }, - { VK_NULL, IDM_EDIT_MULTISELECTALLMATCHCASE, false, false, false, TEXT("Multi-select All: Match Case Only") }, - { VK_NULL, IDM_EDIT_MULTISELECTALLWHOLEWORD, false, false, false, TEXT("Multi-select All: Match Whole Word Only") }, - { VK_NULL, IDM_EDIT_MULTISELECTALLMATCHCASEWHOLEWORD, false, false, false, TEXT("Multi-select All: Match Case and Whole Word") }, - { VK_NULL, IDM_EDIT_MULTISELECTNEXT, false, false, false, TEXT("Multi-select Next: Ignore Case and Whole Word") }, - { VK_NULL, IDM_EDIT_MULTISELECTNEXTMATCHCASE, false, false, false, TEXT("Multi-select Next: Match Case Only") }, - { VK_NULL, IDM_EDIT_MULTISELECTNEXTWHOLEWORD, false, false, false, TEXT("Multi-select Next: Match Whole Word Only") }, - { VK_NULL, IDM_EDIT_MULTISELECTNEXTMATCHCASEWHOLEWORD, false, false, false, TEXT("Multi-select Next: Match Case and Whole Word") }, + { VK_NULL, IDM_EDIT_MULTISELECTALL, false, false, false, L"Multi-select All: Ignore Case and Whole Word" }, + { VK_NULL, IDM_EDIT_MULTISELECTALLMATCHCASE, false, false, false, L"Multi-select All: Match Case Only" }, + { VK_NULL, IDM_EDIT_MULTISELECTALLWHOLEWORD, false, false, false, L"Multi-select All: Match Whole Word Only" }, + { VK_NULL, IDM_EDIT_MULTISELECTALLMATCHCASEWHOLEWORD, false, false, false, L"Multi-select All: Match Case and Whole Word" }, + { VK_NULL, IDM_EDIT_MULTISELECTNEXT, false, false, false, L"Multi-select Next: Ignore Case and Whole Word" }, + { VK_NULL, IDM_EDIT_MULTISELECTNEXTMATCHCASE, false, false, false, L"Multi-select Next: Match Case Only" }, + { VK_NULL, IDM_EDIT_MULTISELECTNEXTWHOLEWORD, false, false, false, L"Multi-select Next: Match Whole Word Only" }, + { VK_NULL, IDM_EDIT_MULTISELECTNEXTMATCHCASEWHOLEWORD, false, false, false, L"Multi-select Next: Match Case and Whole Word" }, { VK_NULL, IDM_EDIT_MULTISELECTUNDO, false, false, false, nullptr }, { VK_NULL, IDM_EDIT_MULTISELECTSSKIP, false, false, false, nullptr }, // { VK_NULL, IDM_EDIT_COLUMNMODETIP, false, false, false, nullptr }, { VK_C, IDM_EDIT_COLUMNMODE, false, true, false, nullptr }, - { VK_NULL, IDM_EDIT_CHAR_PANEL, false, false, false, TEXT("Toggle Character Panel") }, - { VK_NULL, IDM_EDIT_CLIPBOARDHISTORY_PANEL, false, false, false, TEXT("Toggle Clipboard History") }, + { VK_NULL, IDM_EDIT_CHAR_PANEL, false, false, false, L"Toggle Character Panel" }, + { VK_NULL, IDM_EDIT_CLIPBOARDHISTORY_PANEL, false, false, false, L"Toggle Clipboard History" }, { VK_NULL, IDM_EDIT_SETREADONLY, false, false, false, nullptr }, { VK_NULL, IDM_EDIT_CLEARREADONLY, false, false, false, nullptr }, { VK_F, IDM_SEARCH_FIND, true, false, false, nullptr }, @@ -208,41 +208,41 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_NULL, IDM_SEARCH_CHANGED_NEXT, false, false, false, nullptr }, { VK_NULL, IDM_SEARCH_CLEAR_CHANGE_HISTORY, false, false, false, nullptr }, { VK_M, IDM_SEARCH_MARK, true, false, false, nullptr }, - { VK_NULL, IDM_SEARCH_MARKALLEXT1, false, false, false, TEXT("Style all using 1st style") }, - { VK_NULL, IDM_SEARCH_MARKALLEXT2, false, false, false, TEXT("Style all using 2nd style") }, - { VK_NULL, IDM_SEARCH_MARKALLEXT3, false, false, false, TEXT("Style all using 3rd style") }, - { VK_NULL, IDM_SEARCH_MARKALLEXT4, false, false, false, TEXT("Style all using 4th style") }, - { VK_NULL, IDM_SEARCH_MARKALLEXT5, false, false, false, TEXT("Style all using 5th style") }, - { VK_NULL, IDM_SEARCH_MARKONEEXT1, false, false, false, TEXT("Style one using 1st style") }, - { VK_NULL, IDM_SEARCH_MARKONEEXT2, false, false, false, TEXT("Style one using 2nd style") }, - { VK_NULL, IDM_SEARCH_MARKONEEXT3, false, false, false, TEXT("Style one using 3rd style") }, - { VK_NULL, IDM_SEARCH_MARKONEEXT4, false, false, false, TEXT("Style one using 4th style") }, - { VK_NULL, IDM_SEARCH_MARKONEEXT5, false, false, false, TEXT("Style one using 5th style") }, - { VK_NULL, IDM_SEARCH_UNMARKALLEXT1, false, false, false, TEXT("Clear 1st style") }, - { VK_NULL, IDM_SEARCH_UNMARKALLEXT2, false, false, false, TEXT("Clear 2nd style") }, - { VK_NULL, IDM_SEARCH_UNMARKALLEXT3, false, false, false, TEXT("Clear 3rd style") }, - { VK_NULL, IDM_SEARCH_UNMARKALLEXT4, false, false, false, TEXT("Clear 4th style") }, - { VK_NULL, IDM_SEARCH_UNMARKALLEXT5, false, false, false, TEXT("Clear 5th style") }, - { VK_NULL, IDM_SEARCH_CLEARALLMARKS, false, false, false, TEXT("Clear all styles") }, - { VK_1, IDM_SEARCH_GOPREVMARKER1, true, false, true, TEXT("Previous style of 1st style") }, - { VK_2, IDM_SEARCH_GOPREVMARKER2, true, false, true, TEXT("Previous style of 2nd style") }, - { VK_3, IDM_SEARCH_GOPREVMARKER3, true, false, true, TEXT("Previous style of 3rd style") }, - { VK_4, IDM_SEARCH_GOPREVMARKER4, true, false, true, TEXT("Previous style of 4th style") }, - { VK_5, IDM_SEARCH_GOPREVMARKER5, true, false, true, TEXT("Previous style of 5th style") }, - { VK_0, IDM_SEARCH_GOPREVMARKER_DEF, true, false, true, TEXT("Previous style of Find Mark style") }, - { VK_1, IDM_SEARCH_GONEXTMARKER1, true, false, false, TEXT("Next style of 1st style") }, - { VK_2, IDM_SEARCH_GONEXTMARKER2, true, false, false, TEXT("Next style of 2nd style") }, - { VK_3, IDM_SEARCH_GONEXTMARKER3, true, false, false, TEXT("Next style of 3rd style") }, - { VK_4, IDM_SEARCH_GONEXTMARKER4, true, false, false, TEXT("Next style of 4th style") }, - { VK_5, IDM_SEARCH_GONEXTMARKER5, true, false, false, TEXT("Next style of 5th style") }, - { VK_0, IDM_SEARCH_GONEXTMARKER_DEF, true, false, false, TEXT("Next style of Find Mark style") }, - { VK_NULL, IDM_SEARCH_STYLE1TOCLIP, false, false, false, TEXT("Copy Styled Text of 1st Style") }, - { VK_NULL, IDM_SEARCH_STYLE2TOCLIP, false, false, false, TEXT("Copy Styled Text of 2nd Style") }, - { VK_NULL, IDM_SEARCH_STYLE3TOCLIP, false, false, false, TEXT("Copy Styled Text of 3rd Style") }, - { VK_NULL, IDM_SEARCH_STYLE4TOCLIP, false, false, false, TEXT("Copy Styled Text of 4th Style") }, - { VK_NULL, IDM_SEARCH_STYLE5TOCLIP, false, false, false, TEXT("Copy Styled Text of 5th Style") }, - { VK_NULL, IDM_SEARCH_ALLSTYLESTOCLIP, false, false, false, TEXT("Copy Styled Text of All Styles") }, - { VK_NULL, IDM_SEARCH_MARKEDTOCLIP, false, false, false, TEXT("Copy Styled Text of Find Mark style") }, + { VK_NULL, IDM_SEARCH_MARKALLEXT1, false, false, false, L"Style all using 1st style" }, + { VK_NULL, IDM_SEARCH_MARKALLEXT2, false, false, false, L"Style all using 2nd style" }, + { VK_NULL, IDM_SEARCH_MARKALLEXT3, false, false, false, L"Style all using 3rd style" }, + { VK_NULL, IDM_SEARCH_MARKALLEXT4, false, false, false, L"Style all using 4th style" }, + { VK_NULL, IDM_SEARCH_MARKALLEXT5, false, false, false, L"Style all using 5th style" }, + { VK_NULL, IDM_SEARCH_MARKONEEXT1, false, false, false, L"Style one using 1st style" }, + { VK_NULL, IDM_SEARCH_MARKONEEXT2, false, false, false, L"Style one using 2nd style" }, + { VK_NULL, IDM_SEARCH_MARKONEEXT3, false, false, false, L"Style one using 3rd style" }, + { VK_NULL, IDM_SEARCH_MARKONEEXT4, false, false, false, L"Style one using 4th style" }, + { VK_NULL, IDM_SEARCH_MARKONEEXT5, false, false, false, L"Style one using 5th style" }, + { VK_NULL, IDM_SEARCH_UNMARKALLEXT1, false, false, false, L"Clear 1st style" }, + { VK_NULL, IDM_SEARCH_UNMARKALLEXT2, false, false, false, L"Clear 2nd style" }, + { VK_NULL, IDM_SEARCH_UNMARKALLEXT3, false, false, false, L"Clear 3rd style" }, + { VK_NULL, IDM_SEARCH_UNMARKALLEXT4, false, false, false, L"Clear 4th style" }, + { VK_NULL, IDM_SEARCH_UNMARKALLEXT5, false, false, false, L"Clear 5th style" }, + { VK_NULL, IDM_SEARCH_CLEARALLMARKS, false, false, false, L"Clear all styles" }, + { VK_1, IDM_SEARCH_GOPREVMARKER1, true, false, true, L"Previous style of 1st style" }, + { VK_2, IDM_SEARCH_GOPREVMARKER2, true, false, true, L"Previous style of 2nd style" }, + { VK_3, IDM_SEARCH_GOPREVMARKER3, true, false, true, L"Previous style of 3rd style" }, + { VK_4, IDM_SEARCH_GOPREVMARKER4, true, false, true, L"Previous style of 4th style" }, + { VK_5, IDM_SEARCH_GOPREVMARKER5, true, false, true, L"Previous style of 5th style" }, + { VK_0, IDM_SEARCH_GOPREVMARKER_DEF, true, false, true, L"Previous style of Find Mark style" }, + { VK_1, IDM_SEARCH_GONEXTMARKER1, true, false, false, L"Next style of 1st style" }, + { VK_2, IDM_SEARCH_GONEXTMARKER2, true, false, false, L"Next style of 2nd style" }, + { VK_3, IDM_SEARCH_GONEXTMARKER3, true, false, false, L"Next style of 3rd style" }, + { VK_4, IDM_SEARCH_GONEXTMARKER4, true, false, false, L"Next style of 4th style" }, + { VK_5, IDM_SEARCH_GONEXTMARKER5, true, false, false, L"Next style of 5th style" }, + { VK_0, IDM_SEARCH_GONEXTMARKER_DEF, true, false, false, L"Next style of Find Mark style" }, + { VK_NULL, IDM_SEARCH_STYLE1TOCLIP, false, false, false, L"Copy Styled Text of 1st Style" }, + { VK_NULL, IDM_SEARCH_STYLE2TOCLIP, false, false, false, L"Copy Styled Text of 2nd Style" }, + { VK_NULL, IDM_SEARCH_STYLE3TOCLIP, false, false, false, L"Copy Styled Text of 3rd Style" }, + { VK_NULL, IDM_SEARCH_STYLE4TOCLIP, false, false, false, L"Copy Styled Text of 4th Style" }, + { VK_NULL, IDM_SEARCH_STYLE5TOCLIP, false, false, false, L"Copy Styled Text of 5th Style" }, + { VK_NULL, IDM_SEARCH_ALLSTYLESTOCLIP, false, false, false, L"Copy Styled Text of All Styles" }, + { VK_NULL, IDM_SEARCH_MARKEDTOCLIP, false, false, false, L"Copy Styled Text of Find Mark style" }, { VK_F2, IDM_SEARCH_TOGGLE_BOOKMARK, true, false, false, nullptr }, { VK_F2, IDM_SEARCH_NEXT_BOOKMARK, false, false, false, nullptr }, { VK_F2, IDM_SEARCH_PREV_BOOKMARK, false, false, true, nullptr }, @@ -260,10 +260,10 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_F12, IDM_VIEW_POSTIT, false, false, false, nullptr }, { VK_NULL, IDM_VIEW_DISTRACTIONFREE, false, false, false, nullptr }, - { VK_NULL, IDM_VIEW_IN_FIREFOX, false, false, false, TEXT("View current file in Firefox") }, - { VK_NULL, IDM_VIEW_IN_CHROME, false, false, false, TEXT("View current file in Chrome") }, - { VK_NULL, IDM_VIEW_IN_IE, false, false, false, TEXT("View current file in IE") }, - { VK_NULL, IDM_VIEW_IN_EDGE, false, false, false, TEXT("View current file in Edge") }, + { VK_NULL, IDM_VIEW_IN_FIREFOX, false, false, false, L"View current file in Firefox" }, + { VK_NULL, IDM_VIEW_IN_CHROME, false, false, false, L"View current file in Chrome" }, + { VK_NULL, IDM_VIEW_IN_IE, false, false, false, L"View current file in IE" }, + { VK_NULL, IDM_VIEW_IN_EDGE, false, false, false, L"View current file in Edge" }, { VK_NULL, IDM_VIEW_TAB_SPACE, false, false, false, nullptr }, { VK_NULL, IDM_VIEW_EOL, false, false, false, nullptr }, @@ -297,8 +297,8 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_PRIOR, IDM_VIEW_TAB_PREV, true, false, false, nullptr }, { VK_NEXT, IDM_VIEW_TAB_MOVEFORWARD, true, false, true, nullptr }, { VK_PRIOR, IDM_VIEW_TAB_MOVEBACKWARD, true, false, true, nullptr }, - { VK_TAB, IDC_PREV_DOC, true, false, true, TEXT("Switch to previous document") }, - { VK_TAB, IDC_NEXT_DOC, true, false, false, TEXT("Switch to next document") }, + { VK_TAB, IDC_PREV_DOC, true, false, true, L"Switch to previous document" }, + { VK_TAB, IDC_NEXT_DOC, true, false, false, L"Switch to next document" }, { VK_NULL, IDM_VIEW_WRAP, false, false, false, nullptr }, { VK_H, IDM_VIEW_HIDELINES, false, true, false, nullptr }, { VK_F8, IDM_VIEW_SWITCHTO_OTHER_VIEW, false, false, false, nullptr }, @@ -307,43 +307,43 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_0, IDM_VIEW_UNFOLDALL, false, true, true, nullptr }, { VK_F, IDM_VIEW_FOLD_CURRENT, true, true, false, nullptr }, { VK_F, IDM_VIEW_UNFOLD_CURRENT, true, true, true, nullptr }, - { VK_1, IDM_VIEW_FOLD_1, false, true, false, TEXT("Fold Level 1") }, - { VK_2, IDM_VIEW_FOLD_2, false, true, false, TEXT("Fold Level 2") }, - { VK_3, IDM_VIEW_FOLD_3, false, true, false, TEXT("Fold Level 3") }, - { VK_4, IDM_VIEW_FOLD_4, false, true, false, TEXT("Fold Level 4") }, - { VK_5, IDM_VIEW_FOLD_5, false, true, false, TEXT("Fold Level 5") }, - { VK_6, IDM_VIEW_FOLD_6, false, true, false, TEXT("Fold Level 6") }, - { VK_7, IDM_VIEW_FOLD_7, false, true, false, TEXT("Fold Level 7") }, - { VK_8, IDM_VIEW_FOLD_8, false, true, false, TEXT("Fold Level 8") }, + { VK_1, IDM_VIEW_FOLD_1, false, true, false, L"Fold Level 1" }, + { VK_2, IDM_VIEW_FOLD_2, false, true, false, L"Fold Level 2" }, + { VK_3, IDM_VIEW_FOLD_3, false, true, false, L"Fold Level 3" }, + { VK_4, IDM_VIEW_FOLD_4, false, true, false, L"Fold Level 4" }, + { VK_5, IDM_VIEW_FOLD_5, false, true, false, L"Fold Level 5" }, + { VK_6, IDM_VIEW_FOLD_6, false, true, false, L"Fold Level 6" }, + { VK_7, IDM_VIEW_FOLD_7, false, true, false, L"Fold Level 7" }, + { VK_8, IDM_VIEW_FOLD_8, false, true, false, L"Fold Level 8" }, - { VK_1, IDM_VIEW_UNFOLD_1, false, true, true, TEXT("Unfold Level 1") }, - { VK_2, IDM_VIEW_UNFOLD_2, false, true, true, TEXT("Unfold Level 2") }, - { VK_3, IDM_VIEW_UNFOLD_3, false, true, true, TEXT("Unfold Level 3") }, - { VK_4, IDM_VIEW_UNFOLD_4, false, true, true, TEXT("Unfold Level 4") }, - { VK_5, IDM_VIEW_UNFOLD_5, false, true, true, TEXT("Unfold Level 5") }, - { VK_6, IDM_VIEW_UNFOLD_6, false, true, true, TEXT("Unfold Level 6") }, - { VK_7, IDM_VIEW_UNFOLD_7, false, true, true, TEXT("Unfold Level 7") }, - { VK_8, IDM_VIEW_UNFOLD_8, false, true, true, TEXT("Unfold Level 8") }, + { VK_1, IDM_VIEW_UNFOLD_1, false, true, true, L"Unfold Level 1" }, + { VK_2, IDM_VIEW_UNFOLD_2, false, true, true, L"Unfold Level 2" }, + { VK_3, IDM_VIEW_UNFOLD_3, false, true, true, L"Unfold Level 3" }, + { VK_4, IDM_VIEW_UNFOLD_4, false, true, true, L"Unfold Level 4" }, + { VK_5, IDM_VIEW_UNFOLD_5, false, true, true, L"Unfold Level 5" }, + { VK_6, IDM_VIEW_UNFOLD_6, false, true, true, L"Unfold Level 6" }, + { VK_7, IDM_VIEW_UNFOLD_7, false, true, true, L"Unfold Level 7" }, + { VK_8, IDM_VIEW_UNFOLD_8, false, true, true, L"Unfold Level 8" }, { VK_NULL, IDM_VIEW_SUMMARY, false, false, false, nullptr }, - { VK_NULL, IDM_VIEW_PROJECT_PANEL_1, false, false, false, TEXT("Toggle Project Panel 1") }, - { VK_NULL, IDM_VIEW_PROJECT_PANEL_2, false, false, false, TEXT("Toggle Project Panel 2") }, - { VK_NULL, IDM_VIEW_PROJECT_PANEL_3, false, false, false, TEXT("Toggle Project Panel 3") }, - { VK_NULL, IDM_VIEW_FILEBROWSER, false, false, false, TEXT("Toggle Folder as Workspace") }, - { VK_NULL, IDM_VIEW_DOC_MAP, false, false, false, TEXT("Toggle Document Map") }, - { VK_NULL, IDM_VIEW_DOCLIST, false, false, false, TEXT("Toggle Document List") }, - { VK_NULL, IDM_VIEW_FUNC_LIST, false, false, false, TEXT("Toggle Function List") }, - { VK_NULL, IDM_VIEW_SWITCHTO_PROJECT_PANEL_1, false, false, false, TEXT("Switch to Project Panel 1") }, - { VK_NULL, IDM_VIEW_SWITCHTO_PROJECT_PANEL_2, false, false, false, TEXT("Switch to Project Panel 2") }, - { VK_NULL, IDM_VIEW_SWITCHTO_PROJECT_PANEL_3, false, false, false, TEXT("Switch to Project Panel 3") }, - { VK_NULL, IDM_VIEW_SWITCHTO_FILEBROWSER, false, false, false, TEXT("Switch to Folder as Workspace") }, - { VK_NULL, IDM_VIEW_SWITCHTO_FUNC_LIST, false, false, false, TEXT("Switch to Function List") }, - { VK_NULL, IDM_VIEW_SWITCHTO_DOCLIST, false, false, false, TEXT("Switch to Document List") }, - { VK_NULL, IDM_VIEW_TAB_COLOUR_NONE, false, false, false, TEXT("Remove Tab Colour") }, - { VK_NULL, IDM_VIEW_TAB_COLOUR_1, false, false, false, TEXT("Apply Tab Colour 1") }, - { VK_NULL, IDM_VIEW_TAB_COLOUR_2, false, false, false, TEXT("Apply Tab Colour 2") }, - { VK_NULL, IDM_VIEW_TAB_COLOUR_3, false, false, false, TEXT("Apply Tab Colour 3") }, - { VK_NULL, IDM_VIEW_TAB_COLOUR_4, false, false, false, TEXT("Apply Tab Colour 4") }, - { VK_NULL, IDM_VIEW_TAB_COLOUR_5, false, false, false, TEXT("Apply Tab Colour 5") }, + { VK_NULL, IDM_VIEW_PROJECT_PANEL_1, false, false, false, L"Toggle Project Panel 1" }, + { VK_NULL, IDM_VIEW_PROJECT_PANEL_2, false, false, false, L"Toggle Project Panel 2" }, + { VK_NULL, IDM_VIEW_PROJECT_PANEL_3, false, false, false, L"Toggle Project Panel 3" }, + { VK_NULL, IDM_VIEW_FILEBROWSER, false, false, false, L"Toggle Folder as Workspace" }, + { VK_NULL, IDM_VIEW_DOC_MAP, false, false, false, L"Toggle Document Map" }, + { VK_NULL, IDM_VIEW_DOCLIST, false, false, false, L"Toggle Document List" }, + { VK_NULL, IDM_VIEW_FUNC_LIST, false, false, false, L"Toggle Function List" }, + { VK_NULL, IDM_VIEW_SWITCHTO_PROJECT_PANEL_1, false, false, false, L"Switch to Project Panel 1" }, + { VK_NULL, IDM_VIEW_SWITCHTO_PROJECT_PANEL_2, false, false, false, L"Switch to Project Panel 2" }, + { VK_NULL, IDM_VIEW_SWITCHTO_PROJECT_PANEL_3, false, false, false, L"Switch to Project Panel 3" }, + { VK_NULL, IDM_VIEW_SWITCHTO_FILEBROWSER, false, false, false, L"Switch to Folder as Workspace" }, + { VK_NULL, IDM_VIEW_SWITCHTO_FUNC_LIST, false, false, false, L"Switch to Function List" }, + { VK_NULL, IDM_VIEW_SWITCHTO_DOCLIST, false, false, false, L"Switch to Document List" }, + { VK_NULL, IDM_VIEW_TAB_COLOUR_NONE, false, false, false, L"Remove Tab Colour" }, + { VK_NULL, IDM_VIEW_TAB_COLOUR_1, false, false, false, L"Apply Tab Colour 1" }, + { VK_NULL, IDM_VIEW_TAB_COLOUR_2, false, false, false, L"Apply Tab Colour 2" }, + { VK_NULL, IDM_VIEW_TAB_COLOUR_3, false, false, false, L"Apply Tab Colour 3" }, + { VK_NULL, IDM_VIEW_TAB_COLOUR_4, false, false, false, L"Apply Tab Colour 4" }, + { VK_NULL, IDM_VIEW_TAB_COLOUR_5, false, false, false, L"Apply Tab Colour 5" }, { VK_NULL, IDM_VIEW_SYNSCROLLV, false, false, false, nullptr }, { VK_NULL, IDM_VIEW_SYNSCROLLH, false, false, false, nullptr }, { VK_R, IDM_EDIT_RTL, true, true, false, nullptr }, @@ -421,7 +421,7 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_NULL, IDM_SETTING_IMPORTSTYLETHEMES, false, false, false, nullptr }, { VK_NULL, IDM_SETTING_EDITCONTEXTMENU, false, false, false, nullptr }, - { VK_R, IDC_EDIT_TOGGLEMACRORECORDING, true, false, true, TEXT("Toggle macro recording")}, + { VK_R, IDC_EDIT_TOGGLEMACRORECORDING, true, false, true, L"Toggle macro recording" }, { VK_NULL, IDM_MACRO_STARTRECORDINGMACRO, false, false, false, nullptr }, { VK_NULL, IDM_MACRO_STOPRECORDINGMACRO, false, false, false, nullptr }, { VK_P, IDM_MACRO_PLAYBACKRECORDEDMACRO, true, false, true, nullptr }, @@ -431,14 +431,14 @@ static const WinMenuKeyDefinition winKeyDefs[] = { VK_F5, IDM_EXECUTE, false, false, false, nullptr }, { VK_NULL, IDM_WINDOW_WINDOWS, false, false, false, nullptr }, - { VK_NULL, IDM_WINDOW_SORT_FN_ASC, false, false, false, TEXT("Sort By Name A to Z") }, - { VK_NULL, IDM_WINDOW_SORT_FN_DSC, false, false, false, TEXT("Sort By Name Z to A") }, - { VK_NULL, IDM_WINDOW_SORT_FP_ASC, false, false, false, TEXT("Sort By Path A to Z") }, - { VK_NULL, IDM_WINDOW_SORT_FP_DSC, false, false, false, TEXT("Sort By Path Z to A") }, - { VK_NULL, IDM_WINDOW_SORT_FT_ASC, false, false, false, TEXT("Sort By Type A to Z") }, - { VK_NULL, IDM_WINDOW_SORT_FT_DSC, false, false, false, TEXT("Sort By Type Z to A") }, - { VK_NULL, IDM_WINDOW_SORT_FS_ASC, false, false, false, TEXT("Sort By Size Smaller to Larger") }, - { VK_NULL, IDM_WINDOW_SORT_FS_DSC, false, false, false, TEXT("Sort By Size Larger to Smaller") }, + { VK_NULL, IDM_WINDOW_SORT_FN_ASC, false, false, false, L"Sort By Name A to Z" }, + { VK_NULL, IDM_WINDOW_SORT_FN_DSC, false, false, false, L"Sort By Name Z to A" }, + { VK_NULL, IDM_WINDOW_SORT_FP_ASC, false, false, false, L"Sort By Path A to Z" }, + { VK_NULL, IDM_WINDOW_SORT_FP_DSC, false, false, false, L"Sort By Path Z to A" }, + { VK_NULL, IDM_WINDOW_SORT_FT_ASC, false, false, false, L"Sort By Type A to Z" }, + { VK_NULL, IDM_WINDOW_SORT_FT_DSC, false, false, false, L"Sort By Type Z to A" }, + { VK_NULL, IDM_WINDOW_SORT_FS_ASC, false, false, false, L"Sort By Size Smaller to Larger" }, + { VK_NULL, IDM_WINDOW_SORT_FS_DSC, false, false, false, L"Sort By Size Larger to Smaller" }, { VK_NULL, IDM_CMDLINEARGUMENTS, false, false, false, nullptr }, { VK_NULL, IDM_HOMESWEETHOME, false, false, false, nullptr }, @@ -451,8 +451,8 @@ static const WinMenuKeyDefinition winKeyDefs[] = // The following two commands are not in menu if (nppGUI._doesExistUpdater == 0). // They cannot be derived from menu then, only for this reason the text is specified here. // In localized environments, the text comes preferably from xml Menu/Main/Commands. - { VK_NULL, IDM_UPDATE_NPP, false, false, false, TEXT("Update Notepad++") }, - { VK_NULL, IDM_CONFUPDATERPROXY, false, false, false, TEXT("Set Updater Proxy...") }, + { VK_NULL, IDM_UPDATE_NPP, false, false, false, L"Update Notepad++" }, + { VK_NULL, IDM_CONFUPDATERPROXY, false, false, false, L"Set Updater Proxy..." }, { VK_NULL, IDM_DEBUGINFO, false, false, false, nullptr }, { VK_F1, IDM_ABOUT, false, false, false, nullptr } }; @@ -461,7 +461,7 @@ static const WinMenuKeyDefinition winKeyDefs[] = struct ScintillaKeyDefinition { - const TCHAR* name = nullptr; + const wchar_t* name = nullptr; int functionId = 0; bool isCtrl = false; bool isAlt = false; @@ -480,112 +480,112 @@ static const ScintillaKeyDefinition scintKeyDefs[] = //Scintilla command name, SCINTILLA_CMD_ID, Ctrl, Alt, Shift, V_KEY, NOTEPAD++_CMD_ID // ------------------------------------------------------------------------------------------------------------------- // - //{TEXT("SCI_CUT"), SCI_CUT, true, false, false, VK_X, IDM_EDIT_CUT}, - //{TEXT(""), SCI_CUT, false, false, true, VK_DELETE, 0}, - //{TEXT("SCI_COPY"), SCI_COPY, true, false, false, VK_C, IDM_EDIT_COPY}, - //{TEXT(""), SCI_COPY, true, false, false, VK_INSERT, 0}, - //{TEXT("SCI_PASTE"), SCI_PASTE, true, false, false, VK_V, IDM_EDIT_PASTE}, - //{TEXT("SCI_PASTE"), SCI_PASTE, false, false, true, VK_INSERT, IDM_EDIT_PASTE}, - {TEXT("SCI_SELECTALL"), SCI_SELECTALL, true, false, false, VK_A, IDM_EDIT_SELECTALL}, - {TEXT("SCI_CLEAR"), SCI_CLEAR, false, false, false, VK_DELETE, IDM_EDIT_DELETE}, - {TEXT("SCI_CLEARALL"), SCI_CLEARALL, false, false, false, 0, 0}, - {TEXT("SCI_UNDO"), SCI_UNDO, true, false, false, VK_Z, IDM_EDIT_UNDO}, - {TEXT(""), SCI_UNDO, false, true, false, VK_BACK, 0}, - {TEXT("SCI_REDO"), SCI_REDO, true, false, false, VK_Y, IDM_EDIT_REDO}, - {TEXT(""), SCI_REDO, true, false, true, VK_Z, 0}, - {TEXT("SCI_NEWLINE"), SCI_NEWLINE, false, false, false, VK_RETURN, 0}, - {TEXT(""), SCI_NEWLINE, false, false, true, VK_RETURN, 0}, - {TEXT("SCI_TAB"), SCI_TAB, false, false, false, VK_TAB, 0}, - {TEXT("SCI_BACKTAB"), SCI_BACKTAB, false, false, true, VK_TAB, 0}, - {TEXT("SCI_FORMFEED"), SCI_FORMFEED, false, false, false, 0, 0}, - {TEXT("SCI_ZOOMIN"), SCI_ZOOMIN, true, false, false, VK_ADD, IDM_VIEW_ZOOMIN}, - {TEXT("SCI_ZOOMOUT"), SCI_ZOOMOUT, true, false, false, VK_SUBTRACT, IDM_VIEW_ZOOMOUT}, - {TEXT("SCI_SETZOOM"), SCI_SETZOOM, true, false, false, VK_DIVIDE, IDM_VIEW_ZOOMRESTORE}, - {TEXT("SCI_SELECTIONDUPLICATE"), SCI_SELECTIONDUPLICATE, true, false, false, VK_D, 0}, - {TEXT("SCI_LINESJOIN"), SCI_LINESJOIN, false, false, false, 0, 0}, - {TEXT("SCI_SCROLLCARET"), SCI_SCROLLCARET, false, false, false, 0, 0}, - {TEXT("SCI_EDITTOGGLEOVERTYPE"), SCI_EDITTOGGLEOVERTYPE, false, false, false, VK_INSERT, 0}, - {TEXT("SCI_MOVECARETINSIDEVIEW"), SCI_MOVECARETINSIDEVIEW, false, false, false, 0, 0}, - {TEXT("SCI_LINEDOWN"), SCI_LINEDOWN, false, false, false, VK_DOWN, 0}, - {TEXT("SCI_LINEDOWNEXTEND"), SCI_LINEDOWNEXTEND, false, false, true, VK_DOWN, 0}, - {TEXT("SCI_LINEDOWNRECTEXTEND"), SCI_LINEDOWNRECTEXTEND, false, true, true, VK_DOWN, 0}, - {TEXT("SCI_LINESCROLLDOWN"), SCI_LINESCROLLDOWN, true, false, false, VK_DOWN, 0}, - {TEXT("SCI_LINEUP"), SCI_LINEUP, false, false, false, VK_UP, 0}, - {TEXT("SCI_LINEUPEXTEND"), SCI_LINEUPEXTEND, false, false, true, VK_UP, 0}, - {TEXT("SCI_LINEUPRECTEXTEND"), SCI_LINEUPRECTEXTEND, false, true, true, VK_UP, 0}, - {TEXT("SCI_LINESCROLLUP"), SCI_LINESCROLLUP, true, false, false, VK_UP, 0}, - {TEXT("SCI_PARADOWN"), SCI_PARADOWN, true, false, false, VK_OEM_6, 0}, - {TEXT("SCI_PARADOWNEXTEND"), SCI_PARADOWNEXTEND, true, false, true, VK_OEM_6, 0}, - {TEXT("SCI_PARAUP"), SCI_PARAUP, true, false, false, VK_OEM_4, 0}, - {TEXT("SCI_PARAUPEXTEND"), SCI_PARAUPEXTEND, true, false, true, VK_OEM_4, 0}, - {TEXT("SCI_CHARLEFT"), SCI_CHARLEFT, false, false, false, VK_LEFT, 0}, - {TEXT("SCI_CHARLEFTEXTEND"), SCI_CHARLEFTEXTEND, false, false, true, VK_LEFT, 0}, - {TEXT("SCI_CHARLEFTRECTEXTEND"), SCI_CHARLEFTRECTEXTEND, false, true, true, VK_LEFT, 0}, - {TEXT("SCI_CHARRIGHT"), SCI_CHARRIGHT, false, false, false, VK_RIGHT, 0}, - {TEXT("SCI_CHARRIGHTEXTEND"), SCI_CHARRIGHTEXTEND, false, false, true, VK_RIGHT, 0}, - {TEXT("SCI_CHARRIGHTRECTEXTEND"), SCI_CHARRIGHTRECTEXTEND, false, true, true, VK_RIGHT, 0}, - {TEXT("SCI_WORDLEFT"), SCI_WORDLEFT, true, false, false, VK_LEFT, 0}, - {TEXT("SCI_WORDLEFTEXTEND"), SCI_WORDLEFTEXTEND, true, false, true, VK_LEFT, 0}, - {TEXT("SCI_WORDRIGHT"), SCI_WORDRIGHT, true, false, false, VK_RIGHT, 0}, - {TEXT("SCI_WORDRIGHTEXTEND"), SCI_WORDRIGHTEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_WORDLEFTEND"), SCI_WORDLEFTEND, false, false, false, 0, 0}, - {TEXT("SCI_WORDLEFTENDEXTEND"), SCI_WORDLEFTENDEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_WORDRIGHTEND"), SCI_WORDRIGHTEND, false, false, false, 0, 0}, - {TEXT("SCI_WORDRIGHTENDEXTEND"), SCI_WORDRIGHTENDEXTEND, true, false, true, VK_RIGHT, 0}, - {TEXT("SCI_WORDPARTLEFT"), SCI_WORDPARTLEFT, true, false, false, VK_OEM_2, 0}, - {TEXT("SCI_WORDPARTLEFTEXTEND"), SCI_WORDPARTLEFTEXTEND, true, false, true, VK_OEM_2, 0}, - {TEXT("SCI_WORDPARTRIGHT"), SCI_WORDPARTRIGHT, true, false, false, VK_OEM_5, 0}, - {TEXT("SCI_WORDPARTRIGHTEXTEND"), SCI_WORDPARTRIGHTEXTEND, true, false, true, VK_OEM_5, 0}, - {TEXT("SCI_HOME"), SCI_HOME, false, false, false, 0, 0}, - {TEXT("SCI_HOMEEXTEND"), SCI_HOMEEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_HOMERECTEXTEND"), SCI_HOMERECTEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_HOMEDISPLAY"), SCI_HOMEDISPLAY, false, true, false, VK_HOME, 0}, - {TEXT("SCI_HOMEDISPLAYEXTEND"), SCI_HOMEDISPLAYEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_HOMEWRAP"), SCI_HOMEWRAP, false, false, false, 0, 0}, - {TEXT("SCI_HOMEWRAPEXTEND"), SCI_HOMEWRAPEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_VCHOME"), SCI_VCHOME, false, false, false, 0, 0}, - {TEXT("SCI_VCHOMEEXTEND"), SCI_VCHOMEEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_VCHOMERECTEXTEND"), SCI_VCHOMERECTEXTEND, false, true, true, VK_HOME, 0}, - {TEXT("SCI_VCHOMEDISPLAY"), SCI_VCHOMEDISPLAY, false, false, false, 0, 0}, - {TEXT("SCI_VCHOMEDISPLAYEXTEND"), SCI_VCHOMEDISPLAYEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_VCHOMEWRAP"), SCI_VCHOMEWRAP, false, false, false, VK_HOME, 0}, - {TEXT("SCI_VCHOMEWRAPEXTEND"), SCI_VCHOMEWRAPEXTEND, false, false, true, VK_HOME, 0}, - {TEXT("SCI_LINEEND"), SCI_LINEEND, false, false, false, 0, 0}, - {TEXT("SCI_LINEENDWRAPEXTEND"), SCI_LINEENDWRAPEXTEND, false, false, true, VK_END, 0}, - {TEXT("SCI_LINEENDRECTEXTEND"), SCI_LINEENDRECTEXTEND, false, true, true, VK_END, 0}, - {TEXT("SCI_LINEENDDISPLAY"), SCI_LINEENDDISPLAY, false, true, false, VK_END, 0}, - {TEXT("SCI_LINEENDDISPLAYEXTEND"), SCI_LINEENDDISPLAYEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_LINEENDWRAP"), SCI_LINEENDWRAP, false, false, false, VK_END, 0}, - {TEXT("SCI_LINEENDEXTEND"), SCI_LINEENDEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_DOCUMENTSTART"), SCI_DOCUMENTSTART, true, false, false, VK_HOME, 0}, - {TEXT("SCI_DOCUMENTSTARTEXTEND"), SCI_DOCUMENTSTARTEXTEND, true, false, true, VK_HOME, 0}, - {TEXT("SCI_DOCUMENTEND"), SCI_DOCUMENTEND, true, false, false, VK_END, 0}, - {TEXT("SCI_DOCUMENTENDEXTEND"), SCI_DOCUMENTENDEXTEND, true, false, true, VK_END, 0}, - {TEXT("SCI_PAGEUP"), SCI_PAGEUP, false, false, false, VK_PRIOR, 0}, - {TEXT("SCI_PAGEUPEXTEND"), SCI_PAGEUPEXTEND, false, false, true, VK_PRIOR, 0}, - {TEXT("SCI_PAGEUPRECTEXTEND"), SCI_PAGEUPRECTEXTEND, false, true, true, VK_PRIOR, 0}, - {TEXT("SCI_PAGEDOWN"), SCI_PAGEDOWN, false, false, false, VK_NEXT, 0}, - {TEXT("SCI_PAGEDOWNEXTEND"), SCI_PAGEDOWNEXTEND, false, false, true, VK_NEXT, 0}, - {TEXT("SCI_PAGEDOWNRECTEXTEND"), SCI_PAGEDOWNRECTEXTEND, false, true, true, VK_NEXT, 0}, - {TEXT("SCI_STUTTEREDPAGEUP"), SCI_STUTTEREDPAGEUP, false, false, false, 0, 0}, - {TEXT("SCI_STUTTEREDPAGEUPEXTEND"), SCI_STUTTEREDPAGEUPEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_STUTTEREDPAGEDOWN"), SCI_STUTTEREDPAGEDOWN, false, false, false, 0, 0}, - {TEXT("SCI_STUTTEREDPAGEDOWNEXTEND"), SCI_STUTTEREDPAGEDOWNEXTEND, false, false, false, 0, 0}, - {TEXT("SCI_DELETEBACK"), SCI_DELETEBACK, false, false, false, VK_BACK, 0}, - {TEXT(""), SCI_DELETEBACK, false, false, true, VK_BACK, 0}, - {TEXT("SCI_DELETEBACKNOTLINE"), SCI_DELETEBACKNOTLINE, false, false, false, 0, 0}, - {TEXT("SCI_DELWORDLEFT"), SCI_DELWORDLEFT, true, false, false, VK_BACK, 0}, - {TEXT("SCI_DELWORDRIGHT"), SCI_DELWORDRIGHT, true, false, false, VK_DELETE, 0}, - {TEXT("SCI_DELLINELEFT"), SCI_DELLINELEFT, true, false, true, VK_BACK, 0}, - {TEXT("SCI_DELLINERIGHT"), SCI_DELLINERIGHT, true, false, true, VK_DELETE, 0}, - {TEXT("SCI_LINEDELETE"), SCI_LINEDELETE, true, false, true, VK_L, 0}, - {TEXT("SCI_LINECUT"), SCI_LINECUT, true, false, false, VK_L, 0}, - {TEXT("SCI_LINECOPY"), SCI_LINECOPY, true, false, true, VK_X, 0}, - {TEXT("SCI_LINETRANSPOSE"), SCI_LINETRANSPOSE, true, false, false, VK_T, 0}, - {TEXT("SCI_LINEDUPLICATE"), SCI_LINEDUPLICATE, false, false, false, 0, IDM_EDIT_DUP_LINE}, - {TEXT("SCI_CANCEL"), SCI_CANCEL, false, false, false, VK_ESCAPE, 0}, - {TEXT("SCI_SWAPMAINANCHORCARET"), SCI_SWAPMAINANCHORCARET, false, false, false, 0, 0}, - {TEXT("SCI_ROTATESELECTION"), SCI_ROTATESELECTION, false, false, false, 0, 0} + //{L"SCI_CUT", SCI_CUT, true, false, false, VK_X, IDM_EDIT_CUT}, + //{L"", SCI_CUT, false, false, true, VK_DELETE, 0}, + //{L"SCI_COPY", SCI_COPY, true, false, false, VK_C, IDM_EDIT_COPY}, + //{L"", SCI_COPY, true, false, false, VK_INSERT, 0}, + //{L"SCI_PASTE", SCI_PASTE, true, false, false, VK_V, IDM_EDIT_PASTE}, + //{L"SCI_PASTE", SCI_PASTE, false, false, true, VK_INSERT, IDM_EDIT_PASTE}, + {L"SCI_SELECTALL", SCI_SELECTALL, true, false, false, VK_A, IDM_EDIT_SELECTALL}, + {L"SCI_CLEAR", SCI_CLEAR, false, false, false, VK_DELETE, IDM_EDIT_DELETE}, + {L"SCI_CLEARALL", SCI_CLEARALL, false, false, false, 0, 0}, + {L"SCI_UNDO", SCI_UNDO, true, false, false, VK_Z, IDM_EDIT_UNDO}, + {L"", SCI_UNDO, false, true, false, VK_BACK, 0}, + {L"SCI_REDO", SCI_REDO, true, false, false, VK_Y, IDM_EDIT_REDO}, + {L"", SCI_REDO, true, false, true, VK_Z, 0}, + {L"SCI_NEWLINE", SCI_NEWLINE, false, false, false, VK_RETURN, 0}, + {L"", SCI_NEWLINE, false, false, true, VK_RETURN, 0}, + {L"SCI_TAB", SCI_TAB, false, false, false, VK_TAB, 0}, + {L"SCI_BACKTAB", SCI_BACKTAB, false, false, true, VK_TAB, 0}, + {L"SCI_FORMFEED", SCI_FORMFEED, false, false, false, 0, 0}, + {L"SCI_ZOOMIN", SCI_ZOOMIN, true, false, false, VK_ADD, IDM_VIEW_ZOOMIN}, + {L"SCI_ZOOMOUT", SCI_ZOOMOUT, true, false, false, VK_SUBTRACT, IDM_VIEW_ZOOMOUT}, + {L"SCI_SETZOOM", SCI_SETZOOM, true, false, false, VK_DIVIDE, IDM_VIEW_ZOOMRESTORE}, + {L"SCI_SELECTIONDUPLICATE", SCI_SELECTIONDUPLICATE, true, false, false, VK_D, 0}, + {L"SCI_LINESJOIN", SCI_LINESJOIN, false, false, false, 0, 0}, + {L"SCI_SCROLLCARET", SCI_SCROLLCARET, false, false, false, 0, 0}, + {L"SCI_EDITTOGGLEOVERTYPE", SCI_EDITTOGGLEOVERTYPE, false, false, false, VK_INSERT, 0}, + {L"SCI_MOVECARETINSIDEVIEW", SCI_MOVECARETINSIDEVIEW, false, false, false, 0, 0}, + {L"SCI_LINEDOWN", SCI_LINEDOWN, false, false, false, VK_DOWN, 0}, + {L"SCI_LINEDOWNEXTEND", SCI_LINEDOWNEXTEND, false, false, true, VK_DOWN, 0}, + {L"SCI_LINEDOWNRECTEXTEND", SCI_LINEDOWNRECTEXTEND, false, true, true, VK_DOWN, 0}, + {L"SCI_LINESCROLLDOWN", SCI_LINESCROLLDOWN, true, false, false, VK_DOWN, 0}, + {L"SCI_LINEUP", SCI_LINEUP, false, false, false, VK_UP, 0}, + {L"SCI_LINEUPEXTEND", SCI_LINEUPEXTEND, false, false, true, VK_UP, 0}, + {L"SCI_LINEUPRECTEXTEND", SCI_LINEUPRECTEXTEND, false, true, true, VK_UP, 0}, + {L"SCI_LINESCROLLUP", SCI_LINESCROLLUP, true, false, false, VK_UP, 0}, + {L"SCI_PARADOWN", SCI_PARADOWN, true, false, false, VK_OEM_6, 0}, + {L"SCI_PARADOWNEXTEND", SCI_PARADOWNEXTEND, true, false, true, VK_OEM_6, 0}, + {L"SCI_PARAUP", SCI_PARAUP, true, false, false, VK_OEM_4, 0}, + {L"SCI_PARAUPEXTEND", SCI_PARAUPEXTEND, true, false, true, VK_OEM_4, 0}, + {L"SCI_CHARLEFT", SCI_CHARLEFT, false, false, false, VK_LEFT, 0}, + {L"SCI_CHARLEFTEXTEND", SCI_CHARLEFTEXTEND, false, false, true, VK_LEFT, 0}, + {L"SCI_CHARLEFTRECTEXTEND", SCI_CHARLEFTRECTEXTEND, false, true, true, VK_LEFT, 0}, + {L"SCI_CHARRIGHT", SCI_CHARRIGHT, false, false, false, VK_RIGHT, 0}, + {L"SCI_CHARRIGHTEXTEND", SCI_CHARRIGHTEXTEND, false, false, true, VK_RIGHT, 0}, + {L"SCI_CHARRIGHTRECTEXTEND", SCI_CHARRIGHTRECTEXTEND, false, true, true, VK_RIGHT, 0}, + {L"SCI_WORDLEFT", SCI_WORDLEFT, true, false, false, VK_LEFT, 0}, + {L"SCI_WORDLEFTEXTEND", SCI_WORDLEFTEXTEND, true, false, true, VK_LEFT, 0}, + {L"SCI_WORDRIGHT", SCI_WORDRIGHT, true, false, false, VK_RIGHT, 0}, + {L"SCI_WORDRIGHTEXTEND", SCI_WORDRIGHTEXTEND, false, false, false, 0, 0}, + {L"SCI_WORDLEFTEND", SCI_WORDLEFTEND, false, false, false, 0, 0}, + {L"SCI_WORDLEFTENDEXTEND", SCI_WORDLEFTENDEXTEND, false, false, false, 0, 0}, + {L"SCI_WORDRIGHTEND", SCI_WORDRIGHTEND, false, false, false, 0, 0}, + {L"SCI_WORDRIGHTENDEXTEND", SCI_WORDRIGHTENDEXTEND, true, false, true, VK_RIGHT, 0}, + {L"SCI_WORDPARTLEFT", SCI_WORDPARTLEFT, true, false, false, VK_OEM_2, 0}, + {L"SCI_WORDPARTLEFTEXTEND", SCI_WORDPARTLEFTEXTEND, true, false, true, VK_OEM_2, 0}, + {L"SCI_WORDPARTRIGHT", SCI_WORDPARTRIGHT, true, false, false, VK_OEM_5, 0}, + {L"SCI_WORDPARTRIGHTEXTEND", SCI_WORDPARTRIGHTEXTEND, true, false, true, VK_OEM_5, 0}, + {L"SCI_HOME", SCI_HOME, false, false, false, 0, 0}, + {L"SCI_HOMEEXTEND", SCI_HOMEEXTEND, false, false, false, 0, 0}, + {L"SCI_HOMERECTEXTEND", SCI_HOMERECTEXTEND, false, false, false, 0, 0}, + {L"SCI_HOMEDISPLAY", SCI_HOMEDISPLAY, false, true, false, VK_HOME, 0}, + {L"SCI_HOMEDISPLAYEXTEND", SCI_HOMEDISPLAYEXTEND, false, false, false, 0, 0}, + {L"SCI_HOMEWRAP", SCI_HOMEWRAP, false, false, false, 0, 0}, + {L"SCI_HOMEWRAPEXTEND", SCI_HOMEWRAPEXTEND, false, false, false, 0, 0}, + {L"SCI_VCHOME", SCI_VCHOME, false, false, false, 0, 0}, + {L"SCI_VCHOMEEXTEND", SCI_VCHOMEEXTEND, false, false, false, 0, 0}, + {L"SCI_VCHOMERECTEXTEND", SCI_VCHOMERECTEXTEND, false, true, true, VK_HOME, 0}, + {L"SCI_VCHOMEDISPLAY", SCI_VCHOMEDISPLAY, false, false, false, 0, 0}, + {L"SCI_VCHOMEDISPLAYEXTEND", SCI_VCHOMEDISPLAYEXTEND, false, false, false, 0, 0}, + {L"SCI_VCHOMEWRAP", SCI_VCHOMEWRAP, false, false, false, VK_HOME, 0}, + {L"SCI_VCHOMEWRAPEXTEND", SCI_VCHOMEWRAPEXTEND, false, false, true, VK_HOME, 0}, + {L"SCI_LINEEND", SCI_LINEEND, false, false, false, 0, 0}, + {L"SCI_LINEENDWRAPEXTEND", SCI_LINEENDWRAPEXTEND, false, false, true, VK_END, 0}, + {L"SCI_LINEENDRECTEXTEND", SCI_LINEENDRECTEXTEND, false, true, true, VK_END, 0}, + {L"SCI_LINEENDDISPLAY", SCI_LINEENDDISPLAY, false, true, false, VK_END, 0}, + {L"SCI_LINEENDDISPLAYEXTEND", SCI_LINEENDDISPLAYEXTEND, false, false, false, 0, 0}, + {L"SCI_LINEENDWRAP", SCI_LINEENDWRAP, false, false, false, VK_END, 0}, + {L"SCI_LINEENDEXTEND", SCI_LINEENDEXTEND, false, false, false, 0, 0}, + {L"SCI_DOCUMENTSTART", SCI_DOCUMENTSTART, true, false, false, VK_HOME, 0}, + {L"SCI_DOCUMENTSTARTEXTEND", SCI_DOCUMENTSTARTEXTEND, true, false, true, VK_HOME, 0}, + {L"SCI_DOCUMENTEND", SCI_DOCUMENTEND, true, false, false, VK_END, 0}, + {L"SCI_DOCUMENTENDEXTEND", SCI_DOCUMENTENDEXTEND, true, false, true, VK_END, 0}, + {L"SCI_PAGEUP", SCI_PAGEUP, false, false, false, VK_PRIOR, 0}, + {L"SCI_PAGEUPEXTEND", SCI_PAGEUPEXTEND, false, false, true, VK_PRIOR, 0}, + {L"SCI_PAGEUPRECTEXTEND", SCI_PAGEUPRECTEXTEND, false, true, true, VK_PRIOR, 0}, + {L"SCI_PAGEDOWN", SCI_PAGEDOWN, false, false, false, VK_NEXT, 0}, + {L"SCI_PAGEDOWNEXTEND", SCI_PAGEDOWNEXTEND, false, false, true, VK_NEXT, 0}, + {L"SCI_PAGEDOWNRECTEXTEND", SCI_PAGEDOWNRECTEXTEND, false, true, true, VK_NEXT, 0}, + {L"SCI_STUTTEREDPAGEUP", SCI_STUTTEREDPAGEUP, false, false, false, 0, 0}, + {L"SCI_STUTTEREDPAGEUPEXTEND", SCI_STUTTEREDPAGEUPEXTEND, false, false, false, 0, 0}, + {L"SCI_STUTTEREDPAGEDOWN", SCI_STUTTEREDPAGEDOWN, false, false, false, 0, 0}, + {L"SCI_STUTTEREDPAGEDOWNEXTEND", SCI_STUTTEREDPAGEDOWNEXTEND, false, false, false, 0, 0}, + {L"SCI_DELETEBACK", SCI_DELETEBACK, false, false, false, VK_BACK, 0}, + {L"", SCI_DELETEBACK, false, false, true, VK_BACK, 0}, + {L"SCI_DELETEBACKNOTLINE", SCI_DELETEBACKNOTLINE, false, false, false, 0, 0}, + {L"SCI_DELWORDLEFT", SCI_DELWORDLEFT, true, false, false, VK_BACK, 0}, + {L"SCI_DELWORDRIGHT", SCI_DELWORDRIGHT, true, false, false, VK_DELETE, 0}, + {L"SCI_DELLINELEFT", SCI_DELLINELEFT, true, false, true, VK_BACK, 0}, + {L"SCI_DELLINERIGHT", SCI_DELLINERIGHT, true, false, true, VK_DELETE, 0}, + {L"SCI_LINEDELETE", SCI_LINEDELETE, true, false, true, VK_L, 0}, + {L"SCI_LINECUT", SCI_LINECUT, true, false, false, VK_L, 0}, + {L"SCI_LINECOPY", SCI_LINECOPY, true, false, true, VK_X, 0}, + {L"SCI_LINETRANSPOSE", SCI_LINETRANSPOSE, true, false, false, VK_T, 0}, + {L"SCI_LINEDUPLICATE", SCI_LINEDUPLICATE, false, false, false, 0, IDM_EDIT_DUP_LINE}, + {L"SCI_CANCEL", SCI_CANCEL, false, false, false, VK_ESCAPE, 0}, + {L"SCI_SWAPMAINANCHORCARET", SCI_SWAPMAINANCHORCARET, false, false, false, 0, 0}, + {L"SCI_ROTATESELECTION", SCI_ROTATESELECTION, false, false, false, 0, 0} }; #define NONEEDSHORTCUTSXMLBACKUP_FILENAME L"v852NoNeedShortcutsBackup.xml" @@ -595,12 +595,12 @@ static const ScintillaKeyDefinition scintKeyDefs[] = typedef void (WINAPI *PGNSI)(LPSYSTEM_INFO); -int strVal(const TCHAR *str, int base) +int strVal(const wchar_t *str, int base) { if (!str) return -1; if (!str[0]) return 0; - TCHAR *finStr; + wchar_t *finStr; int result = wcstol(str, &finStr, base); if (*finStr != '\0') return -1; @@ -608,27 +608,27 @@ int strVal(const TCHAR *str, int base) } -int decStrVal(const TCHAR *str) +int decStrVal(const wchar_t *str) { return strVal(str, 10); } -int hexStrVal(const TCHAR *str) +int hexStrVal(const wchar_t *str) { return strVal(str, 16); } -int getKwClassFromName(const TCHAR *str) +int getKwClassFromName(const wchar_t *str) { - if (!lstrcmp(TEXT("instre1"), str)) return LANG_INDEX_INSTR; - if (!lstrcmp(TEXT("instre2"), str)) return LANG_INDEX_INSTR2; - if (!lstrcmp(TEXT("type1"), str)) return LANG_INDEX_TYPE; - if (!lstrcmp(TEXT("type2"), str)) return LANG_INDEX_TYPE2; - if (!lstrcmp(TEXT("type3"), str)) return LANG_INDEX_TYPE3; - if (!lstrcmp(TEXT("type4"), str)) return LANG_INDEX_TYPE4; - if (!lstrcmp(TEXT("type5"), str)) return LANG_INDEX_TYPE5; - if (!lstrcmp(TEXT("type6"), str)) return LANG_INDEX_TYPE6; - if (!lstrcmp(TEXT("type7"), str)) return LANG_INDEX_TYPE7; + if (!lstrcmp(L"instre1", str)) return LANG_INDEX_INSTR; + if (!lstrcmp(L"instre2", str)) return LANG_INDEX_INSTR2; + if (!lstrcmp(L"type1", str)) return LANG_INDEX_TYPE; + if (!lstrcmp(L"type2", str)) return LANG_INDEX_TYPE2; + if (!lstrcmp(L"type3", str)) return LANG_INDEX_TYPE3; + if (!lstrcmp(L"type4", str)) return LANG_INDEX_TYPE4; + if (!lstrcmp(L"type5", str)) return LANG_INDEX_TYPE5; + if (!lstrcmp(L"type6", str)) return LANG_INDEX_TYPE6; + if (!lstrcmp(L"type7", str)) return LANG_INDEX_TYPE7; if ((str[1] == '\0') && (str[0] >= '0') && (str[0] <= '8')) // up to KEYWORDSET_MAX return str[0] - '0'; @@ -640,12 +640,12 @@ int getKwClassFromName(const TCHAR *str) } // anonymous namespace -void cutString(const TCHAR* str2cut, vector& patternVect) +void cutString(const wchar_t* str2cut, vector& patternVect) { if (str2cut == nullptr) return; - const TCHAR *pBegin = str2cut; - const TCHAR *pEnd = pBegin; + const wchar_t *pBegin = str2cut; + const wchar_t *pEnd = pBegin; while (*pEnd != '\0') { @@ -663,12 +663,12 @@ void cutString(const TCHAR* str2cut, vector& patternVect) patternVect.emplace_back(pBegin, pEnd); } -void cutStringBy(const TCHAR* str2cut, vector& patternVect, char byChar, bool allowEmptyStr) +void cutStringBy(const wchar_t* str2cut, vector& patternVect, char byChar, bool allowEmptyStr) { if (str2cut == nullptr) return; - const TCHAR* pBegin = str2cut; - const TCHAR* pEnd = pBegin; + const wchar_t* pBegin = str2cut; + const wchar_t* pEnd = pBegin; while (*pEnd != '\0') { @@ -735,12 +735,12 @@ bool LocalizationSwitcher::switchToLang(const wchar_t *lang2switch) const } -std::wstring ThemeSwitcher::getThemeFromXmlFileName(const TCHAR *xmlFullPath) const +std::wstring ThemeSwitcher::getThemeFromXmlFileName(const wchar_t *xmlFullPath) const { if (!xmlFullPath || !xmlFullPath[0]) return std::wstring(); std::wstring fn(::PathFindFileName(xmlFullPath)); - PathRemoveExtension(const_cast(fn.c_str())); + PathRemoveExtension(const_cast(fn.c_str())); return fn; } @@ -894,7 +894,7 @@ winVer NppParameters::getWindowsVersion() return WV_UNKNOWN; } - pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(TEXT("kernel32.dll")), "GetNativeSystemInfo"); + pGNSI = (PGNSI) GetProcAddress(GetModuleHandle(L"kernel32.dll"), "GetNativeSystemInfo"); if (pGNSI != NULL) pGNSI(&si); else @@ -993,14 +993,14 @@ NppParameters::NppParameters() _winVersion = getWindowsVersion(); // Prepare for default path - TCHAR nppPath[MAX_PATH]; + wchar_t nppPath[MAX_PATH]; ::GetModuleFileName(NULL, nppPath, MAX_PATH); PathRemoveFileSpec(nppPath); _nppPath = nppPath; //Initialize current directory to startup directory - TCHAR curDir[MAX_PATH]; + wchar_t curDir[MAX_PATH]; ::GetCurrentDirectory(MAX_PATH, curDir); _currentDirectory = curDir; @@ -1032,11 +1032,11 @@ NppParameters::~NppParameters() } -bool NppParameters::reloadStylers(const TCHAR* stylePath) +bool NppParameters::reloadStylers(const wchar_t* stylePath) { delete _pXmlUserStylerDoc; - const TCHAR* stylePathToLoad = stylePath != nullptr ? stylePath : _stylerPath.c_str(); + const wchar_t* stylePathToLoad = stylePath != nullptr ? stylePath : _stylerPath.c_str(); _pXmlUserStylerDoc = new TiXmlDocument(stylePathToLoad); bool loadOkay = _pXmlUserStylerDoc->LoadFile(); @@ -1044,14 +1044,14 @@ bool NppParameters::reloadStylers(const TCHAR* stylePath) { if (!_pNativeLangSpeaker) { - ::MessageBox(NULL, stylePathToLoad, TEXT("Load stylers.xml failed"), MB_OK); + ::MessageBox(NULL, stylePathToLoad, L"Load stylers.xml failed", MB_OK); } else { _pNativeLangSpeaker->messageBox("LoadStylersFailed", NULL, - TEXT("Load \"$STR_REPLACE$\" failed!"), - TEXT("Load stylers.xml failed"), + L"Load \"$STR_REPLACE$\" failed!", + L"Load stylers.xml failed", MB_OK, 0, stylePathToLoad); @@ -1082,7 +1082,7 @@ bool NppParameters::reloadLang() if (!PathFileExists(nativeLangPath.c_str())) { nativeLangPath = _nppPath; - pathAppend(nativeLangPath, std::wstring(TEXT("nativeLang.xml"))); + pathAppend(nativeLangPath, std::wstring(L"nativeLang.xml")); if (!PathFileExists(nativeLangPath.c_str())) return false; } @@ -1103,7 +1103,7 @@ bool NppParameters::reloadLang() std::wstring NppParameters::getSpecialFolderLocation(int folderKind) { - TCHAR path[MAX_PATH]; + wchar_t path[MAX_PATH]; const HRESULT specialLocationResult = SHGetFolderPath(nullptr, folderKind, nullptr, SHGFP_TYPE_CURRENT, path); std::wstring result; @@ -1125,7 +1125,7 @@ std::wstring NppParameters::getSettingsFolder() if (settingsFolderPath.empty()) return _nppPath; - pathAppend(settingsFolderPath, TEXT("Notepad++")); + pathAppend(settingsFolderPath, L"Notepad++"); return settingsFolderPath; } @@ -1152,7 +1152,7 @@ bool NppParameters::load() if (_winVersion >= WV_VISTA) { std::wstring progPath = getSpecialFolderLocation(CSIDL_PROGRAM_FILES); - TCHAR nppDirLocation[MAX_PATH]; + wchar_t nppDirLocation[MAX_PATH]; wcscpy_s(nppDirLocation, _nppPath.c_str()); ::PathRemoveFileSpec(nppDirLocation); @@ -1162,7 +1162,7 @@ bool NppParameters::load() } _pluginRootDir = _nppPath; - pathAppend(_pluginRootDir, TEXT("plugins")); + pathAppend(_pluginRootDir, L"plugins"); // // the 3rd priority: general default configuration @@ -1172,21 +1172,21 @@ bool NppParameters::load() { _userPath = nppPluginRootParent = _nppPath; _userPluginConfDir = _pluginRootDir; - pathAppend(_userPluginConfDir, TEXT("Config")); + pathAppend(_userPluginConfDir, L"Config"); } else { _userPath = getSpecialFolderLocation(CSIDL_APPDATA); - pathAppend(_userPath, TEXT("Notepad++")); + pathAppend(_userPath, L"Notepad++"); if (!PathFileExists(_userPath.c_str())) ::CreateDirectory(_userPath.c_str(), NULL); _appdataNppDir = _userPluginConfDir = _userPath; - pathAppend(_userPluginConfDir, TEXT("plugins")); + pathAppend(_userPluginConfDir, L"plugins"); if (!PathFileExists(_userPluginConfDir.c_str())) ::CreateDirectory(_userPluginConfDir.c_str(), NULL); - pathAppend(_userPluginConfDir, TEXT("Config")); + pathAppend(_userPluginConfDir, L"Config"); if (!PathFileExists(_userPluginConfDir.c_str())) ::CreateDirectory(_userPluginConfDir.c_str(), NULL); @@ -1195,7 +1195,7 @@ bool NppParameters::load() } _pluginConfDir = _pluginRootDir; // for plugin list home - pathAppend(_pluginConfDir, TEXT("Config")); + pathAppend(_pluginConfDir, L"Config"); if (!PathFileExists(nppPluginRootParent.c_str())) ::CreateDirectory(nppPluginRootParent.c_str(), NULL); @@ -1206,7 +1206,7 @@ bool NppParameters::load() // Detection cloud settings std::wstring cloudChoicePath{_userPath}; - cloudChoicePath += TEXT("\\cloud\\choice"); + cloudChoicePath += L"\\cloud\\choice"; // // the 2nd priority: cloud Choice Path @@ -1240,10 +1240,10 @@ bool NppParameters::load() { // The following text is not translatable. // _pNativeLangSpeaker is initialized AFTER _userPath being dterminated because nativeLang.xml is from from _userPath. - std::wstring errMsg = TEXT("The given path\r"); + std::wstring errMsg = L"The given path\r"; errMsg += _cmdSettingsDir; - errMsg += TEXT("\nvia command line \"-settingsDir=\" is not a valid directory.\rThis argument will be ignored."); - ::MessageBox(NULL, errMsg.c_str(), TEXT("Invalid directory"), MB_OK); + errMsg += L"\nvia command line \"-settingsDir=\" is not a valid directory.\rThis argument will be ignored."; + ::MessageBox(NULL, errMsg.c_str(), L"Invalid directory", MB_OK); } else { @@ -1256,7 +1256,7 @@ bool NppParameters::load() // langs.xml : for per user // //--------------------------// std::wstring langs_xml_path(_userPath); - pathAppend(langs_xml_path, TEXT("langs.xml")); + pathAppend(langs_xml_path, L"langs.xml"); BOOL doRecover = FALSE; if (::PathFileExists(langs_xml_path.c_str())) @@ -1271,13 +1271,13 @@ bool NppParameters::load() { doRecover = _pNativeLangSpeaker->messageBox("LoadLangsFailed", NULL, - TEXT("Load langs.xml failed!\rDo you want to recover your langs.xml?"), - TEXT("Configurator"), + L"Load langs.xml failed!\rDo you want to recover your langs.xml?", + L"Configurator", MB_YESNO); } else { - doRecover = ::MessageBox(NULL, TEXT("Load langs.xml failed!\rDo you want to recover your langs.xml?"), TEXT("Configurator"), MB_YESNO); + doRecover = ::MessageBox(NULL, L"Load langs.xml failed!\rDo you want to recover your langs.xml?", L"Configurator", MB_YESNO); } } } @@ -1288,7 +1288,7 @@ bool NppParameters::load() if (doRecover) { std::wstring srcLangsPath(_nppPath); - pathAppend(srcLangsPath, TEXT("langs.model.xml")); + pathAppend(srcLangsPath, L"langs.model.xml"); ::CopyFile(srcLangsPath.c_str(), langs_xml_path.c_str(), FALSE); } @@ -1302,13 +1302,13 @@ bool NppParameters::load() { _pNativeLangSpeaker->messageBox("LoadLangsFailedFinal", NULL, - TEXT("Load langs.xml failed!"), - TEXT("Configurator"), + L"Load langs.xml failed!", + L"Configurator", MB_OK); } else { - ::MessageBox(NULL, TEXT("Load langs.xml failed!"), TEXT("Configurator"), MB_OK); + ::MessageBox(NULL, L"Load langs.xml failed!", L"Configurator", MB_OK); } delete _pXmlDoc; @@ -1322,10 +1322,10 @@ bool NppParameters::load() // config.xml : for per user // //---------------------------// std::wstring configPath(_userPath); - pathAppend(configPath, TEXT("config.xml")); + pathAppend(configPath, L"config.xml"); std::wstring srcConfigPath(_nppPath); - pathAppend(srcConfigPath, TEXT("config.model.xml")); + pathAppend(srcConfigPath, L"config.model.xml"); if (!::PathFileExists(configPath.c_str())) ::CopyFile(srcConfigPath.c_str(), configPath.c_str(), FALSE); @@ -1335,7 +1335,7 @@ bool NppParameters::load() if (!loadOkay) { - TiXmlDeclaration* decl = new TiXmlDeclaration(TEXT("1.0"), TEXT("UTF-8"), TEXT("")); + TiXmlDeclaration* decl = new TiXmlDeclaration(L"1.0", L"UTF-8", L""); _pXmlUserDoc->LinkEndChild(decl); } else @@ -1348,12 +1348,12 @@ bool NppParameters::load() //----------------------------// _stylerPath = _userPath; - pathAppend(_stylerPath, TEXT("stylers.xml")); + pathAppend(_stylerPath, L"stylers.xml"); if (!PathFileExists(_stylerPath.c_str())) { std::wstring srcStylersPath(_nppPath); - pathAppend(srcStylersPath, TEXT("stylers.model.xml")); + pathAppend(srcStylersPath, L"stylers.model.xml"); ::CopyFile(srcStylersPath.c_str(), _stylerPath.c_str(), TRUE); } @@ -1370,15 +1370,15 @@ bool NppParameters::load() { _pNativeLangSpeaker->messageBox("LoadStylersFailed", NULL, - TEXT("Load \"$STR_REPLACE$\" failed!"), - TEXT("Load stylers.xml failed"), + L"Load \"$STR_REPLACE$\" failed!", + L"Load stylers.xml failed", MB_OK, 0, _stylerPath.c_str()); } else { - ::MessageBox(NULL, _stylerPath.c_str(), TEXT("Load stylers.xml failed"), MB_OK); + ::MessageBox(NULL, _stylerPath.c_str(), L"Load stylers.xml failed", MB_OK); } delete _pXmlUserStylerDoc; _pXmlUserStylerDoc = NULL; @@ -1395,11 +1395,11 @@ bool NppParameters::load() // userDefineLang.xml : for per user // //-----------------------------------// _userDefineLangsFolderPath = _userDefineLangPath = _userPath; - pathAppend(_userDefineLangPath, TEXT("userDefineLang.xml")); - pathAppend(_userDefineLangsFolderPath, TEXT("userDefineLangs")); + pathAppend(_userDefineLangPath, L"userDefineLang.xml"); + pathAppend(_userDefineLangsFolderPath, L"userDefineLangs"); std::vector udlFiles; - getFilesInFolder(udlFiles, TEXT("*.xml"), _userDefineLangsFolderPath); + getFilesInFolder(udlFiles, L"*.xml", _userDefineLangsFolderPath); _pXmlUserLangDoc = new TiXmlDocument(_userDefineLangPath); loadOkay = _pXmlUserLangDoc->LoadFile(); @@ -1440,7 +1440,7 @@ bool NppParameters::load() std::wstring nativeLangPath; nativeLangPath = _userPath; - pathAppend(nativeLangPath, TEXT("nativeLang.xml")); + pathAppend(nativeLangPath, L"nativeLang.xml"); // LocalizationSwitcher should use always user path _localizationSwitcher._nativeLangPath = nativeLangPath; @@ -1449,7 +1449,7 @@ bool NppParameters::load() { // overwrite nativeLangPath variable nativeLangPath = _nppPath; - pathAppend(nativeLangPath, TEXT("localization\\")); + pathAppend(nativeLangPath, L"localization\\"); pathAppend(nativeLangPath, _startWithLocFileName); } else // use %appdata% location, or (if absence then) npp installed location @@ -1457,7 +1457,7 @@ bool NppParameters::load() if (!PathFileExists(nativeLangPath.c_str())) { nativeLangPath = _nppPath; - pathAppend(nativeLangPath, TEXT("nativeLang.xml")); + pathAppend(nativeLangPath, L"nativeLang.xml"); } } @@ -1476,7 +1476,7 @@ bool NppParameters::load() // toolbarIcons.xml : for per user // //---------------------------------// std::wstring toolbarIconsPath(_userPath); - pathAppend(toolbarIconsPath, TEXT("toolbarIcons.xml")); + pathAppend(toolbarIconsPath, L"toolbarIcons.xml"); _pXmlToolIconsDoc = new TiXmlDocument(toolbarIconsPath); loadOkay = _pXmlToolIconsDoc->LoadFile(); @@ -1531,12 +1531,12 @@ bool NppParameters::load() // contextMenu.xml : for per user // //---------------------------------// _contextMenuPath = _userPath; - pathAppend(_contextMenuPath, TEXT("contextMenu.xml")); + pathAppend(_contextMenuPath, L"contextMenu.xml"); if (!PathFileExists(_contextMenuPath.c_str())) { std::wstring srcContextMenuPath(_nppPath); - pathAppend(srcContextMenuPath, TEXT("contextMenu.xml")); + pathAppend(srcContextMenuPath, L"contextMenu.xml"); ::CopyFile(srcContextMenuPath.c_str(), _contextMenuPath.c_str(), TRUE); } @@ -1554,7 +1554,7 @@ bool NppParameters::load() // tabContextMenu.xml : for per user, optional // //---------------------------------------------// _tabContextMenuPath = _userPath; - pathAppend(_tabContextMenuPath, TEXT("tabContextMenu.xml")); + pathAppend(_tabContextMenuPath, L"tabContextMenu.xml"); _pXmlTabContextMenuDocA = new TiXmlDocumentA(); loadOkay = _pXmlTabContextMenuDocA->LoadUnicodeFilePath(_tabContextMenuPath.c_str()); @@ -1568,7 +1568,7 @@ bool NppParameters::load() // session.xml : for per user // //----------------------------// - pathAppend(_sessionPath, TEXT("session.xml")); + pathAppend(_sessionPath, L"session.xml"); // Don't load session.xml if not required in order to speed up!! const NppGUI & nppGUI = (NppParameters::getInstance()).getNppGUI(); @@ -1635,7 +1635,7 @@ bool NppParameters::load() // manually in order to set selected text's foreground color. // //-------------------------------------------------------------// std::wstring enableSelectFgColorPath = _userPath; - pathAppend(enableSelectFgColorPath, TEXT("enableSelectFgColor.xml")); + pathAppend(enableSelectFgColorPath, L"enableSelectFgColor.xml"); if (PathFileExists(enableSelectFgColorPath.c_str())) { @@ -1651,7 +1651,7 @@ bool NppParameters::load() //-------------------------------------------------------------// filePath = _nppPath; issueFileName = nppLogNetworkDriveIssue; - issueFileName += TEXT(".xml"); + issueFileName += L".xml"; pathAppend(filePath, issueFileName); _doNppLogNetworkDriveIssue = (PathFileExists(filePath.c_str()) == TRUE); if (!_doNppLogNetworkDriveIssue) @@ -1668,7 +1668,7 @@ bool NppParameters::load() //-------------------------------------------------------------// filePath = _nppPath; issueFileName = nppLogNulContentCorruptionIssue; - issueFileName += TEXT(".xml"); + issueFileName += L".xml"; pathAppend(filePath, issueFileName); _doNppLogNulContentCorruptionIssue = (PathFileExists(filePath.c_str()) == TRUE); if (!_doNppLogNulContentCorruptionIssue) @@ -1727,7 +1727,7 @@ void NppParameters::saveConfig_xml() } -void NppParameters::setWorkSpaceFilePath(int i, const TCHAR* wsFile) +void NppParameters::setWorkSpaceFilePath(int i, const wchar_t* wsFile) { if (i < 0 || i > 2 || !wsFile) return; @@ -1767,7 +1767,7 @@ bool NppParameters::isExistingExternalLangName(const char* newName) const } -const TCHAR* NppParameters::getUserDefinedLangNameFromExt(TCHAR *ext, TCHAR *fullName) const +const wchar_t* NppParameters::getUserDefinedLangNameFromExt(wchar_t *ext, wchar_t *fullName) const { if ((!ext) || (!ext[0])) return nullptr; @@ -1805,7 +1805,7 @@ const TCHAR* NppParameters::getUserDefinedLangNameFromExt(TCHAR *ext, TCHAR *ful } -int NppParameters::getExternalLangIndexFromName(const TCHAR* externalLangName) const +int NppParameters::getExternalLangIndexFromName(const wchar_t* externalLangName) const { WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance(); for (int i = 0 ; i < _nbExternalLang ; ++i) @@ -1817,7 +1817,7 @@ int NppParameters::getExternalLangIndexFromName(const TCHAR* externalLangName) c } -UserLangContainer* NppParameters::getULCFromName(const TCHAR *userLangName) +UserLangContainer* NppParameters::getULCFromName(const wchar_t *userLangName) { for (int i = 0 ; i < _nbUserLang ; ++i) { @@ -1832,7 +1832,7 @@ UserLangContainer* NppParameters::getULCFromName(const TCHAR *userLangName) COLORREF NppParameters::getCurLineHilitingColour() { - const Style * pStyle = _widgetStyleArray.findByName(TEXT("Current line background colour")); + const Style * pStyle = _widgetStyleArray.findByName(L"Current line background colour"); if (!pStyle) return COLORREF(-1); return pStyle->_bgColor; @@ -1841,7 +1841,7 @@ COLORREF NppParameters::getCurLineHilitingColour() void NppParameters::setCurLineHilitingColour(COLORREF colour2Set) { - Style * pStyle = _widgetStyleArray.findByName(TEXT("Current line background colour")); + Style * pStyle = _widgetStyleArray.findByName(L"Current line background colour"); if (!pStyle) return; pStyle->_bgColor = colour2Set; @@ -1853,7 +1853,7 @@ static int CALLBACK EnumFontFamExProc(const LOGFONT* lpelfe, const TEXTMETRIC*, { std::vector& strVect = *(std::vector *)lParam; const int32_t vectSize = static_cast(strVect.size()); - const TCHAR* lfFaceName = ((ENUMLOGFONTEX*)lpelfe)->elfLogFont.lfFaceName; + const wchar_t* lfFaceName = ((ENUMLOGFONTEX*)lpelfe)->elfLogFont.lfFaceName; //Search through all the fonts, EnumFontFamiliesEx never states anything about order //Start at the end though, that's the most likely place to find a duplicate @@ -1903,7 +1903,7 @@ bool NppParameters::isInFontList(const std::wstring& fontName2Search) const void NppParameters::getLangKeywordsFromXmlTree() { TiXmlNode *root = - _pXmlDoc->FirstChild(TEXT("NotepadPlus")); + _pXmlDoc->FirstChild(L"NotepadPlus"); if (!root) return; feedKeyWordsParameters(root); } @@ -1911,7 +1911,7 @@ void NppParameters::getLangKeywordsFromXmlTree() void NppParameters::getExternalLexerFromXmlTree(TiXmlDocument* externalLexerDoc) { - TiXmlNode *root = externalLexerDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *root = externalLexerDoc->FirstChild(L"NotepadPlus"); if (!root) return; feedKeyWordsParameters(root); feedStylerArray(root); @@ -1929,7 +1929,7 @@ int NppParameters::addExternalLangToEnd(ExternalLangContainer * externalLang) bool NppParameters::getUserStylersFromXmlTree() { - TiXmlNode *root = _pXmlUserStylerDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *root = _pXmlUserStylerDoc->FirstChild(L"NotepadPlus"); if (!root) return false; return feedStylerArray(root); } @@ -1940,7 +1940,7 @@ bool NppParameters::getUserParametersFromXmlTree() if (!_pXmlUserDoc) return false; - TiXmlNode *root = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *root = _pXmlUserDoc->FirstChild(L"NotepadPlus"); if (!root) return false; @@ -1951,11 +1951,11 @@ bool NppParameters::getUserParametersFromXmlTree() feedFileListParameters(root); // Erase the History root - TiXmlNode *node = root->FirstChildElement(TEXT("History")); + TiXmlNode *node = root->FirstChildElement(L"History"); root->RemoveChild(node); // Add a new empty History root - TiXmlElement HistoryNode(TEXT("History")); + TiXmlElement HistoryNode(L"History"); root->InsertEndChild(HistoryNode); //Get Find history parameters @@ -1979,7 +1979,7 @@ std::pair NppParameters::addUserDefineLangsFromXml if (!tixmldoc) return std::make_pair(static_cast(0), static_cast(0)); - TiXmlNode *root = tixmldoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *root = tixmldoc->FirstChild(L"NotepadPlus"); if (!root) return std::make_pair(static_cast(0), static_cast(0)); @@ -2113,7 +2113,7 @@ int NppParameters::getCmdIdFromMenuEntryItemName(HMENU mainMenuHadle, const std: int nbMenuEntry = ::GetMenuItemCount(mainMenuHadle); for (int i = 0; i < nbMenuEntry; ++i) { - TCHAR menuEntryString[menuItemStrLenMax]; + wchar_t menuEntryString[menuItemStrLenMax]; ::GetMenuString(mainMenuHadle, i, menuEntryString, menuItemStrLenMax, MF_BYPOSITION); if (wcsicmp(menuEntryName.c_str(), purgeMenuItemString(menuEntryString).c_str()) == 0) { @@ -2138,7 +2138,7 @@ int NppParameters::getCmdIdFromMenuEntryItemName(HMENU mainMenuHadle, const std: else { // Check current menu position. - TCHAR cmdStr[menuItemStrLenMax]; + wchar_t cmdStr[menuItemStrLenMax]; ::GetMenuString(currMenu, currMenuPos, cmdStr, menuItemStrLenMax, MF_BYPOSITION); if (wcsicmp(menuItemName.c_str(), purgeMenuItemString(cmdStr).c_str()) == 0) { @@ -2173,7 +2173,7 @@ int NppParameters::getPluginCmdIdFromMenuEntryItemName(HMENU pluginsMenu, const int nbPlugins = ::GetMenuItemCount(pluginsMenu); for (int i = 0; i < nbPlugins; ++i) { - TCHAR menuItemString[menuItemStrLenMax]; + wchar_t menuItemString[menuItemStrLenMax]; ::GetMenuString(pluginsMenu, i, menuItemString, menuItemStrLenMax, MF_BYPOSITION); if (wcsicmp(pluginName.c_str(), purgeMenuItemString(menuItemString).c_str()) == 0) { @@ -2181,7 +2181,7 @@ int NppParameters::getPluginCmdIdFromMenuEntryItemName(HMENU pluginsMenu, const int nbPluginCmd = ::GetMenuItemCount(pluginMenu); for (int j = 0; j < nbPluginCmd; ++j) { - TCHAR pluginCmdStr[menuItemStrLenMax]; + wchar_t pluginCmdStr[menuItemStrLenMax]; ::GetMenuString(pluginMenu, j, pluginCmdStr, menuItemStrLenMax, MF_BYPOSITION); if (wcsicmp(pluginCmdName.c_str(), purgeMenuItemString(pluginCmdStr).c_str()) == 0) { @@ -2222,8 +2222,8 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins std::wstring folderName; std::wstring displayAs; - folderName = folderNameDefaultA ? wmc.char2wchar(folderNameDefaultA, SC_CP_UTF8) : TEXT(""); - displayAs = displayAsA ? wmc.char2wchar(displayAsA, SC_CP_UTF8) : TEXT(""); + folderName = folderNameDefaultA ? wmc.char2wchar(folderNameDefaultA, SC_CP_UTF8) : L""; + displayAs = displayAsA ? wmc.char2wchar(displayAsA, SC_CP_UTF8) : L""; if (folderNameTranslateID_A) { @@ -2243,8 +2243,8 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins std::wstring menuEntryName; std::wstring menuItemName; - menuEntryName = menuEntryNameA?wmc.char2wchar(menuEntryNameA, SC_CP_UTF8):TEXT(""); - menuItemName = menuItemNameA?wmc.char2wchar(menuItemNameA, SC_CP_UTF8):TEXT(""); + menuEntryName = menuEntryNameA?wmc.char2wchar(menuEntryNameA, SC_CP_UTF8):L""; + menuItemName = menuItemNameA?wmc.char2wchar(menuItemNameA, SC_CP_UTF8):L""; if (!menuEntryName.empty() && !menuItemName.empty()) { @@ -2259,8 +2259,8 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins std::wstring pluginName; std::wstring pluginCmdName; - pluginName = pluginNameA?wmc.char2wchar(pluginNameA, SC_CP_UTF8):TEXT(""); - pluginCmdName = pluginCmdNameA?wmc.char2wchar(pluginCmdNameA, SC_CP_UTF8):TEXT(""); + pluginName = pluginNameA ? wmc.char2wchar(pluginNameA, SC_CP_UTF8) : L""; + pluginCmdName = pluginCmdNameA ? wmc.char2wchar(pluginCmdNameA, SC_CP_UTF8) : L""; // if plugin menu existing plls the value of PluginEntryName and PluginCommandItemName are valid if (pluginsMenu && !pluginName.empty() && !pluginCmdName.empty()) @@ -2277,7 +2277,7 @@ bool NppParameters::getContextMenuFromXmlTree(HMENU mainMenuHadle, HMENU plugins } -void NppParameters::setWorkingDir(const TCHAR * newPath) +void NppParameters::setWorkingDir(const wchar_t * newPath) { if (newPath && newPath[0]) { @@ -2292,7 +2292,7 @@ void NppParameters::setWorkingDir(const TCHAR * newPath) } } -bool NppParameters::loadSession(Session& session, const TCHAR* sessionFileName, const bool bSuppressErrorMsg) +bool NppParameters::loadSession(Session& session, const wchar_t* sessionFileName, const bool bSuppressErrorMsg) { TiXmlDocument* pXmlSessionDocument = new TiXmlDocument(sessionFileName); bool loadOkay = pXmlSessionDocument->LoadFile(); @@ -2303,8 +2303,8 @@ bool NppParameters::loadSession(Session& session, const TCHAR* sessionFileName, { _pNativeLangSpeaker->messageBox("SessionFileInvalidError", NULL, - TEXT("Session file is either corrupted or not valid."), - TEXT("Could not Load Session"), + L"Session file is either corrupted or not valid.", + L"Could not Load Session", MB_OK); } @@ -2318,17 +2318,17 @@ bool NppParameters::getSessionFromXmlTree(TiXmlDocument *pSessionDoc, Session& s if (!pSessionDoc) return false; - TiXmlNode *root = pSessionDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *root = pSessionDoc->FirstChild(L"NotepadPlus"); if (!root) return false; - TiXmlNode *sessionRoot = root->FirstChildElement(TEXT("Session")); + TiXmlNode *sessionRoot = root->FirstChildElement(L"Session"); if (!sessionRoot) return false; TiXmlElement *actView = sessionRoot->ToElement(); int index = 0; - const TCHAR *str = actView->Attribute(TEXT("activeView"), &index); + const wchar_t *str = actView->Attribute(L"activeView", &index); if (str) { session._activeView = index; @@ -2336,15 +2336,15 @@ bool NppParameters::getSessionFromXmlTree(TiXmlDocument *pSessionDoc, Session& s const size_t nbView = 2; TiXmlNode *viewRoots[nbView]; - viewRoots[0] = sessionRoot->FirstChildElement(TEXT("mainView")); - viewRoots[1] = sessionRoot->FirstChildElement(TEXT("subView")); + viewRoots[0] = sessionRoot->FirstChildElement(L"mainView"); + viewRoots[1] = sessionRoot->FirstChildElement(L"subView"); for (size_t k = 0; k < nbView; ++k) { if (viewRoots[k]) { int index2 = 0; TiXmlElement *actIndex = viewRoots[k]->ToElement(); - str = actIndex->Attribute(TEXT("activeIndex"), &index2); + str = actIndex->Attribute(L"activeIndex", &index2); if (str) { if (k == 0) @@ -2352,116 +2352,116 @@ bool NppParameters::getSessionFromXmlTree(TiXmlDocument *pSessionDoc, Session& s else // k == 1 session._activeSubIndex = index2; } - for (TiXmlNode *childNode = viewRoots[k]->FirstChildElement(TEXT("File")); + for (TiXmlNode *childNode = viewRoots[k]->FirstChildElement(L"File"); childNode ; - childNode = childNode->NextSibling(TEXT("File")) ) + childNode = childNode->NextSibling(L"File") ) { - const TCHAR *fileName = (childNode->ToElement())->Attribute(TEXT("filename")); + const wchar_t *fileName = (childNode->ToElement())->Attribute(L"filename"); if (fileName) { Position position; - const TCHAR* posStr = (childNode->ToElement())->Attribute(TEXT("firstVisibleLine")); + const wchar_t* posStr = (childNode->ToElement())->Attribute(L"firstVisibleLine"); if (posStr) position._firstVisibleLine = static_cast(_ttoi64(posStr)); - posStr = (childNode->ToElement())->Attribute(TEXT("xOffset")); + posStr = (childNode->ToElement())->Attribute(L"xOffset"); if (posStr) position._xOffset = static_cast(_ttoi64(posStr)); - posStr = (childNode->ToElement())->Attribute(TEXT("startPos")); + posStr = (childNode->ToElement())->Attribute(L"startPos"); if (posStr) position._startPos = static_cast(_ttoi64(posStr)); - posStr = (childNode->ToElement())->Attribute(TEXT("endPos")); + posStr = (childNode->ToElement())->Attribute(L"endPos"); if (posStr) position._endPos = static_cast(_ttoi64(posStr)); - posStr = (childNode->ToElement())->Attribute(TEXT("selMode")); + posStr = (childNode->ToElement())->Attribute(L"selMode"); if (posStr) position._selMode = static_cast(_ttoi64(posStr)); - posStr = (childNode->ToElement())->Attribute(TEXT("scrollWidth")); + posStr = (childNode->ToElement())->Attribute(L"scrollWidth"); if (posStr) position._scrollWidth = static_cast(_ttoi64(posStr)); - posStr = (childNode->ToElement())->Attribute(TEXT("offset")); + posStr = (childNode->ToElement())->Attribute(L"offset"); if (posStr) position._offset = static_cast(_ttoi64(posStr)); - posStr = (childNode->ToElement())->Attribute(TEXT("wrapCount")); + posStr = (childNode->ToElement())->Attribute(L"wrapCount"); if (posStr) position._wrapCount = static_cast(_ttoi64(posStr)); MapPosition mapPosition; - const TCHAR* mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapFirstVisibleDisplayLine")); + const wchar_t* mapPosStr = (childNode->ToElement())->Attribute(L"mapFirstVisibleDisplayLine"); if (mapPosStr) mapPosition._firstVisibleDisplayLine = static_cast(_ttoi64(mapPosStr)); - mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapFirstVisibleDocLine")); + mapPosStr = (childNode->ToElement())->Attribute(L"mapFirstVisibleDocLine"); if (mapPosStr) mapPosition._firstVisibleDocLine = static_cast(_ttoi64(mapPosStr)); - mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapLastVisibleDocLine")); + mapPosStr = (childNode->ToElement())->Attribute(L"mapLastVisibleDocLine"); if (mapPosStr) mapPosition._lastVisibleDocLine = static_cast(_ttoi64(mapPosStr)); - mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapNbLine")); + mapPosStr = (childNode->ToElement())->Attribute(L"mapNbLine"); if (mapPosStr) mapPosition._nbLine = static_cast(_ttoi64(mapPosStr)); - mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapHigherPos")); + mapPosStr = (childNode->ToElement())->Attribute(L"mapHigherPos"); if (mapPosStr) mapPosition._higherPos = static_cast(_ttoi64(mapPosStr)); - mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapWidth")); + mapPosStr = (childNode->ToElement())->Attribute(L"mapWidth"); if (mapPosStr) mapPosition._width = static_cast(_ttoi64(mapPosStr)); - mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapHeight")); + mapPosStr = (childNode->ToElement())->Attribute(L"mapHeight"); if (mapPosStr) mapPosition._height = static_cast(_ttoi64(mapPosStr)); - mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapKByteInDoc")); + mapPosStr = (childNode->ToElement())->Attribute(L"mapKByteInDoc"); if (mapPosStr) mapPosition._KByteInDoc = static_cast(_ttoi64(mapPosStr)); - mapPosStr = (childNode->ToElement())->Attribute(TEXT("mapWrapIndentMode")); + mapPosStr = (childNode->ToElement())->Attribute(L"mapWrapIndentMode"); if (mapPosStr) mapPosition._wrapIndentMode = static_cast(_ttoi64(mapPosStr)); - const TCHAR *boolStr = (childNode->ToElement())->Attribute(TEXT("mapIsWrap")); + const wchar_t *boolStr = (childNode->ToElement())->Attribute(L"mapIsWrap"); if (boolStr) - mapPosition._isWrap = (lstrcmp(TEXT("yes"), boolStr) == 0); + mapPosition._isWrap = (lstrcmp(L"yes", boolStr) == 0); - const TCHAR *langName; - langName = (childNode->ToElement())->Attribute(TEXT("lang")); + const wchar_t *langName; + langName = (childNode->ToElement())->Attribute(L"lang"); int encoding = -1; - const TCHAR *encStr = (childNode->ToElement())->Attribute(TEXT("encoding"), &encoding); - const TCHAR *backupFilePath = (childNode->ToElement())->Attribute(TEXT("backupFilePath")); + const wchar_t *encStr = (childNode->ToElement())->Attribute(L"encoding", &encoding); + const wchar_t *backupFilePath = (childNode->ToElement())->Attribute(L"backupFilePath"); FILETIME fileModifiedTimestamp{}; - (childNode->ToElement())->Attribute(TEXT("originalFileLastModifTimestamp"), reinterpret_cast(&fileModifiedTimestamp.dwLowDateTime)); - (childNode->ToElement())->Attribute(TEXT("originalFileLastModifTimestampHigh"), reinterpret_cast(&fileModifiedTimestamp.dwHighDateTime)); + (childNode->ToElement())->Attribute(L"originalFileLastModifTimestamp", reinterpret_cast(&fileModifiedTimestamp.dwLowDateTime)); + (childNode->ToElement())->Attribute(L"originalFileLastModifTimestampHigh", reinterpret_cast(&fileModifiedTimestamp.dwHighDateTime)); bool isUserReadOnly = false; - const TCHAR *boolStrReadOnly = (childNode->ToElement())->Attribute(TEXT("userReadOnly")); + const wchar_t *boolStrReadOnly = (childNode->ToElement())->Attribute(L"userReadOnly"); if (boolStrReadOnly) - isUserReadOnly = _wcsicmp(TEXT("yes"), boolStrReadOnly) == 0; + isUserReadOnly = _wcsicmp(L"yes", boolStrReadOnly) == 0; sessionFileInfo sfi(fileName, langName, encStr ? encoding : -1, isUserReadOnly, position, backupFilePath, fileModifiedTimestamp, mapPosition); - const TCHAR* intStrTabColour = (childNode->ToElement())->Attribute(TEXT("tabColourId")); + const wchar_t* intStrTabColour = (childNode->ToElement())->Attribute(L"tabColourId"); if (intStrTabColour) { sfi._individualTabColour = _wtoi(intStrTabColour); } - const TCHAR* rtlStr = (childNode->ToElement())->Attribute(TEXT("RTL")); + const wchar_t* rtlStr = (childNode->ToElement())->Attribute(L"RTL"); if (rtlStr) { - sfi._isRTL = _wcsicmp(TEXT("yes"), rtlStr) == 0; + sfi._isRTL = _wcsicmp(L"yes", rtlStr) == 0; } - for (TiXmlNode *markNode = childNode->FirstChildElement(TEXT("Mark")); + for (TiXmlNode *markNode = childNode->FirstChildElement(L"Mark"); markNode; - markNode = markNode->NextSibling(TEXT("Mark"))) + markNode = markNode->NextSibling(L"Mark")) { - const TCHAR* lineNumberStr = (markNode->ToElement())->Attribute(TEXT("line")); + const wchar_t* lineNumberStr = (markNode->ToElement())->Attribute(L"line"); if (lineNumberStr) { sfi._marks.push_back(static_cast(_ttoi64(lineNumberStr))); } } - for (TiXmlNode *foldNode = childNode->FirstChildElement(TEXT("Fold")); + for (TiXmlNode *foldNode = childNode->FirstChildElement(L"Fold"); foldNode; - foldNode = foldNode->NextSibling(TEXT("Fold"))) + foldNode = foldNode->NextSibling(L"Fold")) { - const TCHAR *lineNumberStr = (foldNode->ToElement())->Attribute(TEXT("line")); + const wchar_t *lineNumberStr = (foldNode->ToElement())->Attribute(L"line"); if (lineNumberStr) { sfi._foldStates.push_back(static_cast(_ttoi64(lineNumberStr))); @@ -2477,20 +2477,20 @@ bool NppParameters::getSessionFromXmlTree(TiXmlDocument *pSessionDoc, Session& s } // Node structure and naming corresponds to config.xml - TiXmlNode *fileBrowserRoot = sessionRoot->FirstChildElement(TEXT("FileBrowser")); + TiXmlNode *fileBrowserRoot = sessionRoot->FirstChildElement(L"FileBrowser"); if (fileBrowserRoot) { - const TCHAR *selectedItemPath = (fileBrowserRoot->ToElement())->Attribute(TEXT("latestSelectedItem")); + const wchar_t *selectedItemPath = (fileBrowserRoot->ToElement())->Attribute(L"latestSelectedItem"); if (selectedItemPath) { session._fileBrowserSelectedItem = selectedItemPath; } - for (TiXmlNode *childNode = fileBrowserRoot->FirstChildElement(TEXT("root")); + for (TiXmlNode *childNode = fileBrowserRoot->FirstChildElement(L"root"); childNode; - childNode = childNode->NextSibling(TEXT("root"))) + childNode = childNode->NextSibling(L"root")) { - const TCHAR *fileName = (childNode->ToElement())->Attribute(TEXT("foldername")); + const wchar_t *fileName = (childNode->ToElement())->Attribute(L"foldername"); if (fileName) { session._fileBrowserRoots.push_back({ fileName }); @@ -2503,31 +2503,31 @@ bool NppParameters::getSessionFromXmlTree(TiXmlDocument *pSessionDoc, Session& s void NppParameters::feedFileListParameters(TiXmlNode *node) { - TiXmlNode *historyRoot = node->FirstChildElement(TEXT("History")); + TiXmlNode *historyRoot = node->FirstChildElement(L"History"); if (!historyRoot) return; // nbMaxFile value int nbMaxFile = _nbMaxRecentFile; - const TCHAR *strVal = (historyRoot->ToElement())->Attribute(TEXT("nbMaxFile"), &nbMaxFile); + const wchar_t *strVal = (historyRoot->ToElement())->Attribute(L"nbMaxFile", &nbMaxFile); if (strVal && (nbMaxFile >= 0) && (nbMaxFile <= NB_MAX_LRF_FILE)) _nbMaxRecentFile = nbMaxFile; // customLen value int customLen = RECENTFILES_SHOWFULLPATH; - strVal = (historyRoot->ToElement())->Attribute(TEXT("customLength"), &customLen); + strVal = (historyRoot->ToElement())->Attribute(L"customLength", &customLen); if (strVal) _recentFileCustomLength = std::min(customLen, NB_MAX_LRF_CUSTOMLENGTH); // inSubMenu value - strVal = (historyRoot->ToElement())->Attribute(TEXT("inSubMenu")); + strVal = (historyRoot->ToElement())->Attribute(L"inSubMenu"); if (strVal) - _putRecentFileInSubMenu = (lstrcmp(strVal, TEXT("yes")) == 0); + _putRecentFileInSubMenu = (lstrcmp(strVal, L"yes") == 0); - for (TiXmlNode *childNode = historyRoot->FirstChildElement(TEXT("File")); + for (TiXmlNode *childNode = historyRoot->FirstChildElement(L"File"); childNode && (_nbRecentFile < NB_MAX_LRF_FILE); - childNode = childNode->NextSibling(TEXT("File")) ) + childNode = childNode->NextSibling(L"File") ) { - const TCHAR *filePath = (childNode->ToElement())->Attribute(TEXT("filename")); + const wchar_t *filePath = (childNode->ToElement())->Attribute(L"filename"); if (filePath) { _LRFileList[_nbRecentFile] = new std::wstring(filePath); @@ -2538,20 +2538,20 @@ void NppParameters::feedFileListParameters(TiXmlNode *node) void NppParameters::feedFileBrowserParameters(TiXmlNode *node) { - TiXmlNode *fileBrowserRoot = node->FirstChildElement(TEXT("FileBrowser")); + TiXmlNode *fileBrowserRoot = node->FirstChildElement(L"FileBrowser"); if (!fileBrowserRoot) return; - const TCHAR *selectedItemPath = (fileBrowserRoot->ToElement())->Attribute(TEXT("latestSelectedItem")); + const wchar_t *selectedItemPath = (fileBrowserRoot->ToElement())->Attribute(L"latestSelectedItem"); if (selectedItemPath) { _fileBrowserSelectedItemPath = selectedItemPath; } - for (TiXmlNode *childNode = fileBrowserRoot->FirstChildElement(TEXT("root")); + for (TiXmlNode *childNode = fileBrowserRoot->FirstChildElement(L"root"); childNode; - childNode = childNode->NextSibling(TEXT("root")) ) + childNode = childNode->NextSibling(L"root") ) { - const TCHAR *filePath = (childNode->ToElement())->Attribute(TEXT("foldername")); + const wchar_t *filePath = (childNode->ToElement())->Attribute(L"foldername"); if (filePath) { _fileBrowserRoot.push_back(filePath); @@ -2561,18 +2561,18 @@ void NppParameters::feedFileBrowserParameters(TiXmlNode *node) void NppParameters::feedProjectPanelsParameters(TiXmlNode *node) { - TiXmlNode *projPanelRoot = node->FirstChildElement(TEXT("ProjectPanels")); + TiXmlNode *projPanelRoot = node->FirstChildElement(L"ProjectPanels"); if (!projPanelRoot) return; - for (TiXmlNode *childNode = projPanelRoot->FirstChildElement(TEXT("ProjectPanel")); + for (TiXmlNode *childNode = projPanelRoot->FirstChildElement(L"ProjectPanel"); childNode; - childNode = childNode->NextSibling(TEXT("ProjectPanel")) ) + childNode = childNode->NextSibling(L"ProjectPanel") ) { int index = 0; - const TCHAR *idStr = (childNode->ToElement())->Attribute(TEXT("id"), &index); + const wchar_t *idStr = (childNode->ToElement())->Attribute(L"id", &index); if (idStr && (index >= 0 && index <= 2)) { - const TCHAR *filePath = (childNode->ToElement())->Attribute(TEXT("workSpaceFile")); + const wchar_t *filePath = (childNode->ToElement())->Attribute(L"workSpaceFile"); if (filePath) { _workSpaceFilePathes[index] = filePath; @@ -2583,64 +2583,64 @@ void NppParameters::feedProjectPanelsParameters(TiXmlNode *node) void NppParameters::feedColumnEditorParameters(TiXmlNode *node) { - TiXmlNode * columnEditorRoot = node->FirstChildElement(TEXT("ColumnEditor")); + TiXmlNode * columnEditorRoot = node->FirstChildElement(L"ColumnEditor"); if (!columnEditorRoot) return; - const TCHAR* strVal = (columnEditorRoot->ToElement())->Attribute(TEXT("choice")); + const wchar_t* strVal = (columnEditorRoot->ToElement())->Attribute(L"choice"); if (strVal) { - if (lstrcmp(strVal, TEXT("text")) == 0) + if (lstrcmp(strVal, L"text") == 0) _columnEditParam._mainChoice = activeText; else _columnEditParam._mainChoice = activeNumeric; } - TiXmlNode *childNode = columnEditorRoot->FirstChildElement(TEXT("text")); + TiXmlNode *childNode = columnEditorRoot->FirstChildElement(L"text"); if (!childNode) return; - const TCHAR* content = (childNode->ToElement())->Attribute(TEXT("content")); + const wchar_t* content = (childNode->ToElement())->Attribute(L"content"); if (content) { _columnEditParam._insertedTextContent = content; } - childNode = columnEditorRoot->FirstChildElement(TEXT("number")); + childNode = columnEditorRoot->FirstChildElement(L"number"); if (!childNode) return; int val; - strVal = (childNode->ToElement())->Attribute(TEXT("initial"), &val); + strVal = (childNode->ToElement())->Attribute(L"initial", &val); if (strVal) _columnEditParam._initialNum = val; - strVal = (childNode->ToElement())->Attribute(TEXT("increase"), &val); + strVal = (childNode->ToElement())->Attribute(L"increase", &val); if (strVal) _columnEditParam._increaseNum = val; - strVal = (childNode->ToElement())->Attribute(TEXT("repeat"), &val); + strVal = (childNode->ToElement())->Attribute(L"repeat", &val); if (strVal) _columnEditParam._repeatNum = val; - strVal = (childNode->ToElement())->Attribute(TEXT("formatChoice")); + strVal = (childNode->ToElement())->Attribute(L"formatChoice"); if (strVal) { - if (lstrcmp(strVal, TEXT("hex")) == 0) + if (lstrcmp(strVal, L"hex") == 0) _columnEditParam._formatChoice = 1; - else if (lstrcmp(strVal, TEXT("oct")) == 0) + else if (lstrcmp(strVal, L"oct") == 0) _columnEditParam._formatChoice = 2; - else if (lstrcmp(strVal, TEXT("bin")) == 0) + else if (lstrcmp(strVal, L"bin") == 0) _columnEditParam._formatChoice = 3; else // "dec" _columnEditParam._formatChoice = 0; } - strVal = (childNode->ToElement())->Attribute(TEXT("leadingChoice")); + strVal = (childNode->ToElement())->Attribute(L"leadingChoice"); if (strVal) { _columnEditParam._leadingChoice = ColumnEditorParam::noneLeading; - if (lstrcmp(strVal, TEXT("zeros")) == 0) + if (lstrcmp(strVal, L"zeros") == 0) { _columnEditParam._leadingChoice = ColumnEditorParam::zeroLeading; } - else if (lstrcmp(strVal, TEXT("spaces")) == 0) + else if (lstrcmp(strVal, L"spaces") == 0) { _columnEditParam._leadingChoice = ColumnEditorParam::spaceLeading; } @@ -2649,21 +2649,21 @@ void NppParameters::feedColumnEditorParameters(TiXmlNode *node) void NppParameters::feedFindHistoryParameters(TiXmlNode *node) { - TiXmlNode *findHistoryRoot = node->FirstChildElement(TEXT("FindHistory")); + TiXmlNode *findHistoryRoot = node->FirstChildElement(L"FindHistory"); if (!findHistoryRoot) return; - (findHistoryRoot->ToElement())->Attribute(TEXT("nbMaxFindHistoryPath"), &_findHistory._nbMaxFindHistoryPath); + (findHistoryRoot->ToElement())->Attribute(L"nbMaxFindHistoryPath", &_findHistory._nbMaxFindHistoryPath); if (_findHistory._nbMaxFindHistoryPath > NB_MAX_FINDHISTORY_PATH) { _findHistory._nbMaxFindHistoryPath = NB_MAX_FINDHISTORY_PATH; } if ((_findHistory._nbMaxFindHistoryPath > 0) && (_findHistory._nbMaxFindHistoryPath <= NB_MAX_FINDHISTORY_PATH)) { - for (TiXmlNode *childNode = findHistoryRoot->FirstChildElement(TEXT("Path")); + for (TiXmlNode *childNode = findHistoryRoot->FirstChildElement(L"Path"); childNode && (_findHistory._findHistoryPaths.size() < NB_MAX_FINDHISTORY_PATH); - childNode = childNode->NextSibling(TEXT("Path")) ) + childNode = childNode->NextSibling(L"Path") ) { - const TCHAR *filePath = (childNode->ToElement())->Attribute(TEXT("name")); + const wchar_t *filePath = (childNode->ToElement())->Attribute(L"name"); if (filePath) { _findHistory._findHistoryPaths.push_back(std::wstring(filePath)); @@ -2671,18 +2671,18 @@ void NppParameters::feedFindHistoryParameters(TiXmlNode *node) } } - (findHistoryRoot->ToElement())->Attribute(TEXT("nbMaxFindHistoryFilter"), &_findHistory._nbMaxFindHistoryFilter); + (findHistoryRoot->ToElement())->Attribute(L"nbMaxFindHistoryFilter", &_findHistory._nbMaxFindHistoryFilter); if (_findHistory._nbMaxFindHistoryFilter > NB_MAX_FINDHISTORY_FILTER) { _findHistory._nbMaxFindHistoryFilter = NB_MAX_FINDHISTORY_FILTER; } if ((_findHistory._nbMaxFindHistoryFilter > 0) && (_findHistory._nbMaxFindHistoryFilter <= NB_MAX_FINDHISTORY_FILTER)) { - for (TiXmlNode *childNode = findHistoryRoot->FirstChildElement(TEXT("Filter")); + for (TiXmlNode *childNode = findHistoryRoot->FirstChildElement(L"Filter"); childNode && (_findHistory._findHistoryFilters.size() < NB_MAX_FINDHISTORY_FILTER); - childNode = childNode->NextSibling(TEXT("Filter"))) + childNode = childNode->NextSibling(L"Filter")) { - const TCHAR *fileFilter = (childNode->ToElement())->Attribute(TEXT("name")); + const wchar_t *fileFilter = (childNode->ToElement())->Attribute(L"name"); if (fileFilter) { _findHistory._findHistoryFilters.push_back(std::wstring(fileFilter)); @@ -2690,18 +2690,18 @@ void NppParameters::feedFindHistoryParameters(TiXmlNode *node) } } - (findHistoryRoot->ToElement())->Attribute(TEXT("nbMaxFindHistoryFind"), &_findHistory._nbMaxFindHistoryFind); + (findHistoryRoot->ToElement())->Attribute(L"nbMaxFindHistoryFind", &_findHistory._nbMaxFindHistoryFind); if (_findHistory._nbMaxFindHistoryFind > NB_MAX_FINDHISTORY_FIND) { _findHistory._nbMaxFindHistoryFind = NB_MAX_FINDHISTORY_FIND; } if ((_findHistory._nbMaxFindHistoryFind > 0) && (_findHistory._nbMaxFindHistoryFind <= NB_MAX_FINDHISTORY_FIND)) { - for (TiXmlNode *childNode = findHistoryRoot->FirstChildElement(TEXT("Find")); + for (TiXmlNode *childNode = findHistoryRoot->FirstChildElement(L"Find"); childNode && (_findHistory._findHistoryFinds.size() < NB_MAX_FINDHISTORY_FIND); - childNode = childNode->NextSibling(TEXT("Find"))) + childNode = childNode->NextSibling(L"Find")) { - const TCHAR *fileFind = (childNode->ToElement())->Attribute(TEXT("name")); + const wchar_t *fileFind = (childNode->ToElement())->Attribute(L"name"); if (fileFind) { _findHistory._findHistoryFinds.push_back(std::wstring(fileFind)); @@ -2709,18 +2709,18 @@ void NppParameters::feedFindHistoryParameters(TiXmlNode *node) } } - (findHistoryRoot->ToElement())->Attribute(TEXT("nbMaxFindHistoryReplace"), &_findHistory._nbMaxFindHistoryReplace); + (findHistoryRoot->ToElement())->Attribute(L"nbMaxFindHistoryReplace", &_findHistory._nbMaxFindHistoryReplace); if (_findHistory._nbMaxFindHistoryReplace > NB_MAX_FINDHISTORY_REPLACE) { _findHistory._nbMaxFindHistoryReplace = NB_MAX_FINDHISTORY_REPLACE; } if ((_findHistory._nbMaxFindHistoryReplace > 0) && (_findHistory._nbMaxFindHistoryReplace <= NB_MAX_FINDHISTORY_REPLACE)) { - for (TiXmlNode *childNode = findHistoryRoot->FirstChildElement(TEXT("Replace")); + for (TiXmlNode *childNode = findHistoryRoot->FirstChildElement(L"Replace"); childNode && (_findHistory._findHistoryReplaces.size() < NB_MAX_FINDHISTORY_REPLACE); - childNode = childNode->NextSibling(TEXT("Replace"))) + childNode = childNode->NextSibling(L"Replace")) { - const TCHAR *fileReplace = (childNode->ToElement())->Attribute(TEXT("name")); + const wchar_t *fileReplace = (childNode->ToElement())->Attribute(L"name"); if (fileReplace) { _findHistory._findHistoryReplaces.push_back(std::wstring(fileReplace)); @@ -2728,82 +2728,82 @@ void NppParameters::feedFindHistoryParameters(TiXmlNode *node) } } - const TCHAR *boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("matchWord")); + const wchar_t *boolStr = (findHistoryRoot->ToElement())->Attribute(L"matchWord"); if (boolStr) - _findHistory._isMatchWord = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isMatchWord = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("matchCase")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"matchCase"); if (boolStr) - _findHistory._isMatchCase = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isMatchCase = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("wrap")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"wrap"); if (boolStr) - _findHistory._isWrap = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isWrap = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("directionDown")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"directionDown"); if (boolStr) - _findHistory._isDirectionDown = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isDirectionDown = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("fifRecuisive")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"fifRecuisive"); if (boolStr) - _findHistory._isFifRecuisive = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isFifRecuisive = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("fifInHiddenFolder")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"fifInHiddenFolder"); if (boolStr) - _findHistory._isFifInHiddenFolder = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isFifInHiddenFolder = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("fifProjectPanel1")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"fifProjectPanel1"); if (boolStr) - _findHistory._isFifProjectPanel_1 = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isFifProjectPanel_1 = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("fifProjectPanel2")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"fifProjectPanel2"); if (boolStr) - _findHistory._isFifProjectPanel_2 = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isFifProjectPanel_2 = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("fifProjectPanel3")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"fifProjectPanel3"); if (boolStr) - _findHistory._isFifProjectPanel_3 = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isFifProjectPanel_3 = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("fifFilterFollowsDoc")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"fifFilterFollowsDoc"); if (boolStr) - _findHistory._isFilterFollowDoc = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isFilterFollowDoc = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("fifFolderFollowsDoc")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"fifFolderFollowsDoc"); if (boolStr) - _findHistory._isFolderFollowDoc = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isFolderFollowDoc = (lstrcmp(L"yes", boolStr) == 0); int mode = 0; - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("searchMode"), &mode); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"searchMode", &mode); if (boolStr) _findHistory._searchMode = (FindHistory::searchMode)mode; - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("transparencyMode"), &mode); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"transparencyMode", &mode); if (boolStr) _findHistory._transparencyMode = (FindHistory::transparencyMode)mode; - (findHistoryRoot->ToElement())->Attribute(TEXT("transparency"), &_findHistory._transparency); + (findHistoryRoot->ToElement())->Attribute(L"transparency", &_findHistory._transparency); if (_findHistory._transparency <= 0 || _findHistory._transparency > 200) _findHistory._transparency = 150; - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("dotMatchesNewline")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"dotMatchesNewline"); if (boolStr) - _findHistory._dotMatchesNewline = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._dotMatchesNewline = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("isSearch2ButtonsMode")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"isSearch2ButtonsMode"); if (boolStr) - _findHistory._isSearch2ButtonsMode = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isSearch2ButtonsMode = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("regexBackward4PowerUser")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"regexBackward4PowerUser"); if (boolStr) - _findHistory._regexBackward4PowerUser = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._regexBackward4PowerUser = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("bookmarkLine")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"bookmarkLine"); if (boolStr) - _findHistory._isBookmarkLine = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isBookmarkLine = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (findHistoryRoot->ToElement())->Attribute(TEXT("purge")); + boolStr = (findHistoryRoot->ToElement())->Attribute(L"purge"); if (boolStr) - _findHistory._isPurge = (lstrcmp(TEXT("yes"), boolStr) == 0); + _findHistory._isPurge = (lstrcmp(L"yes", boolStr) == 0); } void NppParameters::feedShortcut(TiXmlNodeA *node) @@ -3106,14 +3106,14 @@ std::pair NppParameters::feedUserLang(TiXmlNode *n { int iBegin = _nbUserLang; - for (TiXmlNode *childNode = node->FirstChildElement(TEXT("UserLang")); + for (TiXmlNode *childNode = node->FirstChildElement(L"UserLang"); childNode && (_nbUserLang < NB_MAX_USER_LANG); - childNode = childNode->NextSibling(TEXT("UserLang")) ) + childNode = childNode->NextSibling(L"UserLang") ) { - const TCHAR* name = (childNode->ToElement())->Attribute(TEXT("name")); - const TCHAR* ext = (childNode->ToElement())->Attribute(TEXT("ext")); - const TCHAR* darkModeTheme = (childNode->ToElement())->Attribute(TEXT("darkModeTheme")); - const TCHAR* udlVersion = (childNode->ToElement())->Attribute(TEXT("udlVersion")); + const wchar_t* name = (childNode->ToElement())->Attribute(L"name"); + const wchar_t* ext = (childNode->ToElement())->Attribute(L"ext"); + const wchar_t* darkModeTheme = (childNode->ToElement())->Attribute(L"darkModeTheme"); + const wchar_t* udlVersion = (childNode->ToElement())->Attribute(L"udlVersion"); if (!name || !name[0] || !ext) { @@ -3125,27 +3125,27 @@ std::pair NppParameters::feedUserLang(TiXmlNode *n if (darkModeTheme && darkModeTheme[0]) { - isDarkModeTheme = (lstrcmp(TEXT("yes"), darkModeTheme) == 0); + isDarkModeTheme = (lstrcmp(L"yes", darkModeTheme) == 0); } try { - _userLangArray[_nbUserLang] = new UserLangContainer(name, ext, isDarkModeTheme, udlVersion ? udlVersion : TEXT("")); + _userLangArray[_nbUserLang] = new UserLangContainer(name, ext, isDarkModeTheme, udlVersion ? udlVersion : L""); ++_nbUserLang; - TiXmlNode *settingsRoot = childNode->FirstChildElement(TEXT("Settings")); + TiXmlNode *settingsRoot = childNode->FirstChildElement(L"Settings"); if (!settingsRoot) throw std::runtime_error("NppParameters::feedUserLang : Settings node is missing"); feedUserSettings(settingsRoot); - TiXmlNode *keywordListsRoot = childNode->FirstChildElement(TEXT("KeywordLists")); + TiXmlNode *keywordListsRoot = childNode->FirstChildElement(L"KeywordLists"); if (!keywordListsRoot) throw std::runtime_error("NppParameters::feedUserLang : KeywordLists node is missing"); feedUserKeywordList(keywordListsRoot); - TiXmlNode *stylesRoot = childNode->FirstChildElement(TEXT("Styles")); + TiXmlNode *stylesRoot = childNode->FirstChildElement(L"Styles"); if (!stylesRoot) throw std::runtime_error("NppParameters::feedUserLang : Styles node is missing"); @@ -3199,7 +3199,7 @@ bool NppParameters::exportUDLToFile(size_t langIndex2export, const std::wstring& return false; TiXmlDocument *pNewXmlUserLangDoc = new TiXmlDocument(fileName2save); - TiXmlNode *newRoot2export = pNewXmlUserLangDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + TiXmlNode *newRoot2export = pNewXmlUserLangDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); insertUserLang2Tree(newRoot2export, _userLangArray[langIndex2export]); bool result = pNewXmlUserLangDoc->SaveFile(); @@ -3208,7 +3208,7 @@ bool NppParameters::exportUDLToFile(size_t langIndex2export, const std::wstring& return result; } -LangType NppParameters::getLangFromExt(const TCHAR *ext) +LangType NppParameters::getLangFromExt(const wchar_t *ext) { int i = getNbLang(); i--; @@ -3216,11 +3216,11 @@ LangType NppParameters::getLangFromExt(const TCHAR *ext) { Lang *l = getLangFromIndex(i--); - const TCHAR *defList = l->getDefaultExtList(); - const TCHAR *userList = NULL; + const wchar_t *defList = l->getDefaultExtList(); + const wchar_t *userList = NULL; LexerStylerArray &lsa = getLStylerArray(); - const TCHAR *lName = l->getLangName(); + const wchar_t *lName = l->getLangName(); LexerStyler *pLS = lsa.getLexerStylerByName(lName); if (pLS) @@ -3232,7 +3232,7 @@ LangType NppParameters::getLangFromExt(const TCHAR *ext) if (userList) { - list += TEXT(" "); + list += L" "; list += userList; } if (isInList(ext, list.c_str())) @@ -3241,16 +3241,16 @@ LangType NppParameters::getLangFromExt(const TCHAR *ext) return L_TEXT; } -void NppParameters::setCloudChoice(const TCHAR *pathChoice) +void NppParameters::setCloudChoice(const wchar_t *pathChoice) { std::wstring cloudChoicePath = getSettingsFolder(); - cloudChoicePath += TEXT("\\cloud\\"); + cloudChoicePath += L"\\cloud\\"; if (!PathFileExists(cloudChoicePath.c_str())) { ::CreateDirectory(cloudChoicePath.c_str(), NULL); } - cloudChoicePath += TEXT("choice"); + cloudChoicePath += L"choice"; WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance(); std::string cloudPathA = wmc.wchar2char(pathChoice, SC_CP_UTF8); @@ -3262,7 +3262,7 @@ void NppParameters::removeCloudChoice() { std::wstring cloudChoicePath = getSettingsFolder(); - cloudChoicePath += TEXT("\\cloud\\choice"); + cloudChoicePath += L"\\cloud\\choice"; if (PathFileExists(cloudChoicePath.c_str())) { ::DeleteFile(cloudChoicePath.c_str()); @@ -3275,7 +3275,7 @@ bool NppParameters::isCloudPathChanged() const return false; else if (_initialCloudChoice.size() - _nppGUI._cloudPath.size() == 1) { - TCHAR c = _initialCloudChoice.at(_initialCloudChoice.size()-1); + wchar_t c = _initialCloudChoice.at(_initialCloudChoice.size()-1); if (c == '\\' || c == '/') { if (_initialCloudChoice.find(_nppGUI._cloudPath) == 0) @@ -3284,7 +3284,7 @@ bool NppParameters::isCloudPathChanged() const } else if (_nppGUI._cloudPath.size() - _initialCloudChoice.size() == 1) { - TCHAR c = _nppGUI._cloudPath.at(_nppGUI._cloudPath.size() - 1); + wchar_t c = _nppGUI._cloudPath.at(_nppGUI._cloudPath.size() - 1); if (c == '\\' || c == '/') { if (_nppGUI._cloudPath.find(_initialCloudChoice) == 0) @@ -3303,7 +3303,7 @@ bool NppParameters::writeSettingsFilesOnCloudForThe1stTime(const std::wstring & // config.xml std::wstring cloudConfigPath = cloudSettingsPath; - pathAppend(cloudConfigPath, TEXT("config.xml")); + pathAppend(cloudConfigPath, L"config.xml"); if (!::PathFileExists(cloudConfigPath.c_str()) && _pXmlUserDoc) { isOK = _pXmlUserDoc->SaveFile(cloudConfigPath.c_str()); @@ -3313,7 +3313,7 @@ bool NppParameters::writeSettingsFilesOnCloudForThe1stTime(const std::wstring & // stylers.xml std::wstring cloudStylersPath = cloudSettingsPath; - pathAppend(cloudStylersPath, TEXT("stylers.xml")); + pathAppend(cloudStylersPath, L"stylers.xml"); if (!::PathFileExists(cloudStylersPath.c_str()) && _pXmlUserStylerDoc) { isOK = _pXmlUserStylerDoc->SaveFile(cloudStylersPath.c_str()); @@ -3323,7 +3323,7 @@ bool NppParameters::writeSettingsFilesOnCloudForThe1stTime(const std::wstring & // langs.xml std::wstring cloudLangsPath = cloudSettingsPath; - pathAppend(cloudLangsPath, TEXT("langs.xml")); + pathAppend(cloudLangsPath, L"langs.xml"); if (!::PathFileExists(cloudLangsPath.c_str()) && _pXmlUserDoc) { isOK = _pXmlDoc->SaveFile(cloudLangsPath.c_str()); @@ -3333,7 +3333,7 @@ bool NppParameters::writeSettingsFilesOnCloudForThe1stTime(const std::wstring & // userDefineLang.xml std::wstring cloudUserLangsPath = cloudSettingsPath; - pathAppend(cloudUserLangsPath, TEXT("userDefineLang.xml")); + pathAppend(cloudUserLangsPath, L"userDefineLang.xml"); if (!::PathFileExists(cloudUserLangsPath.c_str()) && _pXmlUserLangDoc) { isOK = _pXmlUserLangDoc->SaveFile(cloudUserLangsPath.c_str()); @@ -3353,7 +3353,7 @@ bool NppParameters::writeSettingsFilesOnCloudForThe1stTime(const std::wstring & // contextMenu.xml std::wstring cloudContextMenuPath = cloudSettingsPath; - pathAppend(cloudContextMenuPath, TEXT("contextMenu.xml")); + pathAppend(cloudContextMenuPath, L"contextMenu.xml"); if (!::PathFileExists(cloudContextMenuPath.c_str()) && _pXmlContextMenuDocA) { isOK = _pXmlContextMenuDocA->SaveUnicodeFilePath(cloudContextMenuPath.c_str()); @@ -3363,7 +3363,7 @@ bool NppParameters::writeSettingsFilesOnCloudForThe1stTime(const std::wstring & // nativeLang.xml std::wstring cloudNativeLangPath = cloudSettingsPath; - pathAppend(cloudNativeLangPath, TEXT("nativeLang.xml")); + pathAppend(cloudNativeLangPath, L"nativeLang.xml"); if (!::PathFileExists(cloudNativeLangPath.c_str()) && _pXmlNativeLangDocA) { isOK = _pXmlNativeLangDocA->SaveUnicodeFilePath(cloudNativeLangPath.c_str()); @@ -3387,24 +3387,24 @@ void NppParameters::writeDefaultUDL() if (!_pXmlUserLangDoc) { _pXmlUserLangDoc = new TiXmlDocument(_userDefineLangPath); - TiXmlDeclaration* decl = new TiXmlDeclaration(TEXT("1.0"), TEXT("UTF-8"), TEXT("")); + TiXmlDeclaration* decl = new TiXmlDeclaration(L"1.0", L"UTF-8", L""); _pXmlUserLangDoc->LinkEndChild(decl); - _pXmlUserLangDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + _pXmlUserLangDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); } bool toDelete = (udl._indexRange.second - udl._indexRange.first) == 0; deleteState.push_back(std::pair(toDelete, udl._isInDefaultSharedContainer)); if ((!udl._udlXmlDoc || udl._udlXmlDoc == _pXmlUserLangDoc) && udl._isDirty && !toDelete) // new created or/and imported UDL plus _pXmlUserLangDoc (if exist) { - TiXmlNode *root = _pXmlUserLangDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *root = _pXmlUserLangDoc->FirstChild(L"NotepadPlus"); if (root && !firstCleanDone) { _pXmlUserLangDoc->RemoveChild(root); - _pXmlUserLangDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + _pXmlUserLangDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); firstCleanDone = true; } - root = _pXmlUserLangDoc->FirstChild(TEXT("NotepadPlus")); + root = _pXmlUserLangDoc->FirstChild(L"NotepadPlus"); for (int i = udl._indexRange.first; i < udl._indexRange.second; ++i) { @@ -3446,7 +3446,7 @@ void NppParameters::writeNonDefaultUDL() if (udl._indexRange.second == udl._indexRange.first) // no more udl for this xmldoc container { // no need to save, delete file - const TCHAR* docFilePath = udl._udlXmlDoc->Value(); + const wchar_t* docFilePath = udl._udlXmlDoc->Value(); if (docFilePath && ::PathFileExists(docFilePath)) { ::DeleteFile(docFilePath); @@ -3454,15 +3454,15 @@ void NppParameters::writeNonDefaultUDL() } else { - TiXmlNode *root = udl._udlXmlDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *root = udl._udlXmlDoc->FirstChild(L"NotepadPlus"); if (root) { udl._udlXmlDoc->RemoveChild(root); } - udl._udlXmlDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + udl._udlXmlDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); - root = udl._udlXmlDoc->FirstChild(TEXT("NotepadPlus")); + root = udl._udlXmlDoc->FirstChild(L"NotepadPlus"); for (int i = udl._indexRange.first; i < udl._indexRange.second; ++i) { @@ -3486,9 +3486,9 @@ void NppParameters::insertCmd(TiXmlNodeA *shortcutsRoot, const CommandShortcut & const KeyCombo & key = cmd.getKeyCombo(); TiXmlNodeA *sc = shortcutsRoot->InsertEndChild(TiXmlElementA("Shortcut")); sc->ToElement()->SetAttribute("id", cmd.getID()); - sc->ToElement()->SetAttribute("Ctrl", key._isCtrl?"yes":"no"); - sc->ToElement()->SetAttribute("Alt", key._isAlt?"yes":"no"); - sc->ToElement()->SetAttribute("Shift", key._isShift?"yes":"no"); + sc->ToElement()->SetAttribute("Ctrl", key._isCtrl ? "yes" : "no"); + sc->ToElement()->SetAttribute("Alt", key._isAlt ? "yes" : "no"); + sc->ToElement()->SetAttribute("Shift", key._isShift ? "yes" : "no"); sc->ToElement()->SetAttribute("Key", key._key); if (cmd.getNth() != 0) sc->ToElement()->SetAttribute("nth", cmd.getNth()); @@ -3545,9 +3545,9 @@ void NppParameters::insertPluginCmd(TiXmlNodeA *pluginCmdRoot, const PluginCmdSh TiXmlNodeA *pluginCmdNode = pluginCmdRoot->InsertEndChild(TiXmlElementA("PluginCommand")); pluginCmdNode->ToElement()->SetAttribute("moduleName", pluginCmd.getModuleName()); pluginCmdNode->ToElement()->SetAttribute("internalID", pluginCmd.getInternalID()); - pluginCmdNode->ToElement()->SetAttribute("Ctrl", key._isCtrl?"yes":"no"); - pluginCmdNode->ToElement()->SetAttribute("Alt", key._isAlt?"yes":"no"); - pluginCmdNode->ToElement()->SetAttribute("Shift", key._isShift?"yes":"no"); + pluginCmdNode->ToElement()->SetAttribute("Ctrl", key._isCtrl ? "yes" : "no"); + pluginCmdNode->ToElement()->SetAttribute("Alt", key._isAlt ? "yes" : "no"); + pluginCmdNode->ToElement()->SetAttribute("Shift", key._isShift ? "yes" : "no"); pluginCmdNode->ToElement()->SetAttribute("Key", key._key); } @@ -3560,9 +3560,9 @@ void NppParameters::insertScintKey(TiXmlNodeA *scintKeyRoot, const ScintillaKeyM //Add main shortcut KeyCombo key = scintKeyMap.getKeyComboByIndex(0); - keyRoot->ToElement()->SetAttribute("Ctrl", key._isCtrl?"yes":"no"); - keyRoot->ToElement()->SetAttribute("Alt", key._isAlt?"yes":"no"); - keyRoot->ToElement()->SetAttribute("Shift", key._isShift?"yes":"no"); + keyRoot->ToElement()->SetAttribute("Ctrl", key._isCtrl ? "yes" : "no"); + keyRoot->ToElement()->SetAttribute("Alt", key._isAlt ? "yes" : "no"); + keyRoot->ToElement()->SetAttribute("Shift", key._isShift ? "yes" : "no"); keyRoot->ToElement()->SetAttribute("Key", key._key); //Add additional shortcuts @@ -3573,18 +3573,18 @@ void NppParameters::insertScintKey(TiXmlNodeA *scintKeyRoot, const ScintillaKeyM { TiXmlNodeA *keyNext = keyRoot->InsertEndChild(TiXmlElementA("NextKey")); key = scintKeyMap.getKeyComboByIndex(i); - keyNext->ToElement()->SetAttribute("Ctrl", key._isCtrl?"yes":"no"); - keyNext->ToElement()->SetAttribute("Alt", key._isAlt?"yes":"no"); - keyNext->ToElement()->SetAttribute("Shift", key._isShift?"yes":"no"); + keyNext->ToElement()->SetAttribute("Ctrl", key._isCtrl ? "yes" : "no"); + keyNext->ToElement()->SetAttribute("Alt", key._isAlt ? "yes" : "no"); + keyNext->ToElement()->SetAttribute("Shift", key._isShift ? "yes" : "no"); keyNext->ToElement()->SetAttribute("Key", key._key); } } } -void NppParameters::writeSession(const Session & session, const TCHAR *fileName) +void NppParameters::writeSession(const Session & session, const wchar_t *fileName) { - const TCHAR *sessionPathName = fileName ? fileName : _sessionPath.c_str(); + const wchar_t *sessionPathName = fileName ? fileName : _sessionPath.c_str(); // // Make sure session file is not read-only @@ -3594,7 +3594,7 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName) // // Backup session file before overriting it // - TCHAR backupPathName[MAX_PATH]{}; + wchar_t backupPathName[MAX_PATH]{}; BOOL doesBackupCopyExist = FALSE; if (PathFileExists(sessionPathName)) { @@ -3616,14 +3616,14 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName) // Prepare for writing // TiXmlDocument* pXmlSessionDoc = new TiXmlDocument(sessionPathName); - TiXmlDeclaration* decl = new TiXmlDeclaration(TEXT("1.0"), TEXT("UTF-8"), TEXT("")); + TiXmlDeclaration* decl = new TiXmlDeclaration(L"1.0", L"UTF-8", L""); pXmlSessionDoc->LinkEndChild(decl); - TiXmlNode *root = pXmlSessionDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + TiXmlNode *root = pXmlSessionDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); if (root) { - TiXmlNode *sessionNode = root->InsertEndChild(TiXmlElement(TEXT("Session"))); - (sessionNode->ToElement())->SetAttribute(TEXT("activeView"), static_cast(session._activeView)); + TiXmlNode *sessionNode = root->InsertEndChild(TiXmlElement(L"Session")); + (sessionNode->ToElement())->SetAttribute(L"activeView", static_cast(session._activeView)); struct ViewElem { TiXmlNode *viewNode; @@ -3632,8 +3632,8 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName) }; const int nbElem = 2; ViewElem viewElems[nbElem]; - viewElems[0].viewNode = sessionNode->InsertEndChild(TiXmlElement(TEXT("mainView"))); - viewElems[1].viewNode = sessionNode->InsertEndChild(TiXmlElement(TEXT("subView"))); + viewElems[0].viewNode = sessionNode->InsertEndChild(TiXmlElement(L"mainView")); + viewElems[1].viewNode = sessionNode->InsertEndChild(TiXmlElement(L"subView")); viewElems[0].viewFiles = (vector *)(&(session._mainViewFiles)); viewElems[1].viewFiles = (vector *)(&(session._subViewFiles)); viewElems[0].activeIndex = session._activeMainIndex; @@ -3641,57 +3641,57 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName) for (size_t k = 0; k < nbElem ; ++k) { - (viewElems[k].viewNode->ToElement())->SetAttribute(TEXT("activeIndex"), static_cast(viewElems[k].activeIndex)); + (viewElems[k].viewNode->ToElement())->SetAttribute(L"activeIndex", static_cast(viewElems[k].activeIndex)); vector & viewSessionFiles = *(viewElems[k].viewFiles); for (size_t i = 0, len = viewElems[k].viewFiles->size(); i < len ; ++i) { - TiXmlNode *fileNameNode = viewElems[k].viewNode->InsertEndChild(TiXmlElement(TEXT("File"))); + TiXmlNode *fileNameNode = viewElems[k].viewNode->InsertEndChild(TiXmlElement(L"File")); - TCHAR szInt64[64]; + wchar_t szInt64[64]; - (fileNameNode->ToElement())->SetAttribute(TEXT("firstVisibleLine"), _i64tot(static_cast(viewSessionFiles[i]._firstVisibleLine), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("xOffset"), _i64tot(static_cast(viewSessionFiles[i]._xOffset), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("scrollWidth"), _i64tot(static_cast(viewSessionFiles[i]._scrollWidth), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("startPos"), _i64tot(static_cast(viewSessionFiles[i]._startPos), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("endPos"), _i64tot(static_cast(viewSessionFiles[i]._endPos), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("selMode"), _i64tot(static_cast(viewSessionFiles[i]._selMode), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("offset"), _i64tot(static_cast(viewSessionFiles[i]._offset), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("wrapCount"), _i64tot(static_cast(viewSessionFiles[i]._wrapCount), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("lang"), viewSessionFiles[i]._langName.c_str()); - (fileNameNode->ToElement())->SetAttribute(TEXT("encoding"), viewSessionFiles[i]._encoding); - (fileNameNode->ToElement())->SetAttribute(TEXT("userReadOnly"), (viewSessionFiles[i]._isUserReadOnly && !viewSessionFiles[i]._isMonitoring) ? TEXT("yes") : TEXT("no")); - (fileNameNode->ToElement())->SetAttribute(TEXT("filename"), viewSessionFiles[i]._fileName.c_str()); - (fileNameNode->ToElement())->SetAttribute(TEXT("backupFilePath"), viewSessionFiles[i]._backupFilePath.c_str()); - (fileNameNode->ToElement())->SetAttribute(TEXT("originalFileLastModifTimestamp"), static_cast(viewSessionFiles[i]._originalFileLastModifTimestamp.dwLowDateTime)); - (fileNameNode->ToElement())->SetAttribute(TEXT("originalFileLastModifTimestampHigh"), static_cast(viewSessionFiles[i]._originalFileLastModifTimestamp.dwHighDateTime)); - (fileNameNode->ToElement())->SetAttribute(TEXT("tabColourId"), static_cast(viewSessionFiles[i]._individualTabColour)); - (fileNameNode->ToElement())->SetAttribute(TEXT("RTL"), viewSessionFiles[i]._isRTL ? TEXT("yes") : TEXT("no")); + (fileNameNode->ToElement())->SetAttribute(L"firstVisibleLine", _i64tot(static_cast(viewSessionFiles[i]._firstVisibleLine), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"xOffset", _i64tot(static_cast(viewSessionFiles[i]._xOffset), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"scrollWidth", _i64tot(static_cast(viewSessionFiles[i]._scrollWidth), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"startPos", _i64tot(static_cast(viewSessionFiles[i]._startPos), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"endPos", _i64tot(static_cast(viewSessionFiles[i]._endPos), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"selMode", _i64tot(static_cast(viewSessionFiles[i]._selMode), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"offset", _i64tot(static_cast(viewSessionFiles[i]._offset), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"wrapCount", _i64tot(static_cast(viewSessionFiles[i]._wrapCount), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"lang", viewSessionFiles[i]._langName.c_str()); + (fileNameNode->ToElement())->SetAttribute(L"encoding", viewSessionFiles[i]._encoding); + (fileNameNode->ToElement())->SetAttribute(L"userReadOnly", (viewSessionFiles[i]._isUserReadOnly && !viewSessionFiles[i]._isMonitoring) ? L"yes" : L"no"); + (fileNameNode->ToElement())->SetAttribute(L"filename", viewSessionFiles[i]._fileName.c_str()); + (fileNameNode->ToElement())->SetAttribute(L"backupFilePath", viewSessionFiles[i]._backupFilePath.c_str()); + (fileNameNode->ToElement())->SetAttribute(L"originalFileLastModifTimestamp", static_cast(viewSessionFiles[i]._originalFileLastModifTimestamp.dwLowDateTime)); + (fileNameNode->ToElement())->SetAttribute(L"originalFileLastModifTimestampHigh", static_cast(viewSessionFiles[i]._originalFileLastModifTimestamp.dwHighDateTime)); + (fileNameNode->ToElement())->SetAttribute(L"tabColourId", static_cast(viewSessionFiles[i]._individualTabColour)); + (fileNameNode->ToElement())->SetAttribute(L"RTL", viewSessionFiles[i]._isRTL ? L"yes" : L"no"); // docMap - (fileNameNode->ToElement())->SetAttribute(TEXT("mapFirstVisibleDisplayLine"), _i64tot(static_cast(viewSessionFiles[i]._mapPos._firstVisibleDisplayLine), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("mapFirstVisibleDocLine"), _i64tot(static_cast(viewSessionFiles[i]._mapPos._firstVisibleDocLine), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("mapLastVisibleDocLine"), _i64tot(static_cast(viewSessionFiles[i]._mapPos._lastVisibleDocLine), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("mapNbLine"), _i64tot(static_cast(viewSessionFiles[i]._mapPos._nbLine), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("mapHigherPos"), _i64tot(static_cast(viewSessionFiles[i]._mapPos._higherPos), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("mapWidth"), _i64tot(static_cast(viewSessionFiles[i]._mapPos._width), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("mapHeight"), _i64tot(static_cast(viewSessionFiles[i]._mapPos._height), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("mapKByteInDoc"), _i64tot(static_cast(viewSessionFiles[i]._mapPos._KByteInDoc), szInt64, 10)); - (fileNameNode->ToElement())->SetAttribute(TEXT("mapWrapIndentMode"), _i64tot(static_cast(viewSessionFiles[i]._mapPos._wrapIndentMode), szInt64, 10)); - fileNameNode->ToElement()->SetAttribute(TEXT("mapIsWrap"), viewSessionFiles[i]._mapPos._isWrap ? TEXT("yes") : TEXT("no")); + (fileNameNode->ToElement())->SetAttribute(L"mapFirstVisibleDisplayLine", _i64tot(static_cast(viewSessionFiles[i]._mapPos._firstVisibleDisplayLine), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"mapFirstVisibleDocLine", _i64tot(static_cast(viewSessionFiles[i]._mapPos._firstVisibleDocLine), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"mapLastVisibleDocLine", _i64tot(static_cast(viewSessionFiles[i]._mapPos._lastVisibleDocLine), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"mapNbLine", _i64tot(static_cast(viewSessionFiles[i]._mapPos._nbLine), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"mapHigherPos", _i64tot(static_cast(viewSessionFiles[i]._mapPos._higherPos), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"mapWidth", _i64tot(static_cast(viewSessionFiles[i]._mapPos._width), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"mapHeight", _i64tot(static_cast(viewSessionFiles[i]._mapPos._height), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"mapKByteInDoc", _i64tot(static_cast(viewSessionFiles[i]._mapPos._KByteInDoc), szInt64, 10)); + (fileNameNode->ToElement())->SetAttribute(L"mapWrapIndentMode", _i64tot(static_cast(viewSessionFiles[i]._mapPos._wrapIndentMode), szInt64, 10)); + fileNameNode->ToElement()->SetAttribute(L"mapIsWrap", viewSessionFiles[i]._mapPos._isWrap ? L"yes" : L"no"); for (size_t j = 0, len = viewSessionFiles[i]._marks.size() ; j < len ; ++j) { size_t markLine = viewSessionFiles[i]._marks[j]; - TiXmlNode *markNode = fileNameNode->InsertEndChild(TiXmlElement(TEXT("Mark"))); - markNode->ToElement()->SetAttribute(TEXT("line"), _ui64tot(static_cast(markLine), szInt64, 10)); + TiXmlNode *markNode = fileNameNode->InsertEndChild(TiXmlElement(L"Mark")); + markNode->ToElement()->SetAttribute(L"line", _ui64tot(static_cast(markLine), szInt64, 10)); } for (size_t j = 0, len = viewSessionFiles[i]._foldStates.size() ; j < len ; ++j) { size_t foldLine = viewSessionFiles[i]._foldStates[j]; - TiXmlNode *foldNode = fileNameNode->InsertEndChild(TiXmlElement(TEXT("Fold"))); - foldNode->ToElement()->SetAttribute(TEXT("line"), _ui64tot(static_cast(foldLine), szInt64, 10)); + TiXmlNode *foldNode = fileNameNode->InsertEndChild(TiXmlElement(L"Fold")); + foldNode->ToElement()->SetAttribute(L"line", _ui64tot(static_cast(foldLine), szInt64, 10)); } } } @@ -3699,12 +3699,12 @@ void NppParameters::writeSession(const Session & session, const TCHAR *fileName) if (session._includeFileBrowser) { // Node structure and naming corresponds to config.xml - TiXmlNode* fileBrowserRootNode = sessionNode->InsertEndChild(TiXmlElement(TEXT("FileBrowser"))); - fileBrowserRootNode->ToElement()->SetAttribute(TEXT("latestSelectedItem"), session._fileBrowserSelectedItem.c_str()); + TiXmlNode* fileBrowserRootNode = sessionNode->InsertEndChild(TiXmlElement(L"FileBrowser")); + fileBrowserRootNode->ToElement()->SetAttribute(L"latestSelectedItem", session._fileBrowserSelectedItem.c_str()); for (const auto& fbRoot : session._fileBrowserRoots) { - TiXmlNode *fileNameNode = fileBrowserRootNode->InsertEndChild(TiXmlElement(TEXT("root"))); - (fileNameNode->ToElement())->SetAttribute(TEXT("foldername"), fbRoot.c_str()); + TiXmlNode *fileNameNode = fileBrowserRootNode->InsertEndChild(TiXmlElement(L"root")); + (fileNameNode->ToElement())->SetAttribute(L"foldername", fbRoot.c_str()); } } } @@ -3800,8 +3800,8 @@ void NppParameters::writeShortcuts() // user can always go back to Notepad++ v8.5.2 and use the backup of shortcuts.xml _pNativeLangSpeaker->messageBox("MacroAndRunCmdlWarning", nullptr, - TEXT("Your Macro and Run commands saved in Notepad++ v.8.5.2 (or older) may not be compatible with the current version of Notepad++.\nPlease test those commands and, if needed, re-edit them.\n\nAlternatively, you can downgrade to Notepad++ v8.5.2 and restore your previous data.\nNotepad++ will backup your old \"shortcuts.xml\" and save it as \"shortcuts.xml.v8.5.2.backup\".\nRenaming \"shortcuts.xml.v8.5.2.backup\" -> \"shortcuts.xml\", your commands should be restored and work properly."), - TEXT("Macro and Run Commands Compatibility"), + L"Your Macro and Run commands saved in Notepad++ v.8.5.2 (or older) may not be compatible with the current version of Notepad++.\nPlease test those commands and, if needed, re-edit them.\n\nAlternatively, you can downgrade to Notepad++ v8.5.2 and restore your previous data.\nNotepad++ will backup your old \"shortcuts.xml\" and save it as \"shortcuts.xml.v8.5.2.backup\".\nRenaming \"shortcuts.xml.v8.5.2.backup\" -> \"shortcuts.xml\", your commands should be restored and work properly.", + L"Macro and Run Commands Compatibility", MB_OK | MB_APPLMODAL | MB_ICONWARNING); } } @@ -3869,7 +3869,7 @@ void NppParameters::writeShortcuts() } -int NppParameters::addUserLangToEnd(const UserLangContainer & userLang, const TCHAR *newName) +int NppParameters::addUserLangToEnd(const UserLangContainer & userLang, const wchar_t *newName) { if (isExistingUserLangName(newName)) return -1; @@ -3905,47 +3905,47 @@ void NppParameters::removeUserLang(size_t index) void NppParameters::feedUserSettings(TiXmlNode *settingsRoot) { - const TCHAR *boolStr; - TiXmlNode *globalSettingNode = settingsRoot->FirstChildElement(TEXT("Global")); + const wchar_t *boolStr; + TiXmlNode *globalSettingNode = settingsRoot->FirstChildElement(L"Global"); if (globalSettingNode) { - boolStr = (globalSettingNode->ToElement())->Attribute(TEXT("caseIgnored")); + boolStr = (globalSettingNode->ToElement())->Attribute(L"caseIgnored"); if (boolStr) - _userLangArray[_nbUserLang - 1]->_isCaseIgnored = (lstrcmp(TEXT("yes"), boolStr) == 0); + _userLangArray[_nbUserLang - 1]->_isCaseIgnored = (lstrcmp(L"yes", boolStr) == 0); - boolStr = (globalSettingNode->ToElement())->Attribute(TEXT("allowFoldOfComments")); + boolStr = (globalSettingNode->ToElement())->Attribute(L"allowFoldOfComments"); if (boolStr) - _userLangArray[_nbUserLang - 1]->_allowFoldOfComments = (lstrcmp(TEXT("yes"), boolStr) == 0); + _userLangArray[_nbUserLang - 1]->_allowFoldOfComments = (lstrcmp(L"yes", boolStr) == 0); - (globalSettingNode->ToElement())->Attribute(TEXT("forcePureLC"), &_userLangArray[_nbUserLang - 1]->_forcePureLC); - (globalSettingNode->ToElement())->Attribute(TEXT("decimalSeparator"), &_userLangArray[_nbUserLang - 1]->_decimalSeparator); + (globalSettingNode->ToElement())->Attribute(L"forcePureLC", &_userLangArray[_nbUserLang - 1]->_forcePureLC); + (globalSettingNode->ToElement())->Attribute(L"decimalSeparator", &_userLangArray[_nbUserLang - 1]->_decimalSeparator); - boolStr = (globalSettingNode->ToElement())->Attribute(TEXT("foldCompact")); + boolStr = (globalSettingNode->ToElement())->Attribute(L"foldCompact"); if (boolStr) - _userLangArray[_nbUserLang - 1]->_foldCompact = (lstrcmp(TEXT("yes"), boolStr) == 0); + _userLangArray[_nbUserLang - 1]->_foldCompact = (lstrcmp(L"yes", boolStr) == 0); } - TiXmlNode *prefixNode = settingsRoot->FirstChildElement(TEXT("Prefix")); + TiXmlNode *prefixNode = settingsRoot->FirstChildElement(L"Prefix"); if (prefixNode) { - const TCHAR *udlVersion = _userLangArray[_nbUserLang - 1]->_udlVersion.c_str(); - if (!lstrcmp(udlVersion, TEXT("2.1")) || !lstrcmp(udlVersion, TEXT("2.0"))) + const wchar_t *udlVersion = _userLangArray[_nbUserLang - 1]->_udlVersion.c_str(); + if (!lstrcmp(udlVersion, L"2.1") || !lstrcmp(udlVersion, L"2.0")) { for (int i = 0 ; i < SCE_USER_TOTAL_KEYWORD_GROUPS ; ++i) { boolStr = (prefixNode->ToElement())->Attribute(globalMappper().keywordNameMapper[i+SCE_USER_KWLIST_KEYWORDS1]); if (boolStr) - _userLangArray[_nbUserLang - 1]->_isPrefix[i] = (lstrcmp(TEXT("yes"), boolStr) == 0); + _userLangArray[_nbUserLang - 1]->_isPrefix[i] = (lstrcmp(L"yes", boolStr) == 0); } } else // support for old style (pre 2.0) { - TCHAR names[SCE_USER_TOTAL_KEYWORD_GROUPS][7] = {TEXT("words1"), TEXT("words2"), TEXT("words3"), TEXT("words4")}; + wchar_t names[SCE_USER_TOTAL_KEYWORD_GROUPS][7] = {L"words1", L"words2", L"words3", L"words4"}; for (int i = 0 ; i < 4 ; ++i) { boolStr = (prefixNode->ToElement())->Attribute(names[i]); if (boolStr) - _userLangArray[_nbUserLang - 1]->_isPrefix[i] = (lstrcmp(TEXT("yes"), boolStr) == 0); + _userLangArray[_nbUserLang - 1]->_isPrefix[i] = (lstrcmp(L"yes", boolStr) == 0); } } } @@ -3954,60 +3954,60 @@ void NppParameters::feedUserSettings(TiXmlNode *settingsRoot) void NppParameters::feedUserKeywordList(TiXmlNode *node) { - const TCHAR * udlVersion = _userLangArray[_nbUserLang - 1]->_udlVersion.c_str(); + const wchar_t * udlVersion = _userLangArray[_nbUserLang - 1]->_udlVersion.c_str(); - for (TiXmlNode *childNode = node->FirstChildElement(TEXT("Keywords")); + for (TiXmlNode *childNode = node->FirstChildElement(L"Keywords"); childNode ; - childNode = childNode->NextSibling(TEXT("Keywords"))) + childNode = childNode->NextSibling(L"Keywords")) { - const TCHAR * keywordsName = (childNode->ToElement())->Attribute(TEXT("name")); + const wchar_t * keywordsName = (childNode->ToElement())->Attribute(L"name"); TiXmlNode *valueNode = childNode->FirstChild(); if (valueNode) { - const TCHAR *kwl = nullptr; - if (!lstrcmp(udlVersion, TEXT("")) && !lstrcmp(keywordsName, TEXT("Delimiters"))) // support for old style (pre 2.0) + const wchar_t *kwl = nullptr; + if (!lstrcmp(udlVersion, L"") && !lstrcmp(keywordsName, L"Delimiters")) // support for old style (pre 2.0) { - basic_string temp; + basic_string temp; kwl = valueNode->Value(); - temp += TEXT("00"); if (kwl[0] != '0') temp += kwl[0]; temp += TEXT(" 01"); - temp += TEXT(" 02"); if (kwl[3] != '0') temp += kwl[3]; - temp += TEXT(" 03"); if (kwl[1] != '0') temp += kwl[1]; temp += TEXT(" 04"); - temp += TEXT(" 05"); if (kwl[4] != '0') temp += kwl[4]; - temp += TEXT(" 06"); if (kwl[2] != '0') temp += kwl[2]; temp += TEXT(" 07"); - temp += TEXT(" 08"); if (kwl[5] != '0') temp += kwl[5]; + temp += L"00"; if (kwl[0] != '0') temp += kwl[0]; temp += L" 01"; + temp += L" 02"; if (kwl[3] != '0') temp += kwl[3]; + temp += L" 03"; if (kwl[1] != '0') temp += kwl[1]; temp += L" 04"; + temp += L" 05"; if (kwl[4] != '0') temp += kwl[4]; + temp += L" 06"; if (kwl[2] != '0') temp += kwl[2]; temp += L" 07"; + temp += L" 08"; if (kwl[5] != '0') temp += kwl[5]; - temp += TEXT(" 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23"); + temp += L" 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23"; wcscpy_s(_userLangArray[_nbUserLang - 1]->_keywordLists[SCE_USER_KWLIST_DELIMITERS], temp.c_str()); } - else if (!lstrcmp(keywordsName, TEXT("Comment"))) + else if (!lstrcmp(keywordsName, L"Comment")) { kwl = valueNode->Value(); - basic_string temp{TEXT(" ")}; + basic_string temp{L" "}; temp += kwl; size_t pos = 0; - pos = temp.find(TEXT(" 0")); + pos = temp.find(L" 0"); while (pos != string::npos) { - temp.replace(pos, 2, TEXT(" 00")); - pos = temp.find(TEXT(" 0"), pos+1); + temp.replace(pos, 2, L" 00"); + pos = temp.find(L" 0", pos+1); } - pos = temp.find(TEXT(" 1")); + pos = temp.find(L" 1"); while (pos != string::npos) { - temp.replace(pos, 2, TEXT(" 03")); - pos = temp.find(TEXT(" 1")); + temp.replace(pos, 2, L" 03"); + pos = temp.find(L" 1"); } - pos = temp.find(TEXT(" 2")); + pos = temp.find(L" 2"); while (pos != string::npos) { - temp.replace(pos, 2, TEXT(" 04")); - pos = temp.find(TEXT(" 2")); + temp.replace(pos, 2, L" 04"); + pos = temp.find(L" 2"); } - temp += TEXT(" 01 02"); + temp += L" 01 02"; if (temp[0] == ' ') temp.erase(0, 1); @@ -4025,7 +4025,7 @@ void NppParameters::feedUserKeywordList(TiXmlNode *node) } else { - wcscpy_s(_userLangArray[_nbUserLang - 1]->_keywordLists[id], TEXT("imported string too long, needs to be < max_char(30720)")); + wcscpy_s(_userLangArray[_nbUserLang - 1]->_keywordLists[id], L"imported string too long, needs to be < max_char(30720)"); } } } @@ -4035,11 +4035,11 @@ void NppParameters::feedUserKeywordList(TiXmlNode *node) void NppParameters::feedUserStyles(TiXmlNode *node) { - for (TiXmlNode *childNode = node->FirstChildElement(TEXT("WordsStyle")); + for (TiXmlNode *childNode = node->FirstChildElement(L"WordsStyle"); childNode ; - childNode = childNode->NextSibling(TEXT("WordsStyle"))) + childNode = childNode->NextSibling(L"WordsStyle")) { - const TCHAR *styleName = (childNode->ToElement())->Attribute(TEXT("name")); + const wchar_t *styleName = (childNode->ToElement())->Attribute(L"name"); if (styleName) { if (globalMappper().styleIdMapper.find(styleName) != globalMappper().styleIdMapper.end()) @@ -4053,23 +4053,23 @@ void NppParameters::feedUserStyles(TiXmlNode *node) bool NppParameters::feedStylerArray(TiXmlNode *node) { - TiXmlNode *styleRoot = node->FirstChildElement(TEXT("LexerStyles")); + TiXmlNode *styleRoot = node->FirstChildElement(L"LexerStyles"); if (!styleRoot) return false; // For each lexer - for (TiXmlNode *childNode = styleRoot->FirstChildElement(TEXT("LexerType")); + for (TiXmlNode *childNode = styleRoot->FirstChildElement(L"LexerType"); childNode ; - childNode = childNode->NextSibling(TEXT("LexerType")) ) + childNode = childNode->NextSibling(L"LexerType") ) { TiXmlElement *element = childNode->ToElement(); - const TCHAR *lexerName = element->Attribute(TEXT("name")); - const TCHAR *lexerDesc = element->Attribute(TEXT("desc")); - const TCHAR *lexerUserExt = element->Attribute(TEXT("ext")); - const TCHAR *lexerExcluded = element->Attribute(TEXT("excluded")); + const wchar_t *lexerName = element->Attribute(L"name"); + const wchar_t *lexerDesc = element->Attribute(L"desc"); + const wchar_t *lexerUserExt = element->Attribute(L"ext"); + const wchar_t *lexerExcluded = element->Attribute(L"excluded"); if (lexerName) { _lexerStylerVect.addLexerStyler(lexerName, lexerDesc, lexerUserExt, childNode); - if (lexerExcluded != NULL && (lstrcmp(lexerExcluded, TEXT("yes")) == 0)) + if (lexerExcluded != NULL && (lstrcmp(lexerExcluded, L"yes") == 0)) { int index = getExternalLangIndexFromName(lexerName); if (index != -1) @@ -4081,15 +4081,15 @@ bool NppParameters::feedStylerArray(TiXmlNode *node) _lexerStylerVect.sort(); // The global styles for all lexers - TiXmlNode *globalStyleRoot = node->FirstChildElement(TEXT("GlobalStyles")); + TiXmlNode *globalStyleRoot = node->FirstChildElement(L"GlobalStyles"); if (!globalStyleRoot) return false; - for (TiXmlNode *childNode = globalStyleRoot->FirstChildElement(TEXT("WidgetStyle")); + for (TiXmlNode *childNode = globalStyleRoot->FirstChildElement(L"WidgetStyle"); childNode ; - childNode = childNode->NextSibling(TEXT("WidgetStyle")) ) + childNode = childNode->NextSibling(L"WidgetStyle") ) { TiXmlElement *element = childNode->ToElement(); - const TCHAR *styleIDStr = element->Attribute(TEXT("styleID")); + const wchar_t *styleIDStr = element->Attribute(L"styleID"); int styleID = -1; if ((styleID = decStrVal(styleIDStr)) != -1) @@ -4181,7 +4181,7 @@ bool NppParameters::feedStylerArray(TiXmlNode *node) return true; } -void LexerStylerArray::addLexerStyler(const TCHAR *lexerName, const TCHAR *lexerDesc, const TCHAR *lexerUserExt , TiXmlNode *lexerNode) +void LexerStylerArray::addLexerStyler(const wchar_t *lexerName, const wchar_t *lexerDesc, const wchar_t *lexerUserExt , TiXmlNode *lexerNode) { _lexerStylerVect.emplace_back(); LexerStyler & ls = _lexerStylerVect.back(); @@ -4192,12 +4192,12 @@ void LexerStylerArray::addLexerStyler(const TCHAR *lexerName, const TCHAR *lexer if (lexerUserExt) ls.setLexerUserExt(lexerUserExt); - for (TiXmlNode *childNode = lexerNode->FirstChildElement(TEXT("WordsStyle")); + for (TiXmlNode *childNode = lexerNode->FirstChildElement(L"WordsStyle"); childNode ; - childNode = childNode->NextSibling(TEXT("WordsStyle")) ) + childNode = childNode->NextSibling(L"WordsStyle") ) { TiXmlElement *element = childNode->ToElement(); - const TCHAR *styleIDStr = element->Attribute(TEXT("styleID")); + const wchar_t *styleIDStr = element->Attribute(L"styleID"); if (styleIDStr) { @@ -4232,7 +4232,7 @@ void StyleArray::addStyler(int styleID, TiXmlNode *styleNode) // Pour _fgColor, _bgColor : // RGB() | (result & 0xFF000000) c'est pour le cas de -1 (0xFFFFFFFF) // retourné par hexStrVal(str) - const TCHAR *str = element->Attribute(TEXT("name")); + const wchar_t *str = element->Attribute(L"name"); if (str) { if (isUser) @@ -4241,7 +4241,7 @@ void StyleArray::addStyler(int styleID, TiXmlNode *styleNode) s._styleDesc = str; } - str = element->Attribute(TEXT("fgColor")); + str = element->Attribute(L"fgColor"); if (str) { unsigned long result = hexStrVal(str); @@ -4249,45 +4249,45 @@ void StyleArray::addStyler(int styleID, TiXmlNode *styleNode) } - str = element->Attribute(TEXT("bgColor")); + str = element->Attribute(L"bgColor"); if (str) { unsigned long result = hexStrVal(str); s._bgColor = (RGB((result >> 16) & 0xFF, (result >> 8) & 0xFF, result & 0xFF)) | (result & 0xFF000000); } - str = element->Attribute(TEXT("colorStyle")); + str = element->Attribute(L"colorStyle"); if (str) { s._colorStyle = decStrVal(str); } - str = element->Attribute(TEXT("fontName")); + str = element->Attribute(L"fontName"); if (str) { s._fontName = str; s._isFontEnabled = true; } - str = element->Attribute(TEXT("fontStyle")); + str = element->Attribute(L"fontStyle"); if (str) { s._fontStyle = decStrVal(str); } - str = element->Attribute(TEXT("fontSize")); + str = element->Attribute(L"fontSize"); if (str) { s._fontSize = decStrVal(str); } - str = element->Attribute(TEXT("nesting")); + str = element->Attribute(L"nesting"); if (str) { s._nesting = decStrVal(str); } - str = element->Attribute(TEXT("keywordClass")); + str = element->Attribute(L"keywordClass"); if (str) { s._keywordClass = getKwClassFromName(str); @@ -4305,21 +4305,21 @@ bool NppParameters::writeRecentFileHistorySettings(int nbMaxFile) const { if (!_pXmlUserDoc) return false; - TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(L"NotepadPlus"); if (!nppRoot) { - nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); } - TiXmlNode *historyNode = nppRoot->FirstChildElement(TEXT("History")); + TiXmlNode *historyNode = nppRoot->FirstChildElement(L"History"); if (!historyNode) { - historyNode = nppRoot->InsertEndChild(TiXmlElement(TEXT("History"))); + historyNode = nppRoot->InsertEndChild(TiXmlElement(L"History")); } - (historyNode->ToElement())->SetAttribute(TEXT("nbMaxFile"), nbMaxFile!=-1?nbMaxFile:_nbMaxRecentFile); - (historyNode->ToElement())->SetAttribute(TEXT("inSubMenu"), _putRecentFileInSubMenu?TEXT("yes"):TEXT("no")); - (historyNode->ToElement())->SetAttribute(TEXT("customLength"), _recentFileCustomLength); + (historyNode->ToElement())->SetAttribute(L"nbMaxFile", nbMaxFile!=-1?nbMaxFile:_nbMaxRecentFile); + (historyNode->ToElement())->SetAttribute(L"inSubMenu", _putRecentFileInSubMenu ? L"yes" : L"no"); + (historyNode->ToElement())->SetAttribute(L"customLength", _recentFileCustomLength); return true; } @@ -4327,13 +4327,13 @@ bool NppParameters::writeColumnEditorSettings() const { if (!_pXmlUserDoc) return false; - TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(L"NotepadPlus"); if (!nppRoot) { - nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); } - TiXmlNode *oldColumnEditorNode = nppRoot->FirstChildElement(TEXT("ColumnEditor")); + TiXmlNode *oldColumnEditorNode = nppRoot->FirstChildElement(L"ColumnEditor"); if (oldColumnEditorNode) { // Erase the Project Panel root @@ -4341,31 +4341,31 @@ bool NppParameters::writeColumnEditorSettings() const } // Create the new ColumnEditor root - TiXmlElement columnEditorRootNode{TEXT("ColumnEditor")}; - (columnEditorRootNode.ToElement())->SetAttribute(TEXT("choice"), _columnEditParam._mainChoice == activeNumeric ? L"number" : L"text"); + TiXmlElement columnEditorRootNode{L"ColumnEditor"}; + (columnEditorRootNode.ToElement())->SetAttribute(L"choice", _columnEditParam._mainChoice == activeNumeric ? L"number" : L"text"); - TiXmlElement textNode{ TEXT("text") }; - (textNode.ToElement())->SetAttribute(TEXT("content"), _columnEditParam._insertedTextContent.c_str()); + TiXmlElement textNode{ L"text" }; + (textNode.ToElement())->SetAttribute(L"content", _columnEditParam._insertedTextContent.c_str()); (columnEditorRootNode.ToElement())->InsertEndChild(textNode); - TiXmlElement numberNode{ TEXT("number") }; - (numberNode.ToElement())->SetAttribute(TEXT("initial"), _columnEditParam._initialNum); - (numberNode.ToElement())->SetAttribute(TEXT("increase"), _columnEditParam._increaseNum); - (numberNode.ToElement())->SetAttribute(TEXT("repeat"), _columnEditParam._repeatNum); - wstring format = TEXT("dec"); + TiXmlElement numberNode{ L"number" }; + (numberNode.ToElement())->SetAttribute(L"initial", _columnEditParam._initialNum); + (numberNode.ToElement())->SetAttribute(L"increase", _columnEditParam._increaseNum); + (numberNode.ToElement())->SetAttribute(L"repeat", _columnEditParam._repeatNum); + wstring format = L"dec"; if (_columnEditParam._formatChoice == 1) - format = TEXT("hex"); + format = L"hex"; else if (_columnEditParam._formatChoice == 2) - format = TEXT("oct"); + format = L"oct"; else if (_columnEditParam._formatChoice == 3) - format = TEXT("bin"); - (numberNode.ToElement())->SetAttribute(TEXT("formatChoice"), format); - wstring leading = TEXT("none"); + format = L"bin"; + (numberNode.ToElement())->SetAttribute(L"formatChoice", format); + wstring leading = L"none"; if (_columnEditParam._leadingChoice == ColumnEditorParam::zeroLeading) - leading = TEXT("zeros"); + leading = L"zeros"; else if (_columnEditParam._leadingChoice == ColumnEditorParam::spaceLeading) - leading = TEXT("spaces"); - (numberNode.ToElement())->SetAttribute(TEXT("leadingChoice"), leading); + leading = L"spaces"; + (numberNode.ToElement())->SetAttribute(L"leadingChoice", leading); (columnEditorRootNode.ToElement())->InsertEndChild(numberNode); // (Re)Insert the Project Panel root @@ -4377,13 +4377,13 @@ bool NppParameters::writeProjectPanelsSettings() const { if (!_pXmlUserDoc) return false; - TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(L"NotepadPlus"); if (!nppRoot) { - nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); } - TiXmlNode *oldProjPanelRootNode = nppRoot->FirstChildElement(TEXT("ProjectPanels")); + TiXmlNode *oldProjPanelRootNode = nppRoot->FirstChildElement(L"ProjectPanels"); if (oldProjPanelRootNode) { // Erase the Project Panel root @@ -4391,14 +4391,14 @@ bool NppParameters::writeProjectPanelsSettings() const } // Create the Project Panel root - TiXmlElement projPanelRootNode{TEXT("ProjectPanels")}; + TiXmlElement projPanelRootNode{L"ProjectPanels"}; // Add 3 Project Panel parameters for (int32_t i = 0 ; i < 3 ; ++i) { - TiXmlElement projPanelNode{TEXT("ProjectPanel")}; - (projPanelNode.ToElement())->SetAttribute(TEXT("id"), i); - (projPanelNode.ToElement())->SetAttribute(TEXT("workSpaceFile"), _workSpaceFilePathes[i]); + TiXmlElement projPanelNode{L"ProjectPanel"}; + (projPanelNode.ToElement())->SetAttribute(L"id", i); + (projPanelNode.ToElement())->SetAttribute(L"workSpaceFile", _workSpaceFilePathes[i]); (projPanelRootNode.ToElement())->InsertEndChild(projPanelNode); } @@ -4412,13 +4412,13 @@ bool NppParameters::writeFileBrowserSettings(const vector & rootPa { if (!_pXmlUserDoc) return false; - TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(L"NotepadPlus"); if (!nppRoot) { - nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); } - TiXmlNode *oldFileBrowserRootNode = nppRoot->FirstChildElement(TEXT("FileBrowser")); + TiXmlNode *oldFileBrowserRootNode = nppRoot->FirstChildElement(L"FileBrowser"); if (oldFileBrowserRootNode) { // Erase the file broser root @@ -4426,18 +4426,18 @@ bool NppParameters::writeFileBrowserSettings(const vector & rootPa } // Create the file browser root - TiXmlElement fileBrowserRootNode{ TEXT("FileBrowser") }; + TiXmlElement fileBrowserRootNode{ L"FileBrowser" }; if (rootPaths.size() != 0) { - fileBrowserRootNode.SetAttribute(TEXT("latestSelectedItem"), latestSelectedItemPath.c_str()); + fileBrowserRootNode.SetAttribute(L"latestSelectedItem", latestSelectedItemPath.c_str()); // add roots size_t len = rootPaths.size(); for (size_t i = 0; i < len; ++i) { - TiXmlElement fbRootNode{ TEXT("root") }; - (fbRootNode.ToElement())->SetAttribute(TEXT("foldername"), rootPaths[i].c_str()); + TiXmlElement fbRootNode{ L"root" }; + (fbRootNode.ToElement())->SetAttribute(L"foldername", rootPaths[i].c_str()); (fileBrowserRootNode.ToElement())->InsertEndChild(fbRootNode); } @@ -4448,36 +4448,36 @@ bool NppParameters::writeFileBrowserSettings(const vector & rootPa return true; } -bool NppParameters::writeHistory(const TCHAR *fullpath) +bool NppParameters::writeHistory(const wchar_t *fullpath) { - TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(L"NotepadPlus"); if (!nppRoot) { - nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); } - TiXmlNode *historyNode = nppRoot->FirstChildElement(TEXT("History")); + TiXmlNode *historyNode = nppRoot->FirstChildElement(L"History"); if (!historyNode) { - historyNode = nppRoot->InsertEndChild(TiXmlElement(TEXT("History"))); + historyNode = nppRoot->InsertEndChild(TiXmlElement(L"History")); } - TiXmlElement recentFileNode(TEXT("File")); - (recentFileNode.ToElement())->SetAttribute(TEXT("filename"), fullpath); + TiXmlElement recentFileNode(L"File"); + (recentFileNode.ToElement())->SetAttribute(L"filename", fullpath); (historyNode->ToElement())->InsertEndChild(recentFileNode); return true; } -TiXmlNode * NppParameters::getChildElementByAttribut(TiXmlNode *pere, const TCHAR *childName,\ - const TCHAR *attributName, const TCHAR *attributVal) const +TiXmlNode * NppParameters::getChildElementByAttribut(TiXmlNode *pere, const wchar_t *childName,\ + const wchar_t *attributName, const wchar_t *attributVal) const { for (TiXmlNode *childNode = pere->FirstChildElement(childName); childNode ; childNode = childNode->NextSibling(childName)) { TiXmlElement *element = childNode->ToElement(); - const TCHAR *val = element->Attribute(attributName); + const wchar_t *val = element->Attribute(attributName); if (val) { if (!lstrcmp(val, attributVal)) @@ -4488,12 +4488,12 @@ TiXmlNode * NppParameters::getChildElementByAttribut(TiXmlNode *pere, const TCHA } // 2 restes : L_H, L_USER -LangType NppParameters::getLangIDFromStr(const TCHAR *langName) +LangType NppParameters::getLangIDFromStr(const wchar_t *langName) { int lang = static_cast(L_TEXT); for (; lang < L_EXTERNAL; ++lang) { - const TCHAR * name = ScintillaEditView::_langNameInfoArray[lang]._langName; + const wchar_t * name = ScintillaEditView::_langNameInfoArray[lang]._langName; if (!lstrcmp(name, langName)) //found lang? { return (LangType)lang; @@ -4514,190 +4514,190 @@ LangType NppParameters::getLangIDFromStr(const TCHAR *langName) std::wstring NppParameters::getLocPathFromStr(const std::wstring & localizationCode) { - if (localizationCode == TEXT("en") || localizationCode == TEXT("en-au") || localizationCode == TEXT("en-bz") || localizationCode == TEXT("en-ca") || localizationCode == TEXT("en-cb") || localizationCode == TEXT("en-gb") || localizationCode == TEXT("en-ie") || localizationCode == TEXT("en-jm") || localizationCode == TEXT("en-nz") || localizationCode == TEXT("en-ph") || localizationCode == TEXT("en-tt") || localizationCode == TEXT("en-us") || localizationCode == TEXT("en-za") || localizationCode == TEXT("en-zw")) - return TEXT("english.xml"); - if (localizationCode == TEXT("af")) - return TEXT("afrikaans.xml"); - if (localizationCode == TEXT("sq")) - return TEXT("albanian.xml"); - if (localizationCode == TEXT("ar") || localizationCode == TEXT("ar-dz") || localizationCode == TEXT("ar-bh") || localizationCode == TEXT("ar-eg") ||localizationCode == TEXT("ar-iq") || localizationCode == TEXT("ar-jo") || localizationCode == TEXT("ar-kw") || localizationCode == TEXT("ar-lb") || localizationCode == TEXT("ar-ly") || localizationCode == TEXT("ar-ma") || localizationCode == TEXT("ar-om") || localizationCode == TEXT("ar-qa") || localizationCode == TEXT("ar-sa") || localizationCode == TEXT("ar-sy") || localizationCode == TEXT("ar-tn") || localizationCode == TEXT("ar-ae") || localizationCode == TEXT("ar-ye")) - return TEXT("arabic.xml"); - if (localizationCode == TEXT("an")) - return TEXT("aragonese.xml"); - if (localizationCode == TEXT("az")) - return TEXT("azerbaijani.xml"); - if (localizationCode == TEXT("eu")) - return TEXT("basque.xml"); - if (localizationCode == TEXT("be")) - return TEXT("belarusian.xml"); - if (localizationCode == TEXT("bn")) - return TEXT("bengali.xml"); - if (localizationCode == TEXT("bs")) - return TEXT("bosnian.xml"); - if (localizationCode == TEXT("pt-br")) - return TEXT("brazilian_portuguese.xml"); - if (localizationCode == TEXT("br-fr")) - return TEXT("breton.xml"); - if (localizationCode == TEXT("bg")) - return TEXT("bulgarian.xml"); - if (localizationCode == TEXT("ca")) - return TEXT("catalan.xml"); - if (localizationCode == TEXT("zh-tw") || localizationCode == TEXT("zh-hk") || localizationCode == TEXT("zh-sg")) - return TEXT("taiwaneseMandarin.xml"); - if (localizationCode == TEXT("zh") || localizationCode == TEXT("zh-cn")) - return TEXT("chineseSimplified.xml"); - if (localizationCode == TEXT("co") || localizationCode == TEXT("co-fr")) - return TEXT("corsican.xml"); - if (localizationCode == TEXT("hr")) - return TEXT("croatian.xml"); - if (localizationCode == TEXT("cs")) - return TEXT("czech.xml"); - if (localizationCode == TEXT("da")) - return TEXT("danish.xml"); - if (localizationCode == TEXT("nl") || localizationCode == TEXT("nl-be")) - return TEXT("dutch.xml"); - if (localizationCode == TEXT("eo")) - return TEXT("esperanto.xml"); - if (localizationCode == TEXT("et")) - return TEXT("estonian.xml"); - if (localizationCode == TEXT("fa")) - return TEXT("farsi.xml"); - if (localizationCode == TEXT("fi")) - return TEXT("finnish.xml"); - if (localizationCode == TEXT("fr") || localizationCode == TEXT("fr-be") || localizationCode == TEXT("fr-ca") || localizationCode == TEXT("fr-fr") || localizationCode == TEXT("fr-lu") || localizationCode == TEXT("fr-mc") || localizationCode == TEXT("fr-ch")) - return TEXT("french.xml"); - if (localizationCode == TEXT("fur")) - return TEXT("friulian.xml"); - if (localizationCode == TEXT("gl")) - return TEXT("galician.xml"); - if (localizationCode == TEXT("ka")) - return TEXT("georgian.xml"); - if (localizationCode == TEXT("de") || localizationCode == TEXT("de-at") || localizationCode == TEXT("de-de") || localizationCode == TEXT("de-li") || localizationCode == TEXT("de-lu") || localizationCode == TEXT("de-ch")) - return TEXT("german.xml"); - if (localizationCode == TEXT("el")) - return TEXT("greek.xml"); - if (localizationCode == TEXT("gu")) - return TEXT("gujarati.xml"); - if (localizationCode == TEXT("he")) - return TEXT("hebrew.xml"); - if (localizationCode == TEXT("hi")) - return TEXT("hindi.xml"); - if (localizationCode == TEXT("hu")) - return TEXT("hungarian.xml"); - if (localizationCode == TEXT("id")) - return TEXT("indonesian.xml"); - if (localizationCode == TEXT("it") || localizationCode == TEXT("it-ch")) - return TEXT("italian.xml"); - if (localizationCode == TEXT("ja")) - return TEXT("japanese.xml"); - if (localizationCode == TEXT("kn")) - return TEXT("kannada.xml"); - if (localizationCode == TEXT("kk")) - return TEXT("kazakh.xml"); - if (localizationCode == TEXT("ko") || localizationCode == TEXT("ko-kp") || localizationCode == TEXT("ko-kr")) - return TEXT("korean.xml"); - if (localizationCode == TEXT("ku")) - return TEXT("kurdish.xml"); - if (localizationCode == TEXT("ky")) - return TEXT("kyrgyz.xml"); - if (localizationCode == TEXT("lv")) - return TEXT("latvian.xml"); - if (localizationCode == TEXT("lt")) - return TEXT("lithuanian.xml"); - if (localizationCode == TEXT("lb")) - return TEXT("luxembourgish.xml"); - if (localizationCode == TEXT("mk")) - return TEXT("macedonian.xml"); - if (localizationCode == TEXT("ms")) - return TEXT("malay.xml"); - if (localizationCode == TEXT("mr")) - return TEXT("marathi.xml"); - if (localizationCode == TEXT("mn")) - return TEXT("mongolian.xml"); - if (localizationCode == TEXT("no") || localizationCode == TEXT("nb")) - return TEXT("norwegian.xml"); - if (localizationCode == TEXT("nn")) - return TEXT("nynorsk.xml"); - if (localizationCode == TEXT("oc")) - return TEXT("occitan.xml"); - if (localizationCode == TEXT("pl")) - return TEXT("polish.xml"); - if (localizationCode == TEXT("pt") || localizationCode == TEXT("pt-pt")) - return TEXT("portuguese.xml"); - if (localizationCode == TEXT("pa") || localizationCode == TEXT("pa-in")) - return TEXT("punjabi.xml"); - if (localizationCode == TEXT("ro") || localizationCode == TEXT("ro-mo")) - return TEXT("romanian.xml"); - if (localizationCode == TEXT("ru") || localizationCode == TEXT("ru-mo")) - return TEXT("russian.xml"); - if (localizationCode == TEXT("sc")) - return TEXT("sardinian.xml"); - if (localizationCode == TEXT("sr")) - return TEXT("serbian.xml"); - if (localizationCode == TEXT("sr-cyrl-ba") || localizationCode == TEXT("sr-cyrl-sp")) - return TEXT("serbianCyrillic.xml"); - if (localizationCode == TEXT("si")) - return TEXT("sinhala.xml"); - if (localizationCode == TEXT("sk")) - return TEXT("slovak.xml"); - if (localizationCode == TEXT("sl")) - return TEXT("slovenian.xml"); - if (localizationCode == TEXT("es") || localizationCode == TEXT("es-bo") || localizationCode == TEXT("es-cl") || localizationCode == TEXT("es-co") || localizationCode == TEXT("es-cr") || localizationCode == TEXT("es-do") || localizationCode == TEXT("es-ec") || localizationCode == TEXT("es-sv") || localizationCode == TEXT("es-gt") || localizationCode == TEXT("es-hn") || localizationCode == TEXT("es-mx") || localizationCode == TEXT("es-ni") || localizationCode == TEXT("es-pa") || localizationCode == TEXT("es-py") || localizationCode == TEXT("es-pe") || localizationCode == TEXT("es-pr") || localizationCode == TEXT("es-es") || localizationCode == TEXT("es-uy") || localizationCode == TEXT("es-ve")) - return TEXT("spanish.xml"); - if (localizationCode == TEXT("es-ar")) - return TEXT("spanish_ar.xml"); - if (localizationCode == TEXT("sv")) - return TEXT("swedish.xml"); - if (localizationCode == TEXT("tl")) - return TEXT("tagalog.xml"); - if (localizationCode == TEXT("tg-cyrl-tj")) - return TEXT("tajikCyrillic.xml"); - if (localizationCode == TEXT("ta")) - return TEXT("tamil.xml"); - if (localizationCode == TEXT("tt")) - return TEXT("tatar.xml"); - if (localizationCode == TEXT("te")) - return TEXT("telugu.xml"); - if (localizationCode == TEXT("th")) - return TEXT("thai.xml"); - if (localizationCode == TEXT("tr")) - return TEXT("turkish.xml"); - if (localizationCode == TEXT("uk")) - return TEXT("ukrainian.xml"); - if (localizationCode == TEXT("ur") || localizationCode == TEXT("ur-pk")) - return TEXT("urdu.xml"); - if (localizationCode == TEXT("ug-cn")) - return TEXT("uyghur.xml"); - if (localizationCode == TEXT("uz")) - return TEXT("uzbek.xml"); - if (localizationCode == TEXT("uz-cyrl-uz")) - return TEXT("uzbekCyrillic.xml"); - if (localizationCode == TEXT("vec")) - return TEXT("venetian.xml"); - if (localizationCode == TEXT("vi") || localizationCode == TEXT("vi-vn")) - return TEXT("vietnamese.xml"); - if (localizationCode == TEXT("cy-gb")) - return TEXT("welsh.xml"); - if (localizationCode == TEXT("zu") || localizationCode == TEXT("zu-za")) - return TEXT("zulu.xml"); - if (localizationCode == TEXT("ne") || localizationCode == TEXT("nep")) - return TEXT("nepali.xml"); - if (localizationCode == TEXT("oc-aranes")) - return TEXT("aranese.xml"); - if (localizationCode == TEXT("exy")) - return TEXT("extremaduran.xml"); - if (localizationCode == TEXT("keb")) - return TEXT("kabyle.xml"); - if (localizationCode == TEXT("lij")) - return TEXT("ligurian.xml"); - if (localizationCode == TEXT("ga")) - return TEXT("irish.xml"); - if (localizationCode == TEXT("sgs")) - return TEXT("samogitian.xml"); - if (localizationCode == TEXT("yue")) - return TEXT("hongKongCantonese.xml"); - if (localizationCode == TEXT("ab") || localizationCode == TEXT("abk")) - return TEXT("abkhazian.xml"); + if (localizationCode == L"en" || localizationCode == L"en-au" || localizationCode == L"en-bz" || localizationCode == L"en-ca" || localizationCode == L"en-cb" || localizationCode == L"en-gb" || localizationCode == L"en-ie" || localizationCode == L"en-jm" || localizationCode == L"en-nz" || localizationCode == L"en-ph" || localizationCode == L"en-tt" || localizationCode == L"en-us" || localizationCode == L"en-za" || localizationCode == L"en-zw") + return L"english.xml"; + if (localizationCode == L"af") + return L"afrikaans.xml"; + if (localizationCode == L"sq") + return L"albanian.xml"; + if (localizationCode == L"ar" || localizationCode == L"ar-dz" || localizationCode == L"ar-bh" || localizationCode == L"ar-eg" ||localizationCode == L"ar-iq" || localizationCode == L"ar-jo" || localizationCode == L"ar-kw" || localizationCode == L"ar-lb" || localizationCode == L"ar-ly" || localizationCode == L"ar-ma" || localizationCode == L"ar-om" || localizationCode == L"ar-qa" || localizationCode == L"ar-sa" || localizationCode == L"ar-sy" || localizationCode == L"ar-tn" || localizationCode == L"ar-ae" || localizationCode == L"ar-ye") + return L"arabic.xml"; + if (localizationCode == L"an") + return L"aragonese.xml"; + if (localizationCode == L"az") + return L"azerbaijani.xml"; + if (localizationCode == L"eu") + return L"basque.xml"; + if (localizationCode == L"be") + return L"belarusian.xml"; + if (localizationCode == L"bn") + return L"bengali.xml"; + if (localizationCode == L"bs") + return L"bosnian.xml"; + if (localizationCode == L"pt-br") + return L"brazilian_portuguese.xml"; + if (localizationCode == L"br-fr") + return L"breton.xml"; + if (localizationCode == L"bg") + return L"bulgarian.xml"; + if (localizationCode == L"ca") + return L"catalan.xml"; + if (localizationCode == L"zh-tw" || localizationCode == L"zh-hk" || localizationCode == L"zh-sg") + return L"taiwaneseMandarin.xml"; + if (localizationCode == L"zh" || localizationCode == L"zh-cn") + return L"chineseSimplified.xml"; + if (localizationCode == L"co" || localizationCode == L"co-fr") + return L"corsican.xml"; + if (localizationCode == L"hr") + return L"croatian.xml"; + if (localizationCode == L"cs") + return L"czech.xml"; + if (localizationCode == L"da") + return L"danish.xml"; + if (localizationCode == L"nl" || localizationCode == L"nl-be") + return L"dutch.xml"; + if (localizationCode == L"eo") + return L"esperanto.xml"; + if (localizationCode == L"et") + return L"estonian.xml"; + if (localizationCode == L"fa") + return L"farsi.xml"; + if (localizationCode == L"fi") + return L"finnish.xml"; + if (localizationCode == L"fr" || localizationCode == L"fr-be" || localizationCode == L"fr-ca" || localizationCode == L"fr-fr" || localizationCode == L"fr-lu" || localizationCode == L"fr-mc" || localizationCode == L"fr-ch") + return L"french.xml"; + if (localizationCode == L"fur") + return L"friulian.xml"; + if (localizationCode == L"gl") + return L"galician.xml"; + if (localizationCode == L"ka") + return L"georgian.xml"; + if (localizationCode == L"de" || localizationCode == L"de-at" || localizationCode == L"de-de" || localizationCode == L"de-li" || localizationCode == L"de-lu" || localizationCode == L"de-ch") + return L"german.xml"; + if (localizationCode == L"el") + return L"greek.xml"; + if (localizationCode == L"gu") + return L"gujarati.xml"; + if (localizationCode == L"he") + return L"hebrew.xml"; + if (localizationCode == L"hi") + return L"hindi.xml"; + if (localizationCode == L"hu") + return L"hungarian.xml"; + if (localizationCode == L"id") + return L"indonesian.xml"; + if (localizationCode == L"it" || localizationCode == L"it-ch") + return L"italian.xml"; + if (localizationCode == L"ja") + return L"japanese.xml"; + if (localizationCode == L"kn") + return L"kannada.xml"; + if (localizationCode == L"kk") + return L"kazakh.xml"; + if (localizationCode == L"ko" || localizationCode == L"ko-kp" || localizationCode == L"ko-kr") + return L"korean.xml"; + if (localizationCode == L"ku") + return L"kurdish.xml"; + if (localizationCode == L"ky") + return L"kyrgyz.xml"; + if (localizationCode == L"lv") + return L"latvian.xml"; + if (localizationCode == L"lt") + return L"lithuanian.xml"; + if (localizationCode == L"lb") + return L"luxembourgish.xml"; + if (localizationCode == L"mk") + return L"macedonian.xml"; + if (localizationCode == L"ms") + return L"malay.xml"; + if (localizationCode == L"mr") + return L"marathi.xml"; + if (localizationCode == L"mn") + return L"mongolian.xml"; + if (localizationCode == L"no" || localizationCode == L"nb") + return L"norwegian.xml"; + if (localizationCode == L"nn") + return L"nynorsk.xml"; + if (localizationCode == L"oc") + return L"occitan.xml"; + if (localizationCode == L"pl") + return L"polish.xml"; + if (localizationCode == L"pt" || localizationCode == L"pt-pt") + return L"portuguese.xml"; + if (localizationCode == L"pa" || localizationCode == L"pa-in") + return L"punjabi.xml"; + if (localizationCode == L"ro" || localizationCode == L"ro-mo") + return L"romanian.xml"; + if (localizationCode == L"ru" || localizationCode == L"ru-mo") + return L"russian.xml"; + if (localizationCode == L"sc") + return L"sardinian.xml"; + if (localizationCode == L"sr") + return L"serbian.xml"; + if (localizationCode == L"sr-cyrl-ba" || localizationCode == L"sr-cyrl-sp") + return L"serbianCyrillic.xml"; + if (localizationCode == L"si") + return L"sinhala.xml"; + if (localizationCode == L"sk") + return L"slovak.xml"; + if (localizationCode == L"sl") + return L"slovenian.xml"; + if (localizationCode == L"es" || localizationCode == L"es-bo" || localizationCode == L"es-cl" || localizationCode == L"es-co" || localizationCode == L"es-cr" || localizationCode == L"es-do" || localizationCode == L"es-ec" || localizationCode == L"es-sv" || localizationCode == L"es-gt" || localizationCode == L"es-hn" || localizationCode == L"es-mx" || localizationCode == L"es-ni" || localizationCode == L"es-pa" || localizationCode == L"es-py" || localizationCode == L"es-pe" || localizationCode == L"es-pr" || localizationCode == L"es-es" || localizationCode == L"es-uy" || localizationCode == L"es-ve") + return L"spanish.xml"; + if (localizationCode == L"es-ar") + return L"spanish_ar.xml"; + if (localizationCode == L"sv") + return L"swedish.xml"; + if (localizationCode == L"tl") + return L"tagalog.xml"; + if (localizationCode == L"tg-cyrl-tj") + return L"tajikCyrillic.xml"; + if (localizationCode == L"ta") + return L"tamil.xml"; + if (localizationCode == L"tt") + return L"tatar.xml"; + if (localizationCode == L"te") + return L"telugu.xml"; + if (localizationCode == L"th") + return L"thai.xml"; + if (localizationCode == L"tr") + return L"turkish.xml"; + if (localizationCode == L"uk") + return L"ukrainian.xml"; + if (localizationCode == L"ur" || localizationCode == L"ur-pk") + return L"urdu.xml"; + if (localizationCode == L"ug-cn") + return L"uyghur.xml"; + if (localizationCode == L"uz") + return L"uzbek.xml"; + if (localizationCode == L"uz-cyrl-uz") + return L"uzbekCyrillic.xml"; + if (localizationCode == L"vec") + return L"venetian.xml"; + if (localizationCode == L"vi" || localizationCode == L"vi-vn") + return L"vietnamese.xml"; + if (localizationCode == L"cy-gb") + return L"welsh.xml"; + if (localizationCode == L"zu" || localizationCode == L"zu-za") + return L"zulu.xml"; + if (localizationCode == L"ne" || localizationCode == L"nep") + return L"nepali.xml"; + if (localizationCode == L"oc-aranes") + return L"aranese.xml"; + if (localizationCode == L"exy") + return L"extremaduran.xml"; + if (localizationCode == L"keb") + return L"kabyle.xml"; + if (localizationCode == L"lij") + return L"ligurian.xml"; + if (localizationCode == L"ga") + return L"irish.xml"; + if (localizationCode == L"sgs") + return L"samogitian.xml"; + if (localizationCode == L"yue") + return L"hongKongCantonese.xml"; + if (localizationCode == L"ab" || localizationCode == L"abk") + return L"abkhazian.xml"; return std::wstring(); } @@ -4705,38 +4705,38 @@ std::wstring NppParameters::getLocPathFromStr(const std::wstring & localizationC void NppParameters::feedKeyWordsParameters(TiXmlNode *node) { - TiXmlNode *langRoot = node->FirstChildElement(TEXT("Languages")); + TiXmlNode *langRoot = node->FirstChildElement(L"Languages"); if (!langRoot) return; - for (TiXmlNode *langNode = langRoot->FirstChildElement(TEXT("Language")); + for (TiXmlNode *langNode = langRoot->FirstChildElement(L"Language"); langNode ; - langNode = langNode->NextSibling(TEXT("Language")) ) + langNode = langNode->NextSibling(L"Language") ) { if (_nbLang < NB_LANG) { TiXmlElement* element = langNode->ToElement(); - const TCHAR* name = element->Attribute(TEXT("name")); + const wchar_t* name = element->Attribute(L"name"); if (name) { _langList[_nbLang] = new Lang(getLangIDFromStr(name), name); - _langList[_nbLang]->setDefaultExtList(element->Attribute(TEXT("ext"))); - _langList[_nbLang]->setCommentLineSymbol(element->Attribute(TEXT("commentLine"))); - _langList[_nbLang]->setCommentStart(element->Attribute(TEXT("commentStart"))); - _langList[_nbLang]->setCommentEnd(element->Attribute(TEXT("commentEnd"))); + _langList[_nbLang]->setDefaultExtList(element->Attribute(L"ext")); + _langList[_nbLang]->setCommentLineSymbol(element->Attribute(L"commentLine")); + _langList[_nbLang]->setCommentStart(element->Attribute(L"commentStart")); + _langList[_nbLang]->setCommentEnd(element->Attribute(L"commentEnd")); int tabSettings; - const TCHAR* tsVal = element->Attribute(TEXT("tabSettings"), &tabSettings); - const TCHAR* buVal = element->Attribute(TEXT("backspaceUnindent")); - _langList[_nbLang]->setTabInfo(tsVal ? tabSettings : -1, buVal && !lstrcmp(buVal, TEXT("yes"))); + const wchar_t* tsVal = element->Attribute(L"tabSettings", &tabSettings); + const wchar_t* buVal = element->Attribute(L"backspaceUnindent"); + _langList[_nbLang]->setTabInfo(tsVal ? tabSettings : -1, buVal && !lstrcmp(buVal, L"yes")); - for (TiXmlNode *kwNode = langNode->FirstChildElement(TEXT("Keywords")); + for (TiXmlNode *kwNode = langNode->FirstChildElement(L"Keywords"); kwNode ; - kwNode = kwNode->NextSibling(TEXT("Keywords")) ) + kwNode = kwNode->NextSibling(L"Keywords") ) { - const TCHAR *indexName = (kwNode->ToElement())->Attribute(TEXT("name")); + const wchar_t *indexName = (kwNode->ToElement())->Attribute(L"name"); TiXmlNode *kwVal = kwNode->FirstChild(); - const TCHAR *keyWords = TEXT(""); + const wchar_t *keyWords = L""; if ((indexName) && (kwVal)) keyWords = kwVal->Value(); @@ -4757,39 +4757,39 @@ typedef DWORD (WINAPI * EESFUNC) (LPCTSTR, LPTSTR, DWORD); void NppParameters::feedGUIParameters(TiXmlNode *node) { - TiXmlNode *GUIRoot = node->FirstChildElement(TEXT("GUIConfigs")); + TiXmlNode *GUIRoot = node->FirstChildElement(L"GUIConfigs"); if (nullptr == GUIRoot) return; - for (TiXmlNode *childNode = GUIRoot->FirstChildElement(TEXT("GUIConfig")); + for (TiXmlNode *childNode = GUIRoot->FirstChildElement(L"GUIConfig"); childNode ; - childNode = childNode->NextSibling(TEXT("GUIConfig")) ) + childNode = childNode->NextSibling(L"GUIConfig") ) { TiXmlElement* element = childNode->ToElement(); - const TCHAR* nm = element->Attribute(TEXT("name")); + const wchar_t* nm = element->Attribute(L"name"); if (nullptr == nm) continue; - auto parseYesNoBoolAttribute = [&element](const TCHAR* name, bool defaultValue = false) -> bool { - const TCHAR* val = element->Attribute(name); + auto parseYesNoBoolAttribute = [&element](const wchar_t* name, bool defaultValue = false) -> bool { + const wchar_t* val = element->Attribute(name); if (val != nullptr) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) return true; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) return false; } return defaultValue; }; - if (!lstrcmp(nm, TEXT("ToolBar"))) + if (!lstrcmp(nm, L"ToolBar")) { - const TCHAR* val = element->Attribute(TEXT("visible")); + const wchar_t* val = element->Attribute(L"visible"); if (val) { - if (!lstrcmp(val, TEXT("no"))) + if (!lstrcmp(val, L"no")) _nppGUI._toolbarShow = false; - else// if (!lstrcmp(val, TEXT("yes"))) + else// if (!lstrcmp(val, L"yes")) _nppGUI._toolbarShow = true; } TiXmlNode *n = childNode->FirstChild(); @@ -4798,168 +4798,168 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) val = n->Value(); if (val) { - if (!lstrcmp(val, TEXT("small"))) + if (!lstrcmp(val, L"small")) _nppGUI._toolBarStatus = TB_SMALL; - else if (!lstrcmp(val, TEXT("large"))) + else if (!lstrcmp(val, L"large")) _nppGUI._toolBarStatus = TB_LARGE; - else if (!lstrcmp(val, TEXT("small2"))) + else if (!lstrcmp(val, L"small2")) _nppGUI._toolBarStatus = TB_SMALL2; - else if (!lstrcmp(val, TEXT("large2"))) + else if (!lstrcmp(val, L"large2")) _nppGUI._toolBarStatus = TB_LARGE2; - else //if (!lstrcmp(val, TEXT("standard"))) + else //if (!lstrcmp(val, L"standard")) _nppGUI._toolBarStatus = TB_STANDARD; } } } - else if (!lstrcmp(nm, TEXT("StatusBar"))) + else if (!lstrcmp(nm, L"StatusBar")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (!lstrcmp(val, TEXT("hide"))) + if (!lstrcmp(val, L"hide")) _nppGUI._statusBarShow = false; - else if (!lstrcmp(val, TEXT("show"))) + else if (!lstrcmp(val, L"show")) _nppGUI._statusBarShow = true; } } } - else if (!lstrcmp(nm, TEXT("MenuBar"))) + else if (!lstrcmp(nm, L"MenuBar")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (!lstrcmp(val, TEXT("hide"))) + if (!lstrcmp(val, L"hide")) _nppGUI._menuBarShow = false; - else if (!lstrcmp(val, TEXT("show"))) + else if (!lstrcmp(val, L"show")) _nppGUI._menuBarShow = true; } } } - else if (!lstrcmp(nm, TEXT("TabBar"))) + else if (!lstrcmp(nm, L"TabBar")) { bool isFailed = false; int oldValue = _nppGUI._tabStatus; - const TCHAR* val = element->Attribute(TEXT("dragAndDrop")); + const wchar_t* val = element->Attribute(L"dragAndDrop"); if (val) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) _nppGUI._tabStatus = TAB_DRAGNDROP; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._tabStatus = 0; else isFailed = true; } - val = element->Attribute(TEXT("drawTopBar")); + val = element->Attribute(L"drawTopBar"); if (val) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) _nppGUI._tabStatus |= TAB_DRAWTOPBAR; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._tabStatus |= 0; else isFailed = true; } - val = element->Attribute(TEXT("drawInactiveTab")); + val = element->Attribute(L"drawInactiveTab"); if (val) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) _nppGUI._tabStatus |= TAB_DRAWINACTIVETAB; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._tabStatus |= 0; else isFailed = true; } - val = element->Attribute(TEXT("reduce")); + val = element->Attribute(L"reduce"); if (val) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) _nppGUI._tabStatus |= TAB_REDUCE; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._tabStatus |= 0; else isFailed = true; } - val = element->Attribute(TEXT("closeButton")); + val = element->Attribute(L"closeButton"); if (val) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) _nppGUI._tabStatus |= TAB_CLOSEBUTTON; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._tabStatus |= 0; else isFailed = true; } - val = element->Attribute(TEXT("doubleClick2Close")); + val = element->Attribute(L"doubleClick2Close"); if (val) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) _nppGUI._tabStatus |= TAB_DBCLK2CLOSE; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._tabStatus |= 0; else isFailed = true; } - val = element->Attribute(TEXT("vertical")); + val = element->Attribute(L"vertical"); if (val) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) _nppGUI._tabStatus |= TAB_VERTICAL; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._tabStatus |= 0; else isFailed = true; } - val = element->Attribute(TEXT("multiLine")); + val = element->Attribute(L"multiLine"); if (val) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) _nppGUI._tabStatus |= TAB_MULTILINE; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._tabStatus |= 0; else isFailed = true; } - val = element->Attribute(TEXT("hide")); + val = element->Attribute(L"hide"); if (val) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) _nppGUI._tabStatus |= TAB_HIDE; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._tabStatus |= 0; else isFailed = true; } - val = element->Attribute(TEXT("quitOnEmpty")); + val = element->Attribute(L"quitOnEmpty"); if (val) { - if (!lstrcmp(val, TEXT("yes"))) + if (!lstrcmp(val, L"yes")) _nppGUI._tabStatus |= TAB_QUITONEMPTY; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._tabStatus |= 0; else isFailed = true; } - val = element->Attribute(TEXT("iconSetNumber")); + val = element->Attribute(L"iconSetNumber"); if (val) { - if (!lstrcmp(val, TEXT("1"))) + if (!lstrcmp(val, L"1")) _nppGUI._tabStatus |= TAB_ALTICONS; - else if (!lstrcmp(val, TEXT("0"))) + else if (!lstrcmp(val, L"0")) _nppGUI._tabStatus |= 0; else isFailed = true; @@ -4968,118 +4968,118 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) if (isFailed) _nppGUI._tabStatus = oldValue; } - else if (!lstrcmp(nm, TEXT("Auto-detection"))) + else if (!lstrcmp(nm, L"Auto-detection")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (!lstrcmp(val, TEXT("yesOld"))) + if (!lstrcmp(val, L"yesOld")) _nppGUI._fileAutoDetection = cdEnabledOld; - else if (!lstrcmp(val, TEXT("autoOld"))) + else if (!lstrcmp(val, L"autoOld")) _nppGUI._fileAutoDetection = (cdEnabledOld | cdAutoUpdate); - else if (!lstrcmp(val, TEXT("Update2EndOld"))) + else if (!lstrcmp(val, L"Update2EndOld")) _nppGUI._fileAutoDetection = (cdEnabledOld | cdGo2end); - else if (!lstrcmp(val, TEXT("autoUpdate2EndOld"))) + else if (!lstrcmp(val, L"autoUpdate2EndOld")) _nppGUI._fileAutoDetection = (cdEnabledOld | cdAutoUpdate | cdGo2end); - else if (!lstrcmp(val, TEXT("yes"))) + else if (!lstrcmp(val, L"yes")) _nppGUI._fileAutoDetection = cdEnabledNew; - else if (!lstrcmp(val, TEXT("auto"))) + else if (!lstrcmp(val, L"auto")) _nppGUI._fileAutoDetection = (cdEnabledNew | cdAutoUpdate); - else if (!lstrcmp(val, TEXT("Update2End"))) + else if (!lstrcmp(val, L"Update2End")) _nppGUI._fileAutoDetection = (cdEnabledNew | cdGo2end); - else if (!lstrcmp(val, TEXT("autoUpdate2End"))) + else if (!lstrcmp(val, L"autoUpdate2End")) _nppGUI._fileAutoDetection = (cdEnabledNew | cdAutoUpdate | cdGo2end); - else //(!lstrcmp(val, TEXT("no"))) + else //(!lstrcmp(val, L"no")) _nppGUI._fileAutoDetection = cdDisabled; } } } - else if (!lstrcmp(nm, TEXT("TrayIcon"))) + else if (!lstrcmp(nm, L"TrayIcon")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - _nppGUI._isMinimizedToTray = (lstrcmp(val, TEXT("yes")) == 0); + _nppGUI._isMinimizedToTray = (lstrcmp(val, L"yes") == 0); } } } - else if (!lstrcmp(nm, TEXT("RememberLastSession"))) + else if (!lstrcmp(nm, L"RememberLastSession")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._rememberLastSession = true; else _nppGUI._rememberLastSession = false; } } } - else if (!lstrcmp(nm, TEXT("KeepSessionAbsentFileEntries"))) + else if (!lstrcmp(nm, L"KeepSessionAbsentFileEntries")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._keepSessionAbsentFileEntries = true; else _nppGUI._keepSessionAbsentFileEntries = false; } } } - else if (!lstrcmp(nm, TEXT("DetectEncoding"))) + else if (!lstrcmp(nm, L"DetectEncoding")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._detectEncoding = true; else _nppGUI._detectEncoding = false; } } } - else if (!lstrcmp(nm, TEXT("SaveAllConfirm"))) + else if (!lstrcmp(nm, L"SaveAllConfirm")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._saveAllConfirm = true; else _nppGUI._saveAllConfirm = false; } } } - else if (lstrcmp(nm, TEXT("MaintainIndent")) == 0 || - lstrcmp(nm, TEXT("MaitainIndent")) == 0) // typo - kept for the compatibility reason + else if (lstrcmp(nm, L"MaintainIndent") == 0 || + lstrcmp(nm, L"MaitainIndent") == 0) // typo - kept for the compatibility reason { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._maintainIndent = true; else _nppGUI._maintainIndent = false; @@ -5087,129 +5087,129 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) } } // - else if (!lstrcmp(nm, TEXT("MarkAll"))) + else if (!lstrcmp(nm, L"MarkAll")) { - const TCHAR* val = element->Attribute(TEXT("matchCase")); + const wchar_t* val = element->Attribute(L"matchCase"); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._markAllCaseSensitive = true; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._markAllCaseSensitive = false; } - val = element->Attribute(TEXT("wholeWordOnly")); + val = element->Attribute(L"wholeWordOnly"); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._markAllWordOnly = true; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._markAllWordOnly = false; } } // yes - else if (!lstrcmp(nm, TEXT("SmartHighLight"))) + else if (!lstrcmp(nm, L"SmartHighLight")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._enableSmartHilite = true; else _nppGUI._enableSmartHilite = false; } - val = element->Attribute(TEXT("matchCase")); + val = element->Attribute(L"matchCase"); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._smartHiliteCaseSensitive = true; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._smartHiliteCaseSensitive = false; } - val = element->Attribute(TEXT("wholeWordOnly")); + val = element->Attribute(L"wholeWordOnly"); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._smartHiliteWordOnly = true; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._smartHiliteWordOnly = false; } - val = element->Attribute(TEXT("useFindSettings")); + val = element->Attribute(L"useFindSettings"); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._smartHiliteUseFindSettings = true; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._smartHiliteUseFindSettings = false; } - val = element->Attribute(TEXT("onAnotherView")); + val = element->Attribute(L"onAnotherView"); if (val) { - if (lstrcmp(val, TEXT("yes")) == 0) + if (lstrcmp(val, L"yes") == 0) _nppGUI._smartHiliteOnAnotherView = true; - else if (!lstrcmp(val, TEXT("no"))) + else if (!lstrcmp(val, L"no")) _nppGUI._smartHiliteOnAnotherView = false; } } } - else if (!lstrcmp(nm, TEXT("TagsMatchHighLight"))) + else if (!lstrcmp(nm, L"TagsMatchHighLight")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - _nppGUI._enableTagsMatchHilite = !lstrcmp(val, TEXT("yes")); - const TCHAR *tahl = element->Attribute(TEXT("TagAttrHighLight")); + _nppGUI._enableTagsMatchHilite = !lstrcmp(val, L"yes"); + const wchar_t *tahl = element->Attribute(L"TagAttrHighLight"); if (tahl) - _nppGUI._enableTagAttrsHilite = !lstrcmp(tahl, TEXT("yes")); + _nppGUI._enableTagAttrsHilite = !lstrcmp(tahl, L"yes"); - tahl = element->Attribute(TEXT("HighLightNonHtmlZone")); + tahl = element->Attribute(L"HighLightNonHtmlZone"); if (tahl) - _nppGUI._enableHiliteNonHTMLZone = !lstrcmp(tahl, TEXT("yes")); + _nppGUI._enableHiliteNonHTMLZone = !lstrcmp(tahl, L"yes"); } } } - else if (!lstrcmp(nm, TEXT("TaskList"))) + else if (!lstrcmp(nm, L"TaskList")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - _nppGUI._doTaskList = (!lstrcmp(val, TEXT("yes")))?true:false; + _nppGUI._doTaskList = (!lstrcmp(val, L"yes"))?true:false; } } } - else if (!lstrcmp(nm, TEXT("MRU"))) + else if (!lstrcmp(nm, L"MRU")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) - _nppGUI._styleMRU = (!lstrcmp(val, TEXT("yes"))); + _nppGUI._styleMRU = (!lstrcmp(val, L"yes")); } } - else if (!lstrcmp(nm, TEXT("URL"))) + else if (!lstrcmp(nm, L"URL")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { int const i = _wtoi (val); @@ -5219,50 +5219,50 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) } } - else if (!lstrcmp(nm, TEXT("uriCustomizedSchemes"))) + else if (!lstrcmp(nm, L"uriCustomizedSchemes")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) _nppGUI._uriSchemes = val; } } - else if (!lstrcmp(nm, TEXT("CheckHistoryFiles"))) + else if (!lstrcmp(nm, L"CheckHistoryFiles")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (!lstrcmp(val, TEXT("no"))) + if (!lstrcmp(val, L"no")) _nppGUI._checkHistoryFiles = false; - else if (!lstrcmp(val, TEXT("yes"))) + else if (!lstrcmp(val, L"yes")) _nppGUI._checkHistoryFiles = true; } } } - else if (!lstrcmp(nm, TEXT("ScintillaViewsSplitter"))) + else if (!lstrcmp(nm, L"ScintillaViewsSplitter")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (!lstrcmp(val, TEXT("vertical"))) + if (!lstrcmp(val, L"vertical")) _nppGUI._splitterPos = POS_VERTICAL; - else if (!lstrcmp(val, TEXT("horizontal"))) + else if (!lstrcmp(val, L"horizontal")) _nppGUI._splitterPos = POS_HORIZOTAL; } } } - else if (!lstrcmp(nm, TEXT("UserDefineDlg"))) + else if (!lstrcmp(nm, L"UserDefineDlg")) { bool isFailed = false; int oldValue = _nppGUI._userDefineDlgStatus; @@ -5270,24 +5270,24 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) { - if (!lstrcmp(val, TEXT("hide"))) + if (!lstrcmp(val, L"hide")) _nppGUI._userDefineDlgStatus = 0; - else if (!lstrcmp(val, TEXT("show"))) + else if (!lstrcmp(val, L"show")) _nppGUI._userDefineDlgStatus = UDD_SHOW; else isFailed = true; } } - const TCHAR* val = element->Attribute(TEXT("position")); + const wchar_t* val = element->Attribute(L"position"); if (val) { - if (!lstrcmp(val, TEXT("docked"))) + if (!lstrcmp(val, L"docked")) _nppGUI._userDefineDlgStatus |= UDD_DOCKED; - else if (!lstrcmp(val, TEXT("undocked"))) + else if (!lstrcmp(val, L"undocked")) _nppGUI._userDefineDlgStatus |= 0; else isFailed = true; @@ -5296,56 +5296,56 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) _nppGUI._userDefineDlgStatus = oldValue; } - else if (!lstrcmp(nm, TEXT("TabSetting"))) + else if (!lstrcmp(nm, L"TabSetting")) { int i; - const TCHAR* val = element->Attribute(TEXT("size"), &i); + const wchar_t* val = element->Attribute(L"size", &i); if (val) _nppGUI._tabSize = i; if ((_nppGUI._tabSize == -1) || (_nppGUI._tabSize == 0)) _nppGUI._tabSize = 4; - val = element->Attribute(TEXT("replaceBySpace")); + val = element->Attribute(L"replaceBySpace"); if (val) - _nppGUI._tabReplacedBySpace = (!lstrcmp(val, TEXT("yes"))); + _nppGUI._tabReplacedBySpace = (!lstrcmp(val, L"yes")); - val = element->Attribute(TEXT("backspaceUnindent")); + val = element->Attribute(L"backspaceUnindent"); if (val) - _nppGUI._backspaceUnindent = (!lstrcmp(val, TEXT("yes"))); + _nppGUI._backspaceUnindent = (!lstrcmp(val, L"yes")); } - else if (!lstrcmp(nm, TEXT("Caret"))) + else if (!lstrcmp(nm, L"Caret")) { int i; - const TCHAR* val = element->Attribute(TEXT("width"), &i); + const wchar_t* val = element->Attribute(L"width", &i); if (val) _nppGUI._caretWidth = i; - val = element->Attribute(TEXT("blinkRate"), &i); + val = element->Attribute(L"blinkRate", &i); if (val) _nppGUI._caretBlinkRate = i; } - else if (!lstrcmp(nm, TEXT("AppPosition"))) + else if (!lstrcmp(nm, L"AppPosition")) { RECT oldRect = _nppGUI._appPos; bool fuckUp = true; int i; - if (element->Attribute(TEXT("x"), &i)) + if (element->Attribute(L"x", &i)) { _nppGUI._appPos.left = i; - if (element->Attribute(TEXT("y"), &i)) + if (element->Attribute(L"y", &i)) { _nppGUI._appPos.top = i; - if (element->Attribute(TEXT("width"), &i)) + if (element->Attribute(L"width", &i)) { _nppGUI._appPos.right = i; - if (element->Attribute(TEXT("height"), &i)) + if (element->Attribute(L"height", &i)) { _nppGUI._appPos.bottom = i; fuckUp = false; @@ -5356,30 +5356,30 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) if (fuckUp) _nppGUI._appPos = oldRect; - const TCHAR* val = element->Attribute(TEXT("isMaximized")); + const wchar_t* val = element->Attribute(L"isMaximized"); if (val) - _nppGUI._isMaximized = (lstrcmp(val, TEXT("yes")) == 0); + _nppGUI._isMaximized = (lstrcmp(val, L"yes") == 0); } - else if (!lstrcmp(nm, TEXT("FindWindowPosition"))) + else if (!lstrcmp(nm, L"FindWindowPosition")) { RECT oldRect = _nppGUI._findWindowPos; bool incomplete = true; int i; - if (element->Attribute(TEXT("left"), &i)) + if (element->Attribute(L"left", &i)) { _nppGUI._findWindowPos.left = i; - if (element->Attribute(TEXT("top"), &i)) + if (element->Attribute(L"top", &i)) { _nppGUI._findWindowPos.top = i; - if (element->Attribute(TEXT("right"), &i)) + if (element->Attribute(L"right", &i)) { _nppGUI._findWindowPos.right = i; - if (element->Attribute(TEXT("bottom"), &i)) + if (element->Attribute(L"bottom", &i)) { _nppGUI._findWindowPos.bottom = i; incomplete = false; @@ -5392,36 +5392,36 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) _nppGUI._findWindowPos = oldRect; } - const TCHAR* val = element->Attribute(TEXT("isLessModeOn")); + const wchar_t* val = element->Attribute(L"isLessModeOn"); if (val) - _nppGUI._findWindowLessMode = (lstrcmp(val, TEXT("yes")) == 0); + _nppGUI._findWindowLessMode = (lstrcmp(val, L"yes") == 0); } - else if (!lstrcmp(nm, TEXT("FinderConfig"))) + else if (!lstrcmp(nm, L"FinderConfig")) { - const TCHAR* val = element->Attribute(TEXT("wrappedLines")); + const wchar_t* val = element->Attribute(L"wrappedLines"); if (val) { - _nppGUI._finderLinesAreCurrentlyWrapped = (!lstrcmp(val, TEXT("yes"))); + _nppGUI._finderLinesAreCurrentlyWrapped = (!lstrcmp(val, L"yes")); } - val = element->Attribute(TEXT("purgeBeforeEverySearch")); + val = element->Attribute(L"purgeBeforeEverySearch"); if (val) { - _nppGUI._finderPurgeBeforeEverySearch = (!lstrcmp(val, TEXT("yes"))); + _nppGUI._finderPurgeBeforeEverySearch = (!lstrcmp(val, L"yes")); } - val = element->Attribute(TEXT("showOnlyOneEntryPerFoundLine")); + val = element->Attribute(L"showOnlyOneEntryPerFoundLine"); if (val) { - _nppGUI._finderShowOnlyOneEntryPerFoundLine = (!lstrcmp(val, TEXT("yes"))); + _nppGUI._finderShowOnlyOneEntryPerFoundLine = (!lstrcmp(val, L"yes")); } } - else if (!lstrcmp(nm, TEXT("NewDocDefaultSettings"))) + else if (!lstrcmp(nm, L"NewDocDefaultSettings")) { int i; - if (element->Attribute(TEXT("format"), &i)) + if (element->Attribute(L"format", &i)) { EolType newFormat = EolType::osdefault; switch (i) @@ -5441,25 +5441,25 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) _nppGUI._newDocDefaultSettings._format = newFormat; } - if (element->Attribute(TEXT("encoding"), &i)) + if (element->Attribute(L"encoding", &i)) _nppGUI._newDocDefaultSettings._unicodeMode = (UniMode)i; - if (element->Attribute(TEXT("lang"), &i)) + if (element->Attribute(L"lang", &i)) _nppGUI._newDocDefaultSettings._lang = (LangType)i; - if (element->Attribute(TEXT("codepage"), &i)) + if (element->Attribute(L"codepage", &i)) _nppGUI._newDocDefaultSettings._codepage = (LangType)i; - const TCHAR* val = element->Attribute(TEXT("openAnsiAsUTF8")); + const wchar_t* val = element->Attribute(L"openAnsiAsUTF8"); if (val) - _nppGUI._newDocDefaultSettings._openAnsiAsUtf8 = (lstrcmp(val, TEXT("yes")) == 0); + _nppGUI._newDocDefaultSettings._openAnsiAsUtf8 = (lstrcmp(val, L"yes") == 0); - val = element->Attribute(TEXT("addNewDocumentOnStartup")); + val = element->Attribute(L"addNewDocumentOnStartup"); if (val) - _nppGUI._newDocDefaultSettings._addNewDocumentOnStartup = (lstrcmp(val, TEXT("yes")) == 0); + _nppGUI._newDocDefaultSettings._addNewDocumentOnStartup = (lstrcmp(val, L"yes") == 0); } - else if (!lstrcmp(nm, TEXT("langsExcluded"))) + else if (!lstrcmp(nm, L"langsExcluded")) { // TODO int g0 = 0; // up to 8 @@ -5479,67 +5479,67 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) // TODO some refactoring needed here.... { int i; - if (element->Attribute(TEXT("gr0"), &i)) + if (element->Attribute(L"gr0", &i)) { if (i <= 255) g0 = i; } - if (element->Attribute(TEXT("gr1"), &i)) + if (element->Attribute(L"gr1", &i)) { if (i <= 255) g1 = i; } - if (element->Attribute(TEXT("gr2"), &i)) + if (element->Attribute(L"gr2", &i)) { if (i <= 255) g2 = i; } - if (element->Attribute(TEXT("gr3"), &i)) + if (element->Attribute(L"gr3", &i)) { if (i <= 255) g3 = i; } - if (element->Attribute(TEXT("gr4"), &i)) + if (element->Attribute(L"gr4", &i)) { if (i <= 255) g4 = i; } - if (element->Attribute(TEXT("gr5"), &i)) + if (element->Attribute(L"gr5", &i)) { if (i <= 255) g5 = i; } - if (element->Attribute(TEXT("gr6"), &i)) + if (element->Attribute(L"gr6", &i)) { if (i <= 255) g6 = i; } - if (element->Attribute(TEXT("gr7"), &i)) + if (element->Attribute(L"gr7", &i)) { if (i <= 255) g7 = i; } - if (element->Attribute(TEXT("gr8"), &i)) + if (element->Attribute(L"gr8", &i)) { if (i <= 255) g8 = i; } - if (element->Attribute(TEXT("gr9"), &i)) + if (element->Attribute(L"gr9", &i)) { if (i <= 255) g9 = i; } - if (element->Attribute(TEXT("gr10"), &i)) + if (element->Attribute(L"gr10", &i)) { if (i <= 255) g10 = i; } - if (element->Attribute(TEXT("gr11"), &i)) + if (element->Attribute(L"gr11", &i)) { if (i <= 255) g11 = i; } - if (element->Attribute(TEXT("gr12"), &i)) + if (element->Attribute(L"gr12", &i)) { if (i <= 255) g12 = i; @@ -5650,213 +5650,213 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) mask <<= 1; } - const TCHAR* val = element->Attribute(TEXT("langMenuCompact")); + const wchar_t* val = element->Attribute(L"langMenuCompact"); if (val) - _nppGUI._isLangMenuCompact = (!lstrcmp(val, TEXT("yes"))); + _nppGUI._isLangMenuCompact = (!lstrcmp(val, L"yes")); } - else if (!lstrcmp(nm, TEXT("Print"))) + else if (!lstrcmp(nm, L"Print")) { - const TCHAR* val = element->Attribute(TEXT("lineNumber")); + const wchar_t* val = element->Attribute(L"lineNumber"); if (val) - _nppGUI._printSettings._printLineNumber = (!lstrcmp(val, TEXT("yes"))); + _nppGUI._printSettings._printLineNumber = (!lstrcmp(val, L"yes")); int i; - if (element->Attribute(TEXT("printOption"), &i)) + if (element->Attribute(L"printOption", &i)) _nppGUI._printSettings._printOption = i; - val = element->Attribute(TEXT("headerLeft")); + val = element->Attribute(L"headerLeft"); if (val) _nppGUI._printSettings._headerLeft = val; - val = element->Attribute(TEXT("headerMiddle")); + val = element->Attribute(L"headerMiddle"); if (val) _nppGUI._printSettings._headerMiddle = val; - val = element->Attribute(TEXT("headerRight")); + val = element->Attribute(L"headerRight"); if (val) _nppGUI._printSettings._headerRight = val; - val = element->Attribute(TEXT("footerLeft")); + val = element->Attribute(L"footerLeft"); if (val) _nppGUI._printSettings._footerLeft = val; - val = element->Attribute(TEXT("footerMiddle")); + val = element->Attribute(L"footerMiddle"); if (val) _nppGUI._printSettings._footerMiddle = val; - val = element->Attribute(TEXT("footerRight")); + val = element->Attribute(L"footerRight"); if (val) _nppGUI._printSettings._footerRight = val; - val = element->Attribute(TEXT("headerFontName")); + val = element->Attribute(L"headerFontName"); if (val) _nppGUI._printSettings._headerFontName = val; - val = element->Attribute(TEXT("footerFontName")); + val = element->Attribute(L"footerFontName"); if (val) _nppGUI._printSettings._footerFontName = val; - if (element->Attribute(TEXT("headerFontStyle"), &i)) + if (element->Attribute(L"headerFontStyle", &i)) _nppGUI._printSettings._headerFontStyle = i; - if (element->Attribute(TEXT("footerFontStyle"), &i)) + if (element->Attribute(L"footerFontStyle", &i)) _nppGUI._printSettings._footerFontStyle = i; - if (element->Attribute(TEXT("headerFontSize"), &i)) + if (element->Attribute(L"headerFontSize", &i)) _nppGUI._printSettings._headerFontSize = i; - if (element->Attribute(TEXT("footerFontSize"), &i)) + if (element->Attribute(L"footerFontSize", &i)) _nppGUI._printSettings._footerFontSize = i; - if (element->Attribute(TEXT("margeLeft"), &i)) + if (element->Attribute(L"margeLeft", &i)) _nppGUI._printSettings._marge.left = i; - if (element->Attribute(TEXT("margeTop"), &i)) + if (element->Attribute(L"margeTop", &i)) _nppGUI._printSettings._marge.top = i; - if (element->Attribute(TEXT("margeRight"), &i)) + if (element->Attribute(L"margeRight", &i)) _nppGUI._printSettings._marge.right = i; - if (element->Attribute(TEXT("margeBottom"), &i)) + if (element->Attribute(L"margeBottom", &i)) _nppGUI._printSettings._marge.bottom = i; } - else if (!lstrcmp(nm, TEXT("ScintillaPrimaryView"))) + else if (!lstrcmp(nm, L"ScintillaPrimaryView")) { feedScintillaParam(element); } - else if (!lstrcmp(nm, TEXT("Backup"))) + else if (!lstrcmp(nm, L"Backup")) { int i; - if (element->Attribute(TEXT("action"), &i)) + if (element->Attribute(L"action", &i)) _nppGUI._backup = (BackupFeature)i; - const TCHAR *bDir = element->Attribute(TEXT("useCustumDir")); + const wchar_t *bDir = element->Attribute(L"useCustumDir"); if (bDir) { - _nppGUI._useDir = (lstrcmp(bDir, TEXT("yes")) == 0); + _nppGUI._useDir = (lstrcmp(bDir, L"yes") == 0); } - const TCHAR *pDir = element->Attribute(TEXT("dir")); + const wchar_t *pDir = element->Attribute(L"dir"); if (pDir) _nppGUI._backupDir = pDir; - const TCHAR *isSnapshotModeStr = element->Attribute(TEXT("isSnapshotMode")); - if (isSnapshotModeStr && !lstrcmp(isSnapshotModeStr, TEXT("no"))) + const wchar_t *isSnapshotModeStr = element->Attribute(L"isSnapshotMode"); + if (isSnapshotModeStr && !lstrcmp(isSnapshotModeStr, L"no")) _nppGUI._isSnapshotMode = false; int timing; - if (element->Attribute(TEXT("snapshotBackupTiming"), &timing)) + if (element->Attribute(L"snapshotBackupTiming", &timing)) _nppGUI._snapshotBackupTiming = timing; } - else if (!lstrcmp(nm, TEXT("DockingManager"))) + else if (!lstrcmp(nm, L"DockingManager")) { feedDockingManager(element); } - else if (!lstrcmp(nm, TEXT("globalOverride"))) + else if (!lstrcmp(nm, L"globalOverride")) { - const TCHAR *bDir = element->Attribute(TEXT("fg")); + const wchar_t *bDir = element->Attribute(L"fg"); if (bDir) - _nppGUI._globalOverride.enableFg = (lstrcmp(bDir, TEXT("yes")) == 0); + _nppGUI._globalOverride.enableFg = (lstrcmp(bDir, L"yes") == 0); - bDir = element->Attribute(TEXT("bg")); + bDir = element->Attribute(L"bg"); if (bDir) - _nppGUI._globalOverride.enableBg = (lstrcmp(bDir, TEXT("yes")) == 0); + _nppGUI._globalOverride.enableBg = (lstrcmp(bDir, L"yes") == 0); - bDir = element->Attribute(TEXT("font")); + bDir = element->Attribute(L"font"); if (bDir) - _nppGUI._globalOverride.enableFont = (lstrcmp(bDir, TEXT("yes")) == 0); + _nppGUI._globalOverride.enableFont = (lstrcmp(bDir, L"yes") == 0); - bDir = element->Attribute(TEXT("fontSize")); + bDir = element->Attribute(L"fontSize"); if (bDir) - _nppGUI._globalOverride.enableFontSize = (lstrcmp(bDir, TEXT("yes")) == 0); + _nppGUI._globalOverride.enableFontSize = (lstrcmp(bDir, L"yes") == 0); - bDir = element->Attribute(TEXT("bold")); + bDir = element->Attribute(L"bold"); if (bDir) - _nppGUI._globalOverride.enableBold = (lstrcmp(bDir, TEXT("yes")) == 0); + _nppGUI._globalOverride.enableBold = (lstrcmp(bDir, L"yes") == 0); - bDir = element->Attribute(TEXT("italic")); + bDir = element->Attribute(L"italic"); if (bDir) - _nppGUI._globalOverride.enableItalic = (lstrcmp(bDir, TEXT("yes")) == 0); + _nppGUI._globalOverride.enableItalic = (lstrcmp(bDir, L"yes") == 0); - bDir = element->Attribute(TEXT("underline")); + bDir = element->Attribute(L"underline"); if (bDir) - _nppGUI._globalOverride.enableUnderLine = (lstrcmp(bDir, TEXT("yes")) == 0); + _nppGUI._globalOverride.enableUnderLine = (lstrcmp(bDir, L"yes") == 0); } - else if (!lstrcmp(nm, TEXT("auto-completion"))) + else if (!lstrcmp(nm, L"auto-completion")) { int i; - if (element->Attribute(TEXT("autoCAction"), &i)) + if (element->Attribute(L"autoCAction", &i)) _nppGUI._autocStatus = static_cast(i); - if (element->Attribute(TEXT("triggerFromNbChar"), &i)) + if (element->Attribute(L"triggerFromNbChar", &i)) _nppGUI._autocFromLen = i; - const TCHAR * optName = element->Attribute(TEXT("autoCIgnoreNumbers")); + const wchar_t * optName = element->Attribute(L"autoCIgnoreNumbers"); if (optName) - _nppGUI._autocIgnoreNumbers = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._autocIgnoreNumbers = (lstrcmp(optName, L"yes") == 0); - optName = element->Attribute(TEXT("insertSelectedItemUseENTER")); + optName = element->Attribute(L"insertSelectedItemUseENTER"); if (optName) - _nppGUI._autocInsertSelectedUseENTER = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._autocInsertSelectedUseENTER = (lstrcmp(optName, L"yes") == 0); - optName = element->Attribute(TEXT("insertSelectedItemUseTAB")); + optName = element->Attribute(L"insertSelectedItemUseTAB"); if (optName) - _nppGUI._autocInsertSelectedUseTAB = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._autocInsertSelectedUseTAB = (lstrcmp(optName, L"yes") == 0); - optName = element->Attribute(TEXT("autoCBrief")); + optName = element->Attribute(L"autoCBrief"); if (optName) - _nppGUI._autocBrief = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._autocBrief = (lstrcmp(optName, L"yes") == 0); - optName = element->Attribute(TEXT("funcParams")); + optName = element->Attribute(L"funcParams"); if (optName) - _nppGUI._funcParams = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._funcParams = (lstrcmp(optName, L"yes") == 0); } - else if (!lstrcmp(nm, TEXT("auto-insert"))) + else if (!lstrcmp(nm, L"auto-insert")) { - const TCHAR * optName = element->Attribute(TEXT("htmlXmlTag")); + const wchar_t * optName = element->Attribute(L"htmlXmlTag"); if (optName) - _nppGUI._matchedPairConf._doHtmlXmlTag = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._matchedPairConf._doHtmlXmlTag = (lstrcmp(optName, L"yes") == 0); - optName = element->Attribute(TEXT("parentheses")); + optName = element->Attribute(L"parentheses"); if (optName) - _nppGUI._matchedPairConf._doParentheses = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._matchedPairConf._doParentheses = (lstrcmp(optName, L"yes") == 0); - optName = element->Attribute(TEXT("brackets")); + optName = element->Attribute(L"brackets"); if (optName) - _nppGUI._matchedPairConf._doBrackets = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._matchedPairConf._doBrackets = (lstrcmp(optName, L"yes") == 0); - optName = element->Attribute(TEXT("curlyBrackets")); + optName = element->Attribute(L"curlyBrackets"); if (optName) - _nppGUI._matchedPairConf._doCurlyBrackets = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._matchedPairConf._doCurlyBrackets = (lstrcmp(optName, L"yes") == 0); - optName = element->Attribute(TEXT("quotes")); + optName = element->Attribute(L"quotes"); if (optName) - _nppGUI._matchedPairConf._doQuotes = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._matchedPairConf._doQuotes = (lstrcmp(optName, L"yes") == 0); - optName = element->Attribute(TEXT("doubleQuotes")); + optName = element->Attribute(L"doubleQuotes"); if (optName) - _nppGUI._matchedPairConf._doDoubleQuotes = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._matchedPairConf._doDoubleQuotes = (lstrcmp(optName, L"yes") == 0); - for (TiXmlNode *subChildNode = childNode->FirstChildElement(TEXT("UserDefinePair")); + for (TiXmlNode *subChildNode = childNode->FirstChildElement(L"UserDefinePair"); subChildNode; - subChildNode = subChildNode->NextSibling(TEXT("UserDefinePair")) ) + subChildNode = subChildNode->NextSibling(L"UserDefinePair") ) { int open = -1; int openVal = 0; - const TCHAR *openValStr = (subChildNode->ToElement())->Attribute(TEXT("open"), &openVal); + const wchar_t *openValStr = (subChildNode->ToElement())->Attribute(L"open", &openVal); if (openValStr && (openVal >= 0 && openVal < 128)) open = openVal; int close = -1; int closeVal = 0; - const TCHAR *closeValStr = (subChildNode->ToElement())->Attribute(TEXT("close"), &closeVal); + const wchar_t *closeValStr = (subChildNode->ToElement())->Attribute(L"close", &closeVal); if (closeValStr && (closeVal >= 0 && closeVal <= 128)) close = closeVal; @@ -5865,252 +5865,252 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) } } - else if (!lstrcmp(nm, TEXT("sessionExt"))) + else if (!lstrcmp(nm, L"sessionExt")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) _nppGUI._definedSessionExt = val; } } - else if (!lstrcmp(nm, TEXT("workspaceExt"))) + else if (!lstrcmp(nm, L"workspaceExt")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) _nppGUI._definedWorkspaceExt = val; } } - else if (!lstrcmp(nm, TEXT("noUpdate"))) + else if (!lstrcmp(nm, L"noUpdate")) { TiXmlNode *n = childNode->FirstChild(); if (n) { - const TCHAR* val = n->Value(); + const wchar_t* val = n->Value(); if (val) - _nppGUI._autoUpdateOpt._doAutoUpdate = (!lstrcmp(val, TEXT("yes")))?false:true; + _nppGUI._autoUpdateOpt._doAutoUpdate = (!lstrcmp(val, L"yes"))?false:true; int i; - val = element->Attribute(TEXT("intervalDays"), &i); + val = element->Attribute(L"intervalDays", &i); if (val) _nppGUI._autoUpdateOpt._intervalDays = i; - val = element->Attribute(TEXT("nextUpdateDate")); + val = element->Attribute(L"nextUpdateDate"); if (val) _nppGUI._autoUpdateOpt._nextUpdateDate = Date(val); } } - else if (!lstrcmp(nm, TEXT("openSaveDir"))) + else if (!lstrcmp(nm, L"openSaveDir")) { - const TCHAR * value = element->Attribute(TEXT("value")); + const wchar_t * value = element->Attribute(L"value"); if (value && value[0]) { - if (lstrcmp(value, TEXT("1")) == 0) + if (lstrcmp(value, L"1") == 0) _nppGUI._openSaveDir = dir_last; - else if (lstrcmp(value, TEXT("2")) == 0) + else if (lstrcmp(value, L"2") == 0) _nppGUI._openSaveDir = dir_userDef; else _nppGUI._openSaveDir = dir_followCurrent; } - const TCHAR * path = element->Attribute(TEXT("defaultDirPath")); + const wchar_t * path = element->Attribute(L"defaultDirPath"); if (path && path[0]) { lstrcpyn(_nppGUI._defaultDir, path, MAX_PATH); ::ExpandEnvironmentStrings(_nppGUI._defaultDir, _nppGUI._defaultDirExp, MAX_PATH); } - path = element->Attribute(TEXT("lastUsedDirPath")); + path = element->Attribute(L"lastUsedDirPath"); if (path && path[0]) { lstrcpyn(_nppGUI._lastUsedDir, path, MAX_PATH); } } - else if (!lstrcmp(nm, TEXT("titleBar"))) + else if (!lstrcmp(nm, L"titleBar")) { - const TCHAR * value = element->Attribute(TEXT("short")); + const wchar_t * value = element->Attribute(L"short"); _nppGUI._shortTitlebar = false; //default state if (value && value[0]) { - if (lstrcmp(value, TEXT("yes")) == 0) + if (lstrcmp(value, L"yes") == 0) _nppGUI._shortTitlebar = true; - else if (lstrcmp(value, TEXT("no")) == 0) + else if (lstrcmp(value, L"no") == 0) _nppGUI._shortTitlebar = false; } } - else if (!lstrcmp(nm, TEXT("insertDateTime"))) + else if (!lstrcmp(nm, L"insertDateTime")) { - const TCHAR* customFormat = element->Attribute(TEXT("customizedFormat")); + const wchar_t* customFormat = element->Attribute(L"customizedFormat"); if (customFormat != NULL && customFormat[0]) _nppGUI._dateTimeFormat = customFormat; - const TCHAR* value = element->Attribute(TEXT("reverseDefaultOrder")); + const wchar_t* value = element->Attribute(L"reverseDefaultOrder"); if (value && value[0]) { - if (lstrcmp(value, TEXT("yes")) == 0) + if (lstrcmp(value, L"yes") == 0) _nppGUI._dateTimeReverseDefaultOrder = true; - else if (lstrcmp(value, TEXT("no")) == 0) + else if (lstrcmp(value, L"no") == 0) _nppGUI._dateTimeReverseDefaultOrder = false; } } - else if (!lstrcmp(nm, TEXT("wordCharList"))) + else if (!lstrcmp(nm, L"wordCharList")) { - const TCHAR * value = element->Attribute(TEXT("useDefault")); + const wchar_t * value = element->Attribute(L"useDefault"); if (value && value[0]) { - if (lstrcmp(value, TEXT("yes")) == 0) + if (lstrcmp(value, L"yes") == 0) _nppGUI._isWordCharDefault = true; - else if (lstrcmp(value, TEXT("no")) == 0) + else if (lstrcmp(value, L"no") == 0) _nppGUI._isWordCharDefault = false; } - const TCHAR *charsAddedW = element->Attribute(TEXT("charsAdded")); + const wchar_t *charsAddedW = element->Attribute(L"charsAdded"); if (charsAddedW) { WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance(); _nppGUI._customWordChars = wmc.wchar2char(charsAddedW, SC_CP_UTF8); } } - else if (!lstrcmp(nm, TEXT("delimiterSelection"))) + else if (!lstrcmp(nm, L"delimiterSelection")) { int leftmost = 0; - element->Attribute(TEXT("leftmostDelimiter"), &leftmost); + element->Attribute(L"leftmostDelimiter", &leftmost); if (leftmost > 0 && leftmost < 256) _nppGUI._leftmostDelimiter = static_cast(leftmost); int rightmost = 0; - element->Attribute(TEXT("rightmostDelimiter"), &rightmost); + element->Attribute(L"rightmostDelimiter", &rightmost); if (rightmost > 0 && rightmost < 256) _nppGUI._rightmostDelimiter = static_cast(rightmost); - const TCHAR *delimiterSelectionOnEntireDocument = element->Attribute(TEXT("delimiterSelectionOnEntireDocument")); - if (delimiterSelectionOnEntireDocument != NULL && !lstrcmp(delimiterSelectionOnEntireDocument, TEXT("yes"))) + const wchar_t *delimiterSelectionOnEntireDocument = element->Attribute(L"delimiterSelectionOnEntireDocument"); + if (delimiterSelectionOnEntireDocument != NULL && !lstrcmp(delimiterSelectionOnEntireDocument, L"yes")) _nppGUI._delimiterSelectionOnEntireDocument = true; else _nppGUI._delimiterSelectionOnEntireDocument = false; } - else if (!lstrcmp(nm, TEXT("largeFileRestriction"))) + else if (!lstrcmp(nm, L"largeFileRestriction")) { int fileSizeLimit4StylingMB = 0; - element->Attribute(TEXT("fileSizeMB"), &fileSizeLimit4StylingMB); + element->Attribute(L"fileSizeMB", &fileSizeLimit4StylingMB); if (fileSizeLimit4StylingMB > 0 && fileSizeLimit4StylingMB <= 4096) _nppGUI._largeFileRestriction._largeFileSizeDefInByte = (static_cast(fileSizeLimit4StylingMB) * 1024 * 1024); - const TCHAR* boolVal = element->Attribute(TEXT("isEnabled")); - if (boolVal != NULL && !lstrcmp(boolVal, TEXT("no"))) + const wchar_t* boolVal = element->Attribute(L"isEnabled"); + if (boolVal != NULL && !lstrcmp(boolVal, L"no")) _nppGUI._largeFileRestriction._isEnabled = false; else _nppGUI._largeFileRestriction._isEnabled = true; - boolVal = element->Attribute(TEXT("allowAutoCompletion")); - if (boolVal != NULL && !lstrcmp(boolVal, TEXT("yes"))) + boolVal = element->Attribute(L"allowAutoCompletion"); + if (boolVal != NULL && !lstrcmp(boolVal, L"yes")) _nppGUI._largeFileRestriction._allowAutoCompletion = true; else _nppGUI._largeFileRestriction._allowAutoCompletion = false; - boolVal = element->Attribute(TEXT("allowBraceMatch")); - if (boolVal != NULL && !lstrcmp(boolVal, TEXT("yes"))) + boolVal = element->Attribute(L"allowBraceMatch"); + if (boolVal != NULL && !lstrcmp(boolVal, L"yes")) _nppGUI._largeFileRestriction._allowBraceMatch = true; else _nppGUI._largeFileRestriction._allowBraceMatch = false; - boolVal = element->Attribute(TEXT("allowSmartHilite")); - if (boolVal != NULL && !lstrcmp(boolVal, TEXT("yes"))) + boolVal = element->Attribute(L"allowSmartHilite"); + if (boolVal != NULL && !lstrcmp(boolVal, L"yes")) _nppGUI._largeFileRestriction._allowSmartHilite = true; else _nppGUI._largeFileRestriction._allowSmartHilite = false; - boolVal = element->Attribute(TEXT("allowClickableLink")); - if (boolVal != NULL && !lstrcmp(boolVal, TEXT("yes"))) + boolVal = element->Attribute(L"allowClickableLink"); + if (boolVal != NULL && !lstrcmp(boolVal, L"yes")) _nppGUI._largeFileRestriction._allowClickableLink = true; else _nppGUI._largeFileRestriction._allowClickableLink = false; - boolVal = element->Attribute(TEXT("deactivateWordWrap")); - if (boolVal != NULL && !lstrcmp(boolVal, TEXT("no"))) + boolVal = element->Attribute(L"deactivateWordWrap"); + if (boolVal != NULL && !lstrcmp(boolVal, L"no")) _nppGUI._largeFileRestriction._deactivateWordWrap = false; else _nppGUI._largeFileRestriction._deactivateWordWrap = true; - boolVal = element->Attribute(TEXT("suppress2GBWarning")); - if (boolVal != NULL && !lstrcmp(boolVal, TEXT("yes"))) + boolVal = element->Attribute(L"suppress2GBWarning"); + if (boolVal != NULL && !lstrcmp(boolVal, L"yes")) _nppGUI._largeFileRestriction._suppress2GBWarning = true; else _nppGUI._largeFileRestriction._suppress2GBWarning = false; } - else if (!lstrcmp(nm, TEXT("multiInst"))) + else if (!lstrcmp(nm, L"multiInst")) { int val = 0; - element->Attribute(TEXT("setting"), &val); + element->Attribute(L"setting", &val); if (val < 0 || val > 2) val = 0; _nppGUI._multiInstSetting = (MultiInstSetting)val; - _nppGUI._clipboardHistoryPanelKeepState = parseYesNoBoolAttribute(TEXT("clipboardHistory")); - _nppGUI._docListKeepState = parseYesNoBoolAttribute(TEXT("documentList")); - _nppGUI._charPanelKeepState = parseYesNoBoolAttribute(TEXT("characterPanel")); - _nppGUI._fileBrowserKeepState = parseYesNoBoolAttribute(TEXT("folderAsWorkspace")); - _nppGUI._projectPanelKeepState = parseYesNoBoolAttribute(TEXT("projectPanels")); - _nppGUI._docMapKeepState = parseYesNoBoolAttribute(TEXT("documentMap")); - _nppGUI._funcListKeepState = parseYesNoBoolAttribute(TEXT("fuctionList")); - _nppGUI._pluginPanelKeepState = parseYesNoBoolAttribute(TEXT("pluginPanels")); + _nppGUI._clipboardHistoryPanelKeepState = parseYesNoBoolAttribute(L"clipboardHistory"); + _nppGUI._docListKeepState = parseYesNoBoolAttribute(L"documentList"); + _nppGUI._charPanelKeepState = parseYesNoBoolAttribute(L"characterPanel"); + _nppGUI._fileBrowserKeepState = parseYesNoBoolAttribute(L"folderAsWorkspace"); + _nppGUI._projectPanelKeepState = parseYesNoBoolAttribute(L"projectPanels"); + _nppGUI._docMapKeepState = parseYesNoBoolAttribute(L"documentMap"); + _nppGUI._funcListKeepState = parseYesNoBoolAttribute(L"fuctionList"); + _nppGUI._pluginPanelKeepState = parseYesNoBoolAttribute(L"pluginPanels"); } - else if (!lstrcmp(nm, TEXT("searchEngine"))) + else if (!lstrcmp(nm, L"searchEngine")) { int i; - if (element->Attribute(TEXT("searchEngineChoice"), &i)) + if (element->Attribute(L"searchEngineChoice", &i)) _nppGUI._searchEngineChoice = static_cast(i); - const TCHAR * searchEngineCustom = element->Attribute(TEXT("searchEngineCustom")); + const wchar_t * searchEngineCustom = element->Attribute(L"searchEngineCustom"); if (searchEngineCustom && searchEngineCustom[0]) _nppGUI._searchEngineCustom = searchEngineCustom; } - else if (!lstrcmp(nm, TEXT("Searching"))) + else if (!lstrcmp(nm, L"Searching")) { - const TCHAR* optNameMonoFont = element->Attribute(TEXT("monospacedFontFindDlg")); + const wchar_t* optNameMonoFont = element->Attribute(L"monospacedFontFindDlg"); if (optNameMonoFont) - _nppGUI._monospacedFontFindDlg = (lstrcmp(optNameMonoFont, TEXT("yes")) == 0); + _nppGUI._monospacedFontFindDlg = (lstrcmp(optNameMonoFont, L"yes") == 0); //This is an option from previous versions of notepad++. It is handled for compatibility with older settings. - const TCHAR* optStopFillingFindField = element->Attribute(TEXT("stopFillingFindField")); + const wchar_t* optStopFillingFindField = element->Attribute(L"stopFillingFindField"); if (optStopFillingFindField) { - _nppGUI._fillFindFieldWithSelected = (lstrcmp(optStopFillingFindField, TEXT("no")) == 0); + _nppGUI._fillFindFieldWithSelected = (lstrcmp(optStopFillingFindField, L"no") == 0); _nppGUI._fillFindFieldSelectCaret = _nppGUI._fillFindFieldWithSelected; } - const TCHAR* optFillFindFieldWithSelected = element->Attribute(TEXT("fillFindFieldWithSelected")); + const wchar_t* optFillFindFieldWithSelected = element->Attribute(L"fillFindFieldWithSelected"); if (optFillFindFieldWithSelected) - _nppGUI._fillFindFieldWithSelected = (lstrcmp(optFillFindFieldWithSelected, TEXT("yes")) == 0); + _nppGUI._fillFindFieldWithSelected = (lstrcmp(optFillFindFieldWithSelected, L"yes") == 0); - const TCHAR* optFillFindFieldSelectCaret = element->Attribute(TEXT("fillFindFieldSelectCaret")); + const wchar_t* optFillFindFieldSelectCaret = element->Attribute(L"fillFindFieldSelectCaret"); if (optFillFindFieldSelectCaret) - _nppGUI._fillFindFieldSelectCaret = (lstrcmp(optFillFindFieldSelectCaret, TEXT("yes")) == 0); + _nppGUI._fillFindFieldSelectCaret = (lstrcmp(optFillFindFieldSelectCaret, L"yes") == 0); - const TCHAR* optFindDlgAlwaysVisible = element->Attribute(TEXT("findDlgAlwaysVisible")); + const wchar_t* optFindDlgAlwaysVisible = element->Attribute(L"findDlgAlwaysVisible"); if (optFindDlgAlwaysVisible) - _nppGUI._findDlgAlwaysVisible = (lstrcmp(optFindDlgAlwaysVisible, TEXT("yes")) == 0); + _nppGUI._findDlgAlwaysVisible = (lstrcmp(optFindDlgAlwaysVisible, L"yes") == 0); - const TCHAR* optConfirmReplaceOpenDocs = element->Attribute(TEXT("confirmReplaceInAllOpenDocs")); + const wchar_t* optConfirmReplaceOpenDocs = element->Attribute(L"confirmReplaceInAllOpenDocs"); if (optConfirmReplaceOpenDocs) - _nppGUI._confirmReplaceInAllOpenDocs = (lstrcmp(optConfirmReplaceOpenDocs, TEXT("yes")) == 0); + _nppGUI._confirmReplaceInAllOpenDocs = (lstrcmp(optConfirmReplaceOpenDocs, L"yes") == 0); - const TCHAR* optReplaceStopsWithoutFindingNext = element->Attribute(TEXT("replaceStopsWithoutFindingNext")); + const wchar_t* optReplaceStopsWithoutFindingNext = element->Attribute(L"replaceStopsWithoutFindingNext"); if (optReplaceStopsWithoutFindingNext) - _nppGUI._replaceStopsWithoutFindingNext = (lstrcmp(optReplaceStopsWithoutFindingNext, TEXT("yes")) == 0); + _nppGUI._replaceStopsWithoutFindingNext = (lstrcmp(optReplaceStopsWithoutFindingNext, L"yes") == 0); int inSelThresh; - if (element->Attribute(TEXT("inSelectionAutocheckThreshold"), &inSelThresh) && + if (element->Attribute(L"inSelectionAutocheckThreshold", &inSelThresh) && (inSelThresh >= 0 && inSelThresh <= FINDREPLACE_INSELECTION_THRESHOLD_DEFAULT)) { _nppGUI._inSelectionAutocheckThreshold = inSelThresh; @@ -6120,139 +6120,139 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) _nppGUI._inSelectionAutocheckThreshold = FINDREPLACE_INSELECTION_THRESHOLD_DEFAULT; } } - else if (!lstrcmp(nm, TEXT("MISC"))) + else if (!lstrcmp(nm, L"MISC")) { - const TCHAR * optName = element->Attribute(TEXT("fileSwitcherWithoutExtColumn")); + const wchar_t * optName = element->Attribute(L"fileSwitcherWithoutExtColumn"); if (optName) - _nppGUI._fileSwitcherWithoutExtColumn = (lstrcmp(optName, TEXT("yes")) == 0); + _nppGUI._fileSwitcherWithoutExtColumn = (lstrcmp(optName, L"yes") == 0); int i = 0; - if (element->Attribute(TEXT("fileSwitcherExtWidth"), &i)) + if (element->Attribute(L"fileSwitcherExtWidth", &i)) _nppGUI._fileSwitcherExtWidth = i; - const TCHAR * optNamePath = element->Attribute(TEXT("fileSwitcherWithoutPathColumn")); + const wchar_t * optNamePath = element->Attribute(L"fileSwitcherWithoutPathColumn"); if (optNamePath) - _nppGUI._fileSwitcherWithoutPathColumn = (lstrcmp(optNamePath, TEXT("yes")) == 0); + _nppGUI._fileSwitcherWithoutPathColumn = (lstrcmp(optNamePath, L"yes") == 0); - if (element->Attribute(TEXT("fileSwitcherPathWidth"), &i)) + if (element->Attribute(L"fileSwitcherPathWidth", &i)) _nppGUI._fileSwitcherPathWidth = i; - _nppGUI._fileSwitcherDisableListViewGroups = parseYesNoBoolAttribute(TEXT("fileSwitcherNoGroups")); + _nppGUI._fileSwitcherDisableListViewGroups = parseYesNoBoolAttribute(L"fileSwitcherNoGroups"); - const TCHAR * optNameBackSlashEscape = element->Attribute(TEXT("backSlashIsEscapeCharacterForSql")); - if (optNameBackSlashEscape && !lstrcmp(optNameBackSlashEscape, TEXT("no"))) + const wchar_t * optNameBackSlashEscape = element->Attribute(L"backSlashIsEscapeCharacterForSql"); + if (optNameBackSlashEscape && !lstrcmp(optNameBackSlashEscape, L"no")) _nppGUI._backSlashIsEscapeCharacterForSql = false; - const TCHAR * optNameWriteTechnologyEngine = element->Attribute(TEXT("writeTechnologyEngine")); + const wchar_t * optNameWriteTechnologyEngine = element->Attribute(L"writeTechnologyEngine"); if (optNameWriteTechnologyEngine) - _nppGUI._writeTechnologyEngine = (lstrcmp(optNameWriteTechnologyEngine, TEXT("1")) == 0) ? directWriteTechnology : defaultTechnology; + _nppGUI._writeTechnologyEngine = (lstrcmp(optNameWriteTechnologyEngine, L"1") == 0) ? directWriteTechnology : defaultTechnology; - const TCHAR * optNameFolderDroppedOpenFiles = element->Attribute(TEXT("isFolderDroppedOpenFiles")); + const wchar_t * optNameFolderDroppedOpenFiles = element->Attribute(L"isFolderDroppedOpenFiles"); if (optNameFolderDroppedOpenFiles) - _nppGUI._isFolderDroppedOpenFiles = (lstrcmp(optNameFolderDroppedOpenFiles, TEXT("yes")) == 0); + _nppGUI._isFolderDroppedOpenFiles = (lstrcmp(optNameFolderDroppedOpenFiles, L"yes") == 0); - const TCHAR * optDocPeekOnTab = element->Attribute(TEXT("docPeekOnTab")); + const wchar_t * optDocPeekOnTab = element->Attribute(L"docPeekOnTab"); if (optDocPeekOnTab) - _nppGUI._isDocPeekOnTab = (lstrcmp(optDocPeekOnTab, TEXT("yes")) == 0); + _nppGUI._isDocPeekOnTab = (lstrcmp(optDocPeekOnTab, L"yes") == 0); - const TCHAR * optDocPeekOnMap = element->Attribute(TEXT("docPeekOnMap")); + const wchar_t * optDocPeekOnMap = element->Attribute(L"docPeekOnMap"); if (optDocPeekOnMap) - _nppGUI._isDocPeekOnMap = (lstrcmp(optDocPeekOnMap, TEXT("yes")) == 0); + _nppGUI._isDocPeekOnMap = (lstrcmp(optDocPeekOnMap, L"yes") == 0); - const TCHAR* optSortFunctionList = element->Attribute(TEXT("sortFunctionList")); + const wchar_t* optSortFunctionList = element->Attribute(L"sortFunctionList"); if (optSortFunctionList) - _nppGUI._shouldSortFunctionList = (lstrcmp(optSortFunctionList, TEXT("yes")) == 0); + _nppGUI._shouldSortFunctionList = (lstrcmp(optSortFunctionList, L"yes") == 0); - const TCHAR* saveDlgExtFilterToAllTypes = element->Attribute(TEXT("saveDlgExtFilterToAllTypes")); + const wchar_t* saveDlgExtFilterToAllTypes = element->Attribute(L"saveDlgExtFilterToAllTypes"); if (saveDlgExtFilterToAllTypes) - _nppGUI._setSaveDlgExtFiltToAllTypes = (lstrcmp(saveDlgExtFilterToAllTypes, TEXT("yes")) == 0); + _nppGUI._setSaveDlgExtFiltToAllTypes = (lstrcmp(saveDlgExtFilterToAllTypes, L"yes") == 0); - const TCHAR * optMuteSounds = element->Attribute(TEXT("muteSounds")); + const wchar_t * optMuteSounds = element->Attribute(L"muteSounds"); if (optMuteSounds) - _nppGUI._muteSounds = lstrcmp(optMuteSounds, TEXT("yes")) == 0; + _nppGUI._muteSounds = lstrcmp(optMuteSounds, L"yes") == 0; - const TCHAR * optEnableFoldCmdToggable = element->Attribute(TEXT("enableFoldCmdToggable")); + const wchar_t * optEnableFoldCmdToggable = element->Attribute(L"enableFoldCmdToggable"); if (optEnableFoldCmdToggable) - _nppGUI._enableFoldCmdToggable = lstrcmp(optEnableFoldCmdToggable, TEXT("yes")) == 0; + _nppGUI._enableFoldCmdToggable = lstrcmp(optEnableFoldCmdToggable, L"yes") == 0; - const TCHAR * hideMenuRightShortcuts = element->Attribute(TEXT("hideMenuRightShortcuts")); + const wchar_t * hideMenuRightShortcuts = element->Attribute(L"hideMenuRightShortcuts"); if (hideMenuRightShortcuts) - _nppGUI._hideMenuRightShortcuts = lstrcmp(hideMenuRightShortcuts, TEXT("yes")) == 0; + _nppGUI._hideMenuRightShortcuts = lstrcmp(hideMenuRightShortcuts, L"yes") == 0; } - else if (!lstrcmp(nm, TEXT("commandLineInterpreter"))) + else if (!lstrcmp(nm, L"commandLineInterpreter")) { TiXmlNode *node = childNode->FirstChild(); if (node) { - const TCHAR *cli = node->Value(); + const wchar_t *cli = node->Value(); if (cli && cli[0]) _nppGUI._commandLineInterpreter.assign(cli); } } - else if (!lstrcmp(nm, TEXT("DarkMode"))) + else if (!lstrcmp(nm, L"DarkMode")) { - _nppGUI._darkmode._isEnabled = parseYesNoBoolAttribute(TEXT("enable")); + _nppGUI._darkmode._isEnabled = parseYesNoBoolAttribute(L"enable"); - //_nppGUI._darkmode._isEnabledPlugin = parseYesNoBoolAttribute(TEXT("enablePlugin", true)); + //_nppGUI._darkmode._isEnabledPlugin = parseYesNoBoolAttribute(L"enablePlugin", true)); int i; - const TCHAR* val; - val = element->Attribute(TEXT("colorTone"), &i); + const wchar_t* val; + val = element->Attribute(L"colorTone", &i); if (val) _nppGUI._darkmode._colorTone = static_cast(i); - val = element->Attribute(TEXT("customColorTop"), &i); + val = element->Attribute(L"customColorTop", &i); if (val) _nppGUI._darkmode._customColors.pureBackground = i; - val = element->Attribute(TEXT("customColorMenuHotTrack"), &i); + val = element->Attribute(L"customColorMenuHotTrack", &i); if (val) _nppGUI._darkmode._customColors.hotBackground = i; - val = element->Attribute(TEXT("customColorActive"), &i); + val = element->Attribute(L"customColorActive", &i); if (val) _nppGUI._darkmode._customColors.softerBackground = i; - val = element->Attribute(TEXT("customColorMain"), &i); + val = element->Attribute(L"customColorMain", &i); if (val) _nppGUI._darkmode._customColors.background = i; - val = element->Attribute(TEXT("customColorError"), &i); + val = element->Attribute(L"customColorError", &i); if (val) _nppGUI._darkmode._customColors.errorBackground = i; - val = element->Attribute(TEXT("customColorText"), &i); + val = element->Attribute(L"customColorText", &i); if (val) _nppGUI._darkmode._customColors.text = i; - val = element->Attribute(TEXT("customColorDarkText"), &i); + val = element->Attribute(L"customColorDarkText", &i); if (val) _nppGUI._darkmode._customColors.darkerText = i; - val = element->Attribute(TEXT("customColorDisabledText"), &i); + val = element->Attribute(L"customColorDisabledText", &i); if (val) _nppGUI._darkmode._customColors.disabledText = i; - val = element->Attribute(TEXT("customColorLinkText"), &i); + val = element->Attribute(L"customColorLinkText", &i); if (val) _nppGUI._darkmode._customColors.linkText = i; - val = element->Attribute(TEXT("customColorEdge"), &i); + val = element->Attribute(L"customColorEdge", &i); if (val) _nppGUI._darkmode._customColors.edge = i; - val = element->Attribute(TEXT("customColorHotEdge"), &i); + val = element->Attribute(L"customColorHotEdge", &i); if (val) _nppGUI._darkmode._customColors.hotEdge = i; - val = element->Attribute(TEXT("customColorDisabledEdge"), &i); + val = element->Attribute(L"customColorDisabledEdge", &i); if (val) _nppGUI._darkmode._customColors.disabledEdge = i; // advanced options section - auto parseStringAttribute = [&element](const TCHAR* name, const TCHAR* defaultName = TEXT("")) -> const TCHAR* { - const TCHAR* val = element->Attribute(name); + auto parseStringAttribute = [&element](const wchar_t* name, const wchar_t* defaultName = L"") -> const wchar_t* { + const wchar_t* val = element->Attribute(name); if (val != nullptr && val[0]) { return element->Attribute(name); @@ -6260,9 +6260,9 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) return defaultName; }; - auto parseToolBarIconsAttribute = [&element](const TCHAR* name, int defaultValue = -1) -> int { + auto parseToolBarIconsAttribute = [&element](const wchar_t* name, int defaultValue = -1) -> int { int val; - const TCHAR* valStr = element->Attribute(name, &val); + const wchar_t* valStr = element->Attribute(name, &val); if (valStr != nullptr && (val >= 0 && val <= 4)) { return val; @@ -6270,9 +6270,9 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) return defaultValue; }; - auto parseTabIconsAttribute = [&element](const TCHAR* name, int defaultValue = -1) -> int { + auto parseTabIconsAttribute = [&element](const wchar_t* name, int defaultValue = -1) -> int { int val; - const TCHAR* valStr = element->Attribute(name, &val); + const wchar_t* valStr = element->Attribute(name, &val); if (valStr != nullptr && (val >= 0 && val <= 2)) { return val; @@ -6281,21 +6281,21 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) }; auto& windowsMode = _nppGUI._darkmode._advOptions._enableWindowsMode; - windowsMode = parseYesNoBoolAttribute(TEXT("enableWindowsMode")); + windowsMode = parseYesNoBoolAttribute(L"enableWindowsMode"); auto& darkDefaults = _nppGUI._darkmode._advOptions._darkDefaults; auto& darkThemeName = darkDefaults._xmlFileName; - darkThemeName = parseStringAttribute(TEXT("darkThemeName"), TEXT("DarkModeDefault.xml")); - darkDefaults._toolBarIconSet = parseToolBarIconsAttribute(TEXT("darkToolBarIconSet"), 0); - darkDefaults._tabIconSet = parseTabIconsAttribute(TEXT("darkTabIconSet"), 2); - darkDefaults._tabUseTheme = parseYesNoBoolAttribute(TEXT("darkTabUseTheme")); + darkThemeName = parseStringAttribute(L"darkThemeName", L"DarkModeDefault.xml"); + darkDefaults._toolBarIconSet = parseToolBarIconsAttribute(L"darkToolBarIconSet", 0); + darkDefaults._tabIconSet = parseTabIconsAttribute(L"darkTabIconSet", 2); + darkDefaults._tabUseTheme = parseYesNoBoolAttribute(L"darkTabUseTheme"); auto& lightDefaults = _nppGUI._darkmode._advOptions._lightDefaults; auto& lightThemeName = lightDefaults._xmlFileName; - lightThemeName = parseStringAttribute(TEXT("lightThemeName")); - lightDefaults._toolBarIconSet = parseToolBarIconsAttribute(TEXT("lightToolBarIconSet"), 4); - lightDefaults._tabIconSet = parseTabIconsAttribute(TEXT("lightTabIconSet"), 0); - lightDefaults._tabUseTheme = parseYesNoBoolAttribute(TEXT("lightTabUseTheme"), true); + lightThemeName = parseStringAttribute(L"lightThemeName"); + lightDefaults._toolBarIconSet = parseToolBarIconsAttribute(L"lightToolBarIconSet", 4); + lightDefaults._tabIconSet = parseTabIconsAttribute(L"lightTabIconSet", 0); + lightDefaults._tabUseTheme = parseYesNoBoolAttribute(L"lightTabUseTheme", true); // Windows mode is handled later in Notepad_plus_Window::init from Notepad_plus_Window.cpp if (!windowsMode) @@ -6304,28 +6304,28 @@ void NppParameters::feedGUIParameters(TiXmlNode *node) std::wstring xmlFileName = _nppGUI._darkmode._isEnabled ? darkThemeName : lightThemeName; const bool isLocalOnly = _isLocal && !_isCloud; - if (!xmlFileName.empty() && lstrcmp(xmlFileName.c_str(), TEXT("stylers.xml")) != 0) + if (!xmlFileName.empty() && lstrcmp(xmlFileName.c_str(), L"stylers.xml") != 0) { themePath = isLocalOnly ? _nppPath : _userPath; - pathAppend(themePath, TEXT("themes\\")); + pathAppend(themePath, L"themes\\"); pathAppend(themePath, xmlFileName); if (!isLocalOnly && ::PathFileExists(themePath.c_str()) == FALSE) { themePath = _nppPath; - pathAppend(themePath, TEXT("themes\\")); + pathAppend(themePath, L"themes\\"); pathAppend(themePath, xmlFileName); } } else { themePath = isLocalOnly ? _nppPath : _userPath; - pathAppend(themePath, TEXT("stylers.xml")); + pathAppend(themePath, L"stylers.xml"); if (!isLocalOnly && ::PathFileExists(themePath.c_str()) == FALSE) { themePath = _nppPath; - pathAppend(themePath, TEXT("stylers.xml")); + pathAppend(themePath, L"stylers.xml"); } } @@ -6342,66 +6342,66 @@ void NppParameters::feedScintillaParam(TiXmlNode *node) { TiXmlElement* element = node->ToElement(); - auto parseYesNoBoolAttribute = [&element](const TCHAR* name, bool defaultValue = false) -> bool { - const TCHAR* nm = element->Attribute(name); + auto parseYesNoBoolAttribute = [&element](const wchar_t* name, bool defaultValue = false) -> bool { + const wchar_t* nm = element->Attribute(name); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) return true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) return false; } return defaultValue; }; - auto parseShowHideBoolAttribute = [&element](const TCHAR* name, bool defaultValue = false) -> bool { - const TCHAR* nm = element->Attribute(name); + auto parseShowHideBoolAttribute = [&element](const wchar_t* name, bool defaultValue = false) -> bool { + const wchar_t* nm = element->Attribute(name); if (nm) { - if (!lstrcmp(nm, TEXT("show"))) + if (!lstrcmp(nm, L"show")) return true; - else if (!lstrcmp(nm, TEXT("hide"))) + else if (!lstrcmp(nm, L"hide")) return false; } return defaultValue; }; // Line Number Margin - const TCHAR *nm = element->Attribute(TEXT("lineNumberMargin")); + const wchar_t *nm = element->Attribute(L"lineNumberMargin"); if (nm) { - if (!lstrcmp(nm, TEXT("show"))) + if (!lstrcmp(nm, L"show")) _svp._lineNumberMarginShow = true; - else if (!lstrcmp(nm, TEXT("hide"))) + else if (!lstrcmp(nm, L"hide")) _svp._lineNumberMarginShow = false; } // Line Number Margin dynamic width - nm = element->Attribute(TEXT("lineNumberDynamicWidth")); + nm = element->Attribute(L"lineNumberDynamicWidth"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._lineNumberMarginDynamicWidth = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._lineNumberMarginDynamicWidth = false; } // Bookmark Margin - nm = element->Attribute(TEXT("bookMarkMargin")); + nm = element->Attribute(L"bookMarkMargin"); if (nm) { - if (!lstrcmp(nm, TEXT("show"))) + if (!lstrcmp(nm, L"show")) _svp._bookMarkMarginShow = true; - else if (!lstrcmp(nm, TEXT("hide"))) + else if (!lstrcmp(nm, L"hide")) _svp._bookMarkMarginShow = false; } // Change History Margin int chState = 0; - nm = element->Attribute(TEXT("isChangeHistoryEnabled"), &chState); + nm = element->Attribute(L"isChangeHistoryEnabled", &chState); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) // for the retro-compatibility + if (!lstrcmp(nm, L"yes")) // for the retro-compatibility chState = 1; _svp._isChangeHistoryEnabled4NextSession = static_cast(chState); @@ -6431,60 +6431,60 @@ void NppParameters::feedScintillaParam(TiXmlNode *node) } // Indent GuideLine - nm = element->Attribute(TEXT("indentGuideLine")); + nm = element->Attribute(L"indentGuideLine"); if (nm) { - if (!lstrcmp(nm, TEXT("show"))) + if (!lstrcmp(nm, L"show")) _svp._indentGuideLineShow = true; - else if (!lstrcmp(nm, TEXT("hide"))) + else if (!lstrcmp(nm, L"hide")) _svp._indentGuideLineShow= false; } // Folder Mark Style - nm = element->Attribute(TEXT("folderMarkStyle")); + nm = element->Attribute(L"folderMarkStyle"); if (nm) { - if (!lstrcmp(nm, TEXT("box"))) + if (!lstrcmp(nm, L"box")) _svp._folderStyle = FOLDER_STYLE_BOX; - else if (!lstrcmp(nm, TEXT("circle"))) + else if (!lstrcmp(nm, L"circle")) _svp._folderStyle = FOLDER_STYLE_CIRCLE; - else if (!lstrcmp(nm, TEXT("arrow"))) + else if (!lstrcmp(nm, L"arrow")) _svp._folderStyle = FOLDER_STYLE_ARROW; - else if (!lstrcmp(nm, TEXT("simple"))) + else if (!lstrcmp(nm, L"simple")) _svp._folderStyle = FOLDER_STYLE_SIMPLE; - else if (!lstrcmp(nm, TEXT("none"))) + else if (!lstrcmp(nm, L"none")) _svp._folderStyle = FOLDER_STYLE_NONE; } // Line Wrap method - nm = element->Attribute(TEXT("lineWrapMethod")); + nm = element->Attribute(L"lineWrapMethod"); if (nm) { - if (!lstrcmp(nm, TEXT("default"))) + if (!lstrcmp(nm, L"default")) _svp._lineWrapMethod = LINEWRAP_DEFAULT; - else if (!lstrcmp(nm, TEXT("aligned"))) + else if (!lstrcmp(nm, L"aligned")) _svp._lineWrapMethod = LINEWRAP_ALIGNED; - else if (!lstrcmp(nm, TEXT("indent"))) + else if (!lstrcmp(nm, L"indent")) _svp._lineWrapMethod = LINEWRAP_INDENT; } // Current Line Highlighting State - nm = element->Attribute(TEXT("currentLineHilitingShow")); + nm = element->Attribute(L"currentLineHilitingShow"); if (nm) { - if (!lstrcmp(nm, TEXT("show"))) + if (!lstrcmp(nm, L"show")) _svp._currentLineHiliteMode = LINEHILITE_HILITE; else _svp._currentLineHiliteMode = LINEHILITE_NONE; } else { - const TCHAR* currentLineModeStr = element->Attribute(TEXT("currentLineIndicator")); + const wchar_t* currentLineModeStr = element->Attribute(L"currentLineIndicator"); if (currentLineModeStr && currentLineModeStr[0]) { - if (lstrcmp(currentLineModeStr, TEXT("1")) == 0) + if (lstrcmp(currentLineModeStr, L"1") == 0) _svp._currentLineHiliteMode = LINEHILITE_HILITE; - else if (lstrcmp(currentLineModeStr, TEXT("2")) == 0) + else if (lstrcmp(currentLineModeStr, L"2") == 0) _svp._currentLineHiliteMode = LINEHILITE_FRAME; else _svp._currentLineHiliteMode = LINEHILITE_NONE; @@ -6492,7 +6492,7 @@ void NppParameters::feedScintillaParam(TiXmlNode *node) } // Current Line Frame Width - nm = element->Attribute(TEXT("currentLineFrameWidth")); + nm = element->Attribute(L"currentLineFrameWidth"); if (nm) { unsigned char frameWidth{ 1 }; @@ -6508,125 +6508,125 @@ void NppParameters::feedScintillaParam(TiXmlNode *node) } // Virtual Space - nm = element->Attribute(TEXT("virtualSpace")); + nm = element->Attribute(L"virtualSpace"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._virtualSpace = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._virtualSpace = false; } // Scrolling Beyond Last Line State - nm = element->Attribute(TEXT("scrollBeyondLastLine")); + nm = element->Attribute(L"scrollBeyondLastLine"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._scrollBeyondLastLine = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._scrollBeyondLastLine = false; } // Do not change selection or caret position when right-clicking with mouse - nm = element->Attribute(TEXT("rightClickKeepsSelection")); + nm = element->Attribute(L"rightClickKeepsSelection"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._rightClickKeepsSelection = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._rightClickKeepsSelection = false; } // Disable Advanced Scrolling - nm = element->Attribute(TEXT("disableAdvancedScrolling")); + nm = element->Attribute(L"disableAdvancedScrolling"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._disableAdvancedScrolling = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._disableAdvancedScrolling = false; } // Current wrap symbol visibility State - nm = element->Attribute(TEXT("wrapSymbolShow")); + nm = element->Attribute(L"wrapSymbolShow"); if (nm) { - if (!lstrcmp(nm, TEXT("show"))) + if (!lstrcmp(nm, L"show")) _svp._wrapSymbolShow = true; - else if (!lstrcmp(nm, TEXT("hide"))) + else if (!lstrcmp(nm, L"hide")) _svp._wrapSymbolShow = false; } // Do Wrap - nm = element->Attribute(TEXT("Wrap")); + nm = element->Attribute(L"Wrap"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._doWrap = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._doWrap = false; } // Do Edge - nm = element->Attribute(TEXT("isEdgeBgMode")); + nm = element->Attribute(L"isEdgeBgMode"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._isEdgeBgMode = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._isEdgeBgMode = false; } // Do Scintilla border edge - nm = element->Attribute(TEXT("borderEdge")); + nm = element->Attribute(L"borderEdge"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._showBorderEdge = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._showBorderEdge = false; } - nm = element->Attribute(TEXT("edgeMultiColumnPos")); + nm = element->Attribute(L"edgeMultiColumnPos"); if (nm) { str2numberVector(nm, _svp._edgeMultiColumnPos); } int val; - nm = element->Attribute(TEXT("zoom"), &val); + nm = element->Attribute(L"zoom", &val); if (nm) { _svp._zoom = val; } - nm = element->Attribute(TEXT("zoom2"), &val); + nm = element->Attribute(L"zoom2", &val); if (nm) { _svp._zoom2 = val; } // White Space visibility State - nm = element->Attribute(TEXT("whiteSpaceShow")); + nm = element->Attribute(L"whiteSpaceShow"); if (nm) { - if (!lstrcmp(nm, TEXT("show"))) + if (!lstrcmp(nm, L"show")) _svp._whiteSpaceShow = true; - else if (!lstrcmp(nm, TEXT("hide"))) + else if (!lstrcmp(nm, L"hide")) _svp._whiteSpaceShow = false; } // EOL visibility State - nm = element->Attribute(TEXT("eolShow")); + nm = element->Attribute(L"eolShow"); if (nm) { - if (!lstrcmp(nm, TEXT("show"))) + if (!lstrcmp(nm, L"show")) _svp._eolShow = true; - else if (!lstrcmp(nm, TEXT("hide"))) + else if (!lstrcmp(nm, L"hide")) _svp._eolShow = false; } - nm = element->Attribute(TEXT("eolMode"), &val); + nm = element->Attribute(L"eolMode", &val); if (nm) { if (val >= 0 && val <= 3) @@ -6634,23 +6634,23 @@ void NppParameters::feedScintillaParam(TiXmlNode *node) } // Unicode control and ws characters visibility state - _svp._npcShow = parseShowHideBoolAttribute(TEXT("npcShow"), true); + _svp._npcShow = parseShowHideBoolAttribute(L"npcShow", true); - nm = element->Attribute(TEXT("npcMode"), &val); + nm = element->Attribute(L"npcMode", &val); if (nm) { if (val >= 1 && val <= 2) _svp._npcMode = static_cast(val); } - _svp._npcCustomColor = parseYesNoBoolAttribute(TEXT("npcCustomColor")); - _svp._npcIncludeCcUniEol = parseYesNoBoolAttribute(TEXT("npcIncludeCcUniEOL")); - _svp._npcNoInputC0 = parseYesNoBoolAttribute(TEXT("npcNoInputC0")); + _svp._npcCustomColor = parseYesNoBoolAttribute(L"npcCustomColor"); + _svp._npcIncludeCcUniEol = parseYesNoBoolAttribute(L"npcIncludeCcUniEOL"); + _svp._npcNoInputC0 = parseYesNoBoolAttribute(L"npcNoInputC0"); // C0, C1 control and Unicode EOL visibility state - _svp._ccUniEolShow = parseYesNoBoolAttribute(TEXT("ccShow"), true); + _svp._ccUniEolShow = parseYesNoBoolAttribute(L"ccShow", true); - nm = element->Attribute(TEXT("borderWidth"), &val); + nm = element->Attribute(L"borderWidth", &val); if (nm) { if (val >= 0 && val <= 30) @@ -6658,60 +6658,60 @@ void NppParameters::feedScintillaParam(TiXmlNode *node) } // Do antialiased font - nm = element->Attribute(TEXT("smoothFont")); + nm = element->Attribute(L"smoothFont"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._doSmoothFont = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._doSmoothFont = false; } - nm = element->Attribute(TEXT("paddingLeft"), &val); + nm = element->Attribute(L"paddingLeft", &val); if (nm) { if (val >= 0 && val <= 30) _svp._paddingLeft = static_cast(val); } - nm = element->Attribute(TEXT("paddingRight"), &val); + nm = element->Attribute(L"paddingRight", &val); if (nm) { if (val >= 0 && val <= 30) _svp._paddingRight = static_cast(val); } - nm = element->Attribute(TEXT("distractionFreeDivPart"), &val); + nm = element->Attribute(L"distractionFreeDivPart", &val); if (nm) { if (val >= 3 && val <= 9) _svp._distractionFreeDivPart = static_cast(val); } - nm = element->Attribute(TEXT("lineCopyCutWithoutSelection")); + nm = element->Attribute(L"lineCopyCutWithoutSelection"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._lineCopyCutWithoutSelection = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._lineCopyCutWithoutSelection = false; } - nm = element->Attribute(TEXT("multiSelection")); + nm = element->Attribute(L"multiSelection"); if (nm) { - if (!lstrcmp(nm, TEXT("yes"))) + if (!lstrcmp(nm, L"yes")) _svp._multiSelection = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._multiSelection = false; } - nm = element->Attribute(TEXT("columnSel2MultiEdit")); + nm = element->Attribute(L"columnSel2MultiEdit"); if (nm) { - if (!lstrcmp(nm, TEXT("yes")) && _svp._multiSelection) + if (!lstrcmp(nm, L"yes") && _svp._multiSelection) _svp._columnSel2MultiEdit = true; - else if (!lstrcmp(nm, TEXT("no"))) + else if (!lstrcmp(nm, L"no")) _svp._columnSel2MultiEdit = false; } } @@ -6765,7 +6765,7 @@ void NppParameters::feedDockingManager(TiXmlNode *node) } int i; - if (element->Attribute(TEXT("leftWidth"), &i)) + if (element->Attribute(L"leftWidth", &i)) { if (i > _nppGUI._dockingData._minDockedPanelVisibility) { @@ -6780,7 +6780,7 @@ void NppParameters::feedDockingManager(TiXmlNode *node) _nppGUI._dockingData._leftWidth = _nppGUI._dockingData._minDockedPanelVisibility; } } - if (element->Attribute(TEXT("rightWidth"), &i)) + if (element->Attribute(L"rightWidth", &i)) { if (i > _nppGUI._dockingData._minDockedPanelVisibility) { @@ -6795,7 +6795,7 @@ void NppParameters::feedDockingManager(TiXmlNode *node) _nppGUI._dockingData._rightWidth = _nppGUI._dockingData._minDockedPanelVisibility; } } - if (element->Attribute(TEXT("topHeight"), &i)) + if (element->Attribute(L"topHeight", &i)) { if (i > _nppGUI._dockingData._minDockedPanelVisibility) { @@ -6810,7 +6810,7 @@ void NppParameters::feedDockingManager(TiXmlNode *node) _nppGUI._dockingData._topHeight = _nppGUI._dockingData._minDockedPanelVisibility; } } - if (element->Attribute(TEXT("bottomHeight"), &i)) + if (element->Attribute(L"bottomHeight", &i)) { if (i > _nppGUI._dockingData._minDockedPanelVisibility) { @@ -6826,30 +6826,30 @@ void NppParameters::feedDockingManager(TiXmlNode *node) } } - for (TiXmlNode *childNode = node->FirstChildElement(TEXT("FloatingWindow")); + for (TiXmlNode *childNode = node->FirstChildElement(L"FloatingWindow"); childNode ; - childNode = childNode->NextSibling(TEXT("FloatingWindow")) ) + childNode = childNode->NextSibling(L"FloatingWindow") ) { TiXmlElement *floatElement = childNode->ToElement(); int cont; - if (floatElement->Attribute(TEXT("cont"), &cont)) + if (floatElement->Attribute(L"cont", &cont)) { int x = 0; int y = 0; int w = FWI_PANEL_WH_DEFAULT; int h = FWI_PANEL_WH_DEFAULT; - if (floatElement->Attribute(TEXT("x"), &x)) + if (floatElement->Attribute(L"x", &x)) { if ((x > (maxMonitorSize.cx - 1)) || (x < 0)) x = 0; // invalid, reset } - if (floatElement->Attribute(TEXT("y"), &y)) + if (floatElement->Attribute(L"y", &y)) { if ((y > (maxMonitorSize.cy - 1)) || (y < 0)) y = 0; // invalid, reset } - if (floatElement->Attribute(TEXT("width"), &w)) + if (floatElement->Attribute(L"width", &w)) { if (w > maxMonitorSize.cx) { @@ -6861,7 +6861,7 @@ void NppParameters::feedDockingManager(TiXmlNode *node) w = _nppGUI._dockingData._minFloatingPanelSize.cx; // invalid, reset } } - if (floatElement->Attribute(TEXT("height"), &h)) + if (floatElement->Attribute(L"height", &h)) { if (h > maxMonitorSize.cy) { @@ -6877,44 +6877,44 @@ void NppParameters::feedDockingManager(TiXmlNode *node) } } - for (TiXmlNode *childNode = node->FirstChildElement(TEXT("PluginDlg")); + for (TiXmlNode *childNode = node->FirstChildElement(L"PluginDlg"); childNode ; - childNode = childNode->NextSibling(TEXT("PluginDlg")) ) + childNode = childNode->NextSibling(L"PluginDlg") ) { TiXmlElement *dlgElement = childNode->ToElement(); - const TCHAR *name = dlgElement->Attribute(TEXT("pluginName")); + const wchar_t *name = dlgElement->Attribute(L"pluginName"); int id; - const TCHAR *idStr = dlgElement->Attribute(TEXT("id"), &id); + const wchar_t *idStr = dlgElement->Attribute(L"id", &id); if (name && idStr) { int current = 0; // on left int prev = 0; // on left - dlgElement->Attribute(TEXT("curr"), ¤t); - dlgElement->Attribute(TEXT("prev"), &prev); + dlgElement->Attribute(L"curr", ¤t); + dlgElement->Attribute(L"prev", &prev); bool isVisible = false; - const TCHAR *val = dlgElement->Attribute(TEXT("isVisible")); + const wchar_t *val = dlgElement->Attribute(L"isVisible"); if (val) { - isVisible = (lstrcmp(val, TEXT("yes")) == 0); + isVisible = (lstrcmp(val, L"yes") == 0); } _nppGUI._dockingData._pluginDockInfo.push_back(PluginDlgDockingInfo(name, id, current, prev, isVisible)); } } - for (TiXmlNode *childNode = node->FirstChildElement(TEXT("ActiveTabs")); + for (TiXmlNode *childNode = node->FirstChildElement(L"ActiveTabs"); childNode ; - childNode = childNode->NextSibling(TEXT("ActiveTabs")) ) + childNode = childNode->NextSibling(L"ActiveTabs") ) { TiXmlElement *dlgElement = childNode->ToElement(); int cont; - if (dlgElement->Attribute(TEXT("cont"), &cont)) + if (dlgElement->Attribute(L"cont", &cont)) { int activeTab = 0; - dlgElement->Attribute(TEXT("activeTab"), &activeTab); + dlgElement->Attribute(L"activeTab", &activeTab); _nppGUI._dockingData._containerTabInfo.push_back(ContainerTabInfo(cont, activeTab)); } } @@ -6927,100 +6927,100 @@ void NppParameters::duplicateDockingManager(TiXmlNode* dockMngNode, TiXmlElement TiXmlElement *dockMngElmt = dockMngNode->ToElement(); int i; - if (dockMngElmt->Attribute(TEXT("leftWidth"), &i)) - dockMngElmt2Clone->SetAttribute(TEXT("leftWidth"), i); + if (dockMngElmt->Attribute(L"leftWidth", &i)) + dockMngElmt2Clone->SetAttribute(L"leftWidth", i); - if (dockMngElmt->Attribute(TEXT("rightWidth"), &i)) - dockMngElmt2Clone->SetAttribute(TEXT("rightWidth"), i); + if (dockMngElmt->Attribute(L"rightWidth", &i)) + dockMngElmt2Clone->SetAttribute(L"rightWidth", i); - if (dockMngElmt->Attribute(TEXT("topHeight"), &i)) - dockMngElmt2Clone->SetAttribute(TEXT("topHeight"), i); + if (dockMngElmt->Attribute(L"topHeight", &i)) + dockMngElmt2Clone->SetAttribute(L"topHeight", i); - if (dockMngElmt->Attribute(TEXT("bottomHeight"), &i)) - dockMngElmt2Clone->SetAttribute(TEXT("bottomHeight"), i); + if (dockMngElmt->Attribute(L"bottomHeight", &i)) + dockMngElmt2Clone->SetAttribute(L"bottomHeight", i); - for (TiXmlNode *childNode = dockMngNode->FirstChildElement(TEXT("FloatingWindow")); + for (TiXmlNode *childNode = dockMngNode->FirstChildElement(L"FloatingWindow"); childNode; - childNode = childNode->NextSibling(TEXT("FloatingWindow"))) + childNode = childNode->NextSibling(L"FloatingWindow")) { TiXmlElement *floatElement = childNode->ToElement(); int cont; - if (floatElement->Attribute(TEXT("cont"), &cont)) + if (floatElement->Attribute(L"cont", &cont)) { - TiXmlElement FWNode(TEXT("FloatingWindow")); - FWNode.SetAttribute(TEXT("cont"), cont); + TiXmlElement FWNode(L"FloatingWindow"); + FWNode.SetAttribute(L"cont", cont); int x = 0; int y = 0; int w = 100; int h = 100; - floatElement->Attribute(TEXT("x"), &x); - FWNode.SetAttribute(TEXT("x"), x); + floatElement->Attribute(L"x", &x); + FWNode.SetAttribute(L"x", x); - floatElement->Attribute(TEXT("y"), &y); - FWNode.SetAttribute(TEXT("y"), y); + floatElement->Attribute(L"y", &y); + FWNode.SetAttribute(L"y", y); - floatElement->Attribute(TEXT("width"), &w); - FWNode.SetAttribute(TEXT("width"), w); + floatElement->Attribute(L"width", &w); + FWNode.SetAttribute(L"width", w); - floatElement->Attribute(TEXT("height"), &h); - FWNode.SetAttribute(TEXT("height"), h); + floatElement->Attribute(L"height", &h); + FWNode.SetAttribute(L"height", h); dockMngElmt2Clone->InsertEndChild(FWNode); } } - for (TiXmlNode *childNode = dockMngNode->FirstChildElement(TEXT("PluginDlg")); + for (TiXmlNode *childNode = dockMngNode->FirstChildElement(L"PluginDlg"); childNode; - childNode = childNode->NextSibling(TEXT("PluginDlg"))) + childNode = childNode->NextSibling(L"PluginDlg")) { TiXmlElement *dlgElement = childNode->ToElement(); - const TCHAR *name = dlgElement->Attribute(TEXT("pluginName")); - TiXmlElement PDNode(TEXT("PluginDlg")); + const wchar_t *name = dlgElement->Attribute(L"pluginName"); + TiXmlElement PDNode(L"PluginDlg"); int id; - const TCHAR *idStr = dlgElement->Attribute(TEXT("id"), &id); + const wchar_t *idStr = dlgElement->Attribute(L"id", &id); if (name && idStr) { int curr = 0; // on left int prev = 0; // on left - dlgElement->Attribute(TEXT("curr"), &curr); - dlgElement->Attribute(TEXT("prev"), &prev); + dlgElement->Attribute(L"curr", &curr); + dlgElement->Attribute(L"prev", &prev); bool isVisible = false; - const TCHAR *val = dlgElement->Attribute(TEXT("isVisible")); + const wchar_t *val = dlgElement->Attribute(L"isVisible"); if (val) { - isVisible = (lstrcmp(val, TEXT("yes")) == 0); + isVisible = (lstrcmp(val, L"yes") == 0); } - PDNode.SetAttribute(TEXT("pluginName"), name); - PDNode.SetAttribute(TEXT("id"), idStr); - PDNode.SetAttribute(TEXT("curr"), curr); - PDNode.SetAttribute(TEXT("prev"), prev); - PDNode.SetAttribute(TEXT("isVisible"), isVisible ? TEXT("yes") : TEXT("no")); + PDNode.SetAttribute(L"pluginName", name); + PDNode.SetAttribute(L"id", idStr); + PDNode.SetAttribute(L"curr", curr); + PDNode.SetAttribute(L"prev", prev); + PDNode.SetAttribute(L"isVisible", isVisible ? L"yes" : L"no"); dockMngElmt2Clone->InsertEndChild(PDNode); } } - for (TiXmlNode *childNode = dockMngNode->FirstChildElement(TEXT("ActiveTabs")); + for (TiXmlNode *childNode = dockMngNode->FirstChildElement(L"ActiveTabs"); childNode; - childNode = childNode->NextSibling(TEXT("ActiveTabs"))) + childNode = childNode->NextSibling(L"ActiveTabs")) { TiXmlElement *dlgElement = childNode->ToElement(); - TiXmlElement CTNode(TEXT("ActiveTabs")); + TiXmlElement CTNode(L"ActiveTabs"); int cont; - if (dlgElement->Attribute(TEXT("cont"), &cont)) + if (dlgElement->Attribute(L"cont", &cont)) { int activeTab = 0; - dlgElement->Attribute(TEXT("activeTab"), &activeTab); + dlgElement->Attribute(L"activeTab", &activeTab); - CTNode.SetAttribute(TEXT("cont"), cont); - CTNode.SetAttribute(TEXT("activeTab"), activeTab); + CTNode.SetAttribute(L"cont", cont); + CTNode.SetAttribute(L"activeTab", activeTab); dockMngElmt2Clone->InsertEndChild(CTNode); } @@ -7031,120 +7031,122 @@ bool NppParameters::writeScintillaParams() { if (!_pXmlUserDoc) return false; - const TCHAR *pViewName = TEXT("ScintillaPrimaryView"); - TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus")); + const wchar_t *pViewName = L"ScintillaPrimaryView"; + TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(L"NotepadPlus"); if (!nppRoot) { - nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); } - TiXmlNode *configsRoot = nppRoot->FirstChildElement(TEXT("GUIConfigs")); + TiXmlNode *configsRoot = nppRoot->FirstChildElement(L"GUIConfigs"); if (!configsRoot) { - configsRoot = nppRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfigs"))); + configsRoot = nppRoot->InsertEndChild(TiXmlElement(L"GUIConfigs")); } - TiXmlNode *scintNode = getChildElementByAttribut(configsRoot, TEXT("GUIConfig"), TEXT("name"), pViewName); + TiXmlNode *scintNode = getChildElementByAttribut(configsRoot, L"GUIConfig", L"name", pViewName); if (!scintNode) { - scintNode = configsRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))); - (scintNode->ToElement())->SetAttribute(TEXT("name"), pViewName); + scintNode = configsRoot->InsertEndChild(TiXmlElement(L"GUIConfig")); + (scintNode->ToElement())->SetAttribute(L"name", pViewName); } - auto setYesNoBoolAttribute = [&scintNode](const TCHAR* name, bool value) -> void { - const TCHAR* pStr = value ? TEXT("yes") : TEXT("no"); + auto setYesNoBoolAttribute = [&scintNode](const wchar_t* name, bool value) -> void { + const wchar_t* pStr = value ? L"yes" : L"no"; (scintNode->ToElement())->SetAttribute(name, pStr); }; - auto setShowHideBoolAttribute = [&scintNode](const TCHAR* name, bool value) -> void { - const TCHAR* pStr = value ? TEXT("show") : TEXT("hide"); + auto setShowHideBoolAttribute = [&scintNode](const wchar_t* name, bool value) -> void { + const wchar_t* pStr = value ? L"show" : L"hide"; (scintNode->ToElement())->SetAttribute(name, pStr); }; - (scintNode->ToElement())->SetAttribute(TEXT("lineNumberMargin"), _svp._lineNumberMarginShow?TEXT("show"):TEXT("hide")); - (scintNode->ToElement())->SetAttribute(TEXT("lineNumberDynamicWidth"), _svp._lineNumberMarginDynamicWidth ?TEXT("yes"):TEXT("no")); - (scintNode->ToElement())->SetAttribute(TEXT("bookMarkMargin"), _svp._bookMarkMarginShow?TEXT("show"):TEXT("hide")); - (scintNode->ToElement())->SetAttribute(TEXT("indentGuideLine"), _svp._indentGuideLineShow?TEXT("show"):TEXT("hide")); - const TCHAR *pFolderStyleStr = (_svp._folderStyle == FOLDER_STYLE_SIMPLE)?TEXT("simple"): - (_svp._folderStyle == FOLDER_STYLE_ARROW)?TEXT("arrow"): - (_svp._folderStyle == FOLDER_STYLE_CIRCLE)?TEXT("circle"): - (_svp._folderStyle == FOLDER_STYLE_NONE)?TEXT("none"):TEXT("box"); - (scintNode->ToElement())->SetAttribute(TEXT("folderMarkStyle"), pFolderStyleStr); + (scintNode->ToElement())->SetAttribute(L"lineNumberMargin", _svp._lineNumberMarginShow ? L"show" : L"hide"); + (scintNode->ToElement())->SetAttribute(L"lineNumberDynamicWidth", _svp._lineNumberMarginDynamicWidth ? L"yes" : L"no"); + (scintNode->ToElement())->SetAttribute(L"bookMarkMargin", _svp._bookMarkMarginShow ? L"show" : L"hide"); + (scintNode->ToElement())->SetAttribute(L"indentGuideLine", _svp._indentGuideLineShow ? L"show" : L"hide"); + const wchar_t *pFolderStyleStr = (_svp._folderStyle == FOLDER_STYLE_SIMPLE) ? L"simple" : + (_svp._folderStyle == FOLDER_STYLE_ARROW) ? L"arrow" : + (_svp._folderStyle == FOLDER_STYLE_CIRCLE) ? L"circle" : + (_svp._folderStyle == FOLDER_STYLE_NONE) ? L"none" : L"box"; + + (scintNode->ToElement())->SetAttribute(L"folderMarkStyle", pFolderStyleStr); - (scintNode->ToElement())->SetAttribute(TEXT("isChangeHistoryEnabled"), _svp._isChangeHistoryEnabled4NextSession); // no -> 0 (disable), yes -> 1 (margin), yes ->2 (indicator), yes-> 3 (margin + indicator) + (scintNode->ToElement())->SetAttribute(L"isChangeHistoryEnabled", _svp._isChangeHistoryEnabled4NextSession); // no -> 0 (disable), yes -> 1 (margin), yes ->2 (indicator), yes-> 3 (margin + indicator) - const TCHAR *pWrapMethodStr = (_svp._lineWrapMethod == LINEWRAP_ALIGNED)?TEXT("aligned"): - (_svp._lineWrapMethod == LINEWRAP_INDENT)?TEXT("indent"):TEXT("default"); - (scintNode->ToElement())->SetAttribute(TEXT("lineWrapMethod"), pWrapMethodStr); + const wchar_t *pWrapMethodStr = (_svp._lineWrapMethod == LINEWRAP_ALIGNED) ? L"aligned" : + (_svp._lineWrapMethod == LINEWRAP_INDENT) ? L"indent" : L"default"; - (scintNode->ToElement())->SetAttribute(TEXT("currentLineIndicator"), _svp._currentLineHiliteMode); - (scintNode->ToElement())->SetAttribute(TEXT("currentLineFrameWidth"), _svp._currentLineFrameWidth); + (scintNode->ToElement())->SetAttribute(L"lineWrapMethod", pWrapMethodStr); - (scintNode->ToElement())->SetAttribute(TEXT("virtualSpace"), _svp._virtualSpace?TEXT("yes"):TEXT("no")); - (scintNode->ToElement())->SetAttribute(TEXT("scrollBeyondLastLine"), _svp._scrollBeyondLastLine?TEXT("yes"):TEXT("no")); - (scintNode->ToElement())->SetAttribute(TEXT("rightClickKeepsSelection"), _svp._rightClickKeepsSelection ? TEXT("yes") : TEXT("no")); - (scintNode->ToElement())->SetAttribute(TEXT("disableAdvancedScrolling"), _svp._disableAdvancedScrolling?TEXT("yes"):TEXT("no")); - (scintNode->ToElement())->SetAttribute(TEXT("wrapSymbolShow"), _svp._wrapSymbolShow?TEXT("show"):TEXT("hide")); - (scintNode->ToElement())->SetAttribute(TEXT("Wrap"), _svp._doWrap?TEXT("yes"):TEXT("no")); - (scintNode->ToElement())->SetAttribute(TEXT("borderEdge"), _svp._showBorderEdge ? TEXT("yes") : TEXT("no")); + (scintNode->ToElement())->SetAttribute(L"currentLineIndicator", _svp._currentLineHiliteMode); + (scintNode->ToElement())->SetAttribute(L"currentLineFrameWidth", _svp._currentLineFrameWidth); + + (scintNode->ToElement())->SetAttribute(L"virtualSpace", _svp._virtualSpace ? L"yes" : L"no"); + (scintNode->ToElement())->SetAttribute(L"scrollBeyondLastLine", _svp._scrollBeyondLastLine ? L"yes" : L"no"); + (scintNode->ToElement())->SetAttribute(L"rightClickKeepsSelection", _svp._rightClickKeepsSelection ? L"yes" : L"no"); + (scintNode->ToElement())->SetAttribute(L"disableAdvancedScrolling", _svp._disableAdvancedScrolling ? L"yes" : L"no"); + (scintNode->ToElement())->SetAttribute(L"wrapSymbolShow", _svp._wrapSymbolShow ? L"show" : L"hide"); + (scintNode->ToElement())->SetAttribute(L"Wrap", _svp._doWrap ? L"yes" : L"no"); + (scintNode->ToElement())->SetAttribute(L"borderEdge", _svp._showBorderEdge ? L"yes" : L"no"); std::wstring edgeColumnPosStr; for (auto i : _svp._edgeMultiColumnPos) { std::string s = std::to_string(i); edgeColumnPosStr += std::wstring(s.begin(), s.end()); - edgeColumnPosStr += TEXT(" "); + edgeColumnPosStr += L" "; } - (scintNode->ToElement())->SetAttribute(TEXT("isEdgeBgMode"), _svp._isEdgeBgMode ? TEXT("yes") : TEXT("no")); - (scintNode->ToElement())->SetAttribute(TEXT("edgeMultiColumnPos"), edgeColumnPosStr); - (scintNode->ToElement())->SetAttribute(TEXT("zoom"), static_cast(_svp._zoom)); - (scintNode->ToElement())->SetAttribute(TEXT("zoom2"), static_cast(_svp._zoom2)); - (scintNode->ToElement())->SetAttribute(TEXT("whiteSpaceShow"), _svp._whiteSpaceShow?TEXT("show"):TEXT("hide")); - (scintNode->ToElement())->SetAttribute(TEXT("eolShow"), _svp._eolShow?TEXT("show"):TEXT("hide")); - (scintNode->ToElement())->SetAttribute(TEXT("eolMode"), _svp._eolMode); - setShowHideBoolAttribute(TEXT("npcShow"), _svp._npcShow); - (scintNode->ToElement())->SetAttribute(TEXT("npcMode"), static_cast(_svp._npcMode)); - setYesNoBoolAttribute(TEXT("npcCustomColor"), _svp._npcCustomColor); - setYesNoBoolAttribute(TEXT("npcIncludeCcUniEOL"), _svp._npcIncludeCcUniEol); - setYesNoBoolAttribute(TEXT("npcNoInputC0"), _svp._npcNoInputC0); - setYesNoBoolAttribute(TEXT("ccShow"), _svp._ccUniEolShow); - (scintNode->ToElement())->SetAttribute(TEXT("borderWidth"), _svp._borderWidth); - (scintNode->ToElement())->SetAttribute(TEXT("smoothFont"), _svp._doSmoothFont ? TEXT("yes") : TEXT("no")); - (scintNode->ToElement())->SetAttribute(TEXT("paddingLeft"), _svp._paddingLeft); - (scintNode->ToElement())->SetAttribute(TEXT("paddingRight"), _svp._paddingRight); - (scintNode->ToElement())->SetAttribute(TEXT("distractionFreeDivPart"), _svp._distractionFreeDivPart); - (scintNode->ToElement())->SetAttribute(TEXT("lineCopyCutWithoutSelection"), _svp._lineCopyCutWithoutSelection ? TEXT("yes") : TEXT("no")); + (scintNode->ToElement())->SetAttribute(L"isEdgeBgMode", _svp._isEdgeBgMode ? L"yes" : L"no"); + (scintNode->ToElement())->SetAttribute(L"edgeMultiColumnPos", edgeColumnPosStr); + (scintNode->ToElement())->SetAttribute(L"zoom", static_cast(_svp._zoom)); + (scintNode->ToElement())->SetAttribute(L"zoom2", static_cast(_svp._zoom2)); + (scintNode->ToElement())->SetAttribute(L"whiteSpaceShow", _svp._whiteSpaceShow ? L"show" : L"hide"); + (scintNode->ToElement())->SetAttribute(L"eolShow", _svp._eolShow ? L"show" : L"hide"); + (scintNode->ToElement())->SetAttribute(L"eolMode", _svp._eolMode); + setShowHideBoolAttribute(L"npcShow", _svp._npcShow); + (scintNode->ToElement())->SetAttribute(L"npcMode", static_cast(_svp._npcMode)); + setYesNoBoolAttribute(L"npcCustomColor", _svp._npcCustomColor); + setYesNoBoolAttribute(L"npcIncludeCcUniEOL", _svp._npcIncludeCcUniEol); + setYesNoBoolAttribute(L"npcNoInputC0", _svp._npcNoInputC0); + setYesNoBoolAttribute(L"ccShow", _svp._ccUniEolShow); + (scintNode->ToElement())->SetAttribute(L"borderWidth", _svp._borderWidth); + (scintNode->ToElement())->SetAttribute(L"smoothFont", _svp._doSmoothFont ? L"yes" : L"no"); + (scintNode->ToElement())->SetAttribute(L"paddingLeft", _svp._paddingLeft); + (scintNode->ToElement())->SetAttribute(L"paddingRight", _svp._paddingRight); + (scintNode->ToElement())->SetAttribute(L"distractionFreeDivPart", _svp._distractionFreeDivPart); + (scintNode->ToElement())->SetAttribute(L"lineCopyCutWithoutSelection", _svp._lineCopyCutWithoutSelection ? L"yes" : L"no"); - (scintNode->ToElement())->SetAttribute(TEXT("multiSelection"), _svp._multiSelection ? TEXT("yes") : TEXT("no")); + (scintNode->ToElement())->SetAttribute(L"multiSelection", _svp._multiSelection ? L"yes" : L"no"); bool canEnableColumnSel2MultiEdit = _svp._multiSelection && _svp._columnSel2MultiEdit; - (scintNode->ToElement())->SetAttribute(TEXT("columnSel2MultiEdit"), canEnableColumnSel2MultiEdit ? TEXT("yes") : TEXT("no")); + (scintNode->ToElement())->SetAttribute(L"columnSel2MultiEdit", canEnableColumnSel2MultiEdit ? L"yes" : L"no"); return true; } void NppParameters::createXmlTreeFromGUIParams() { - TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(L"NotepadPlus"); if (!nppRoot) { - nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); } - TiXmlNode *oldGUIRoot = nppRoot->FirstChildElement(TEXT("GUIConfigs")); + TiXmlNode *oldGUIRoot = nppRoot->FirstChildElement(L"GUIConfigs"); TiXmlElement* dockMngNodeDup = nullptr; TiXmlNode* dockMngNodeOriginal = nullptr; if (oldGUIRoot && _nppGUI._isCmdlineNosessionActivated) { - for (TiXmlNode *childNode = oldGUIRoot->FirstChildElement(TEXT("GUIConfig")); + for (TiXmlNode *childNode = oldGUIRoot->FirstChildElement(L"GUIConfig"); childNode; - childNode = childNode->NextSibling(TEXT("GUIConfig"))) + childNode = childNode->NextSibling(L"GUIConfig")) { TiXmlElement* element = childNode->ToElement(); - const TCHAR* nm = element->Attribute(TEXT("name")); + const wchar_t* nm = element->Attribute(L"name"); if (nullptr == nm) continue; - if (!lstrcmp(nm, TEXT("DockingManager"))) + if (!lstrcmp(nm, L"DockingManager")) { dockMngNodeOriginal = childNode; break; @@ -7154,8 +7156,8 @@ void NppParameters::createXmlTreeFromGUIParams() // Copy DockingParamNode if (dockMngNodeOriginal) { - dockMngNodeDup = new TiXmlElement(TEXT("GUIConfig")); - dockMngNodeDup->SetAttribute(TEXT("name"), TEXT("DockingManager")); + dockMngNodeDup = new TiXmlElement(L"GUIConfig"); + dockMngNodeDup->SetAttribute(L"name", L"DockingManager"); duplicateDockingManager(dockMngNodeOriginal, dockMngNodeDup); } @@ -7167,580 +7169,580 @@ void NppParameters::createXmlTreeFromGUIParams() nppRoot->RemoveChild(oldGUIRoot); } - TiXmlNode *newGUIRoot = nppRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfigs"))); + TiXmlNode *newGUIRoot = nppRoot->InsertEndChild(TiXmlElement(L"GUIConfigs")); // standard { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("ToolBar")); - const TCHAR *pStr = (_nppGUI._toolbarShow) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("visible"), pStr); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"ToolBar"); + const wchar_t *pStr = (_nppGUI._toolbarShow) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"visible", pStr); if (_nppGUI._toolBarStatus == TB_SMALL) - pStr = TEXT("small"); + pStr = L"small"; else if (_nppGUI._toolBarStatus == TB_LARGE) - pStr = TEXT("large"); + pStr = L"large"; else if (_nppGUI._toolBarStatus == TB_SMALL2) - pStr = TEXT("small2"); + pStr = L"small2"; else if (_nppGUI._toolBarStatus == TB_LARGE2) - pStr = TEXT("large2"); + pStr = L"large2"; else //if (_nppGUI._toolBarStatus == TB_STANDARD) - pStr = TEXT("standard"); + pStr = L"standard"; GUIConfigElement->InsertEndChild(TiXmlText(pStr)); } // show { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("StatusBar")); - const TCHAR *pStr = _nppGUI._statusBarShow ? TEXT("show") : TEXT("hide"); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"StatusBar"); + const wchar_t *pStr = _nppGUI._statusBarShow ? L"show" : L"hide"; GUIConfigElement->InsertEndChild(TiXmlText(pStr)); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("TabBar")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"TabBar"); - const TCHAR *pStr = (_nppGUI._tabStatus & TAB_DRAWTOPBAR) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("dragAndDrop"), pStr); + const wchar_t *pStr = (_nppGUI._tabStatus & TAB_DRAWTOPBAR) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"dragAndDrop", pStr); - pStr = (_nppGUI._tabStatus & TAB_DRAGNDROP) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("drawTopBar"), pStr); + pStr = (_nppGUI._tabStatus & TAB_DRAGNDROP) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"drawTopBar", pStr); - pStr = (_nppGUI._tabStatus & TAB_DRAWINACTIVETAB) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("drawInactiveTab"), pStr); + pStr = (_nppGUI._tabStatus & TAB_DRAWINACTIVETAB) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"drawInactiveTab", pStr); - pStr = (_nppGUI._tabStatus & TAB_REDUCE) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("reduce"), pStr); + pStr = (_nppGUI._tabStatus & TAB_REDUCE) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"reduce", pStr); - pStr = (_nppGUI._tabStatus & TAB_CLOSEBUTTON) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("closeButton"), pStr); + pStr = (_nppGUI._tabStatus & TAB_CLOSEBUTTON) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"closeButton", pStr); - pStr = (_nppGUI._tabStatus & TAB_DBCLK2CLOSE) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("doubleClick2Close"), pStr); + pStr = (_nppGUI._tabStatus & TAB_DBCLK2CLOSE) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"doubleClick2Close", pStr); - pStr = (_nppGUI._tabStatus & TAB_VERTICAL) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("vertical"), pStr); + pStr = (_nppGUI._tabStatus & TAB_VERTICAL) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"vertical", pStr); - pStr = (_nppGUI._tabStatus & TAB_MULTILINE) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("multiLine"), pStr); + pStr = (_nppGUI._tabStatus & TAB_MULTILINE) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"multiLine", pStr); - pStr = (_nppGUI._tabStatus & TAB_HIDE) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("hide"), pStr); + pStr = (_nppGUI._tabStatus & TAB_HIDE) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"hide", pStr); - pStr = (_nppGUI._tabStatus & TAB_QUITONEMPTY) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("quitOnEmpty"), pStr); + pStr = (_nppGUI._tabStatus & TAB_QUITONEMPTY) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"quitOnEmpty", pStr); - pStr = (_nppGUI._tabStatus & TAB_ALTICONS) ? TEXT("1") : TEXT("0"); - GUIConfigElement->SetAttribute(TEXT("iconSetNumber"), pStr); + pStr = (_nppGUI._tabStatus & TAB_ALTICONS) ? L"1" : L"0"; + GUIConfigElement->SetAttribute(L"iconSetNumber", pStr); } // vertical { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("ScintillaViewsSplitter")); - const TCHAR *pStr = _nppGUI._splitterPos == POS_VERTICAL ? TEXT("vertical") : TEXT("horizontal"); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"ScintillaViewsSplitter"); + const wchar_t *pStr = _nppGUI._splitterPos == POS_VERTICAL ? L"vertical" : L"horizontal"; GUIConfigElement->InsertEndChild(TiXmlText(pStr)); } // hide { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("UserDefineDlg")); - const TCHAR *pStr = (_nppGUI._userDefineDlgStatus & UDD_DOCKED) ? TEXT("docked") : TEXT("undocked"); - GUIConfigElement->SetAttribute(TEXT("position"), pStr); - pStr = (_nppGUI._userDefineDlgStatus & UDD_SHOW) ? TEXT("show") : TEXT("hide"); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"UserDefineDlg"); + const wchar_t *pStr = (_nppGUI._userDefineDlgStatus & UDD_DOCKED) ? L"docked" : L"undocked"; + GUIConfigElement->SetAttribute(L"position", pStr); + pStr = (_nppGUI._userDefineDlgStatus & UDD_SHOW) ? L"show" : L"hide"; GUIConfigElement->InsertEndChild(TiXmlText(pStr)); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("TabSetting")); - const TCHAR *pStr = _nppGUI._tabReplacedBySpace ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("replaceBySpace"), pStr); - GUIConfigElement->SetAttribute(TEXT("size"), _nppGUI._tabSize); - pStr = _nppGUI._backspaceUnindent ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("backspaceUnindent"), pStr); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"TabSetting"); + const wchar_t *pStr = _nppGUI._tabReplacedBySpace ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"replaceBySpace", pStr); + GUIConfigElement->SetAttribute(L"size", _nppGUI._tabSize); + pStr = _nppGUI._backspaceUnindent ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"backspaceUnindent", pStr); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("AppPosition")); - GUIConfigElement->SetAttribute(TEXT("x"), _nppGUI._appPos.left); - GUIConfigElement->SetAttribute(TEXT("y"), _nppGUI._appPos.top); - GUIConfigElement->SetAttribute(TEXT("width"), _nppGUI._appPos.right); - GUIConfigElement->SetAttribute(TEXT("height"), _nppGUI._appPos.bottom); - GUIConfigElement->SetAttribute(TEXT("isMaximized"), _nppGUI._isMaximized ? TEXT("yes") : TEXT("no")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"AppPosition"); + GUIConfigElement->SetAttribute(L"x", _nppGUI._appPos.left); + GUIConfigElement->SetAttribute(L"y", _nppGUI._appPos.top); + GUIConfigElement->SetAttribute(L"width", _nppGUI._appPos.right); + GUIConfigElement->SetAttribute(L"height", _nppGUI._appPos.bottom); + GUIConfigElement->SetAttribute(L"isMaximized", _nppGUI._isMaximized ? L"yes" : L"no"); } // { - TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("FindWindowPosition")); - GUIConfigElement->SetAttribute(TEXT("left"), _nppGUI._findWindowPos.left); - GUIConfigElement->SetAttribute(TEXT("top"), _nppGUI._findWindowPos.top); - GUIConfigElement->SetAttribute(TEXT("right"), _nppGUI._findWindowPos.right); - GUIConfigElement->SetAttribute(TEXT("bottom"), _nppGUI._findWindowPos.bottom); - GUIConfigElement->SetAttribute(TEXT("isLessModeOn"), _nppGUI._findWindowLessMode ? TEXT("yes") : TEXT("no")); + TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"FindWindowPosition"); + GUIConfigElement->SetAttribute(L"left", _nppGUI._findWindowPos.left); + GUIConfigElement->SetAttribute(L"top", _nppGUI._findWindowPos.top); + GUIConfigElement->SetAttribute(L"right", _nppGUI._findWindowPos.right); + GUIConfigElement->SetAttribute(L"bottom", _nppGUI._findWindowPos.bottom); + GUIConfigElement->SetAttribute(L"isLessModeOn", _nppGUI._findWindowLessMode ? L"yes" : L"no"); } // { - TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("FinderConfig")); - const TCHAR* pStr = _nppGUI._finderLinesAreCurrentlyWrapped ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("wrappedLines"), pStr); - pStr = _nppGUI._finderPurgeBeforeEverySearch ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("purgeBeforeEverySearch"), pStr); - pStr = _nppGUI._finderShowOnlyOneEntryPerFoundLine ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("showOnlyOneEntryPerFoundLine"), pStr); + TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"FinderConfig"); + const wchar_t* pStr = _nppGUI._finderLinesAreCurrentlyWrapped ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"wrappedLines", pStr); + pStr = _nppGUI._finderPurgeBeforeEverySearch ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"purgeBeforeEverySearch", pStr); + pStr = _nppGUI._finderShowOnlyOneEntryPerFoundLine ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"showOnlyOneEntryPerFoundLine", pStr); } // no { - TiXmlElement *element = insertGUIConfigBoolNode(newGUIRoot, TEXT("noUpdate"), !_nppGUI._autoUpdateOpt._doAutoUpdate); - element->SetAttribute(TEXT("intervalDays"), _nppGUI._autoUpdateOpt._intervalDays); - element->SetAttribute(TEXT("nextUpdateDate"), _nppGUI._autoUpdateOpt._nextUpdateDate.toString().c_str()); + TiXmlElement *element = insertGUIConfigBoolNode(newGUIRoot, L"noUpdate", !_nppGUI._autoUpdateOpt._doAutoUpdate); + element->SetAttribute(L"intervalDays", _nppGUI._autoUpdateOpt._intervalDays); + element->SetAttribute(L"nextUpdateDate", _nppGUI._autoUpdateOpt._nextUpdateDate.toString().c_str()); } // yes { - const TCHAR *pStr = TEXT("no"); + const wchar_t *pStr = L"no"; if (_nppGUI._fileAutoDetection & cdEnabledOld) { - pStr = TEXT("yesOld"); + pStr = L"yesOld"; if ((_nppGUI._fileAutoDetection & cdAutoUpdate) && (_nppGUI._fileAutoDetection & cdGo2end)) { - pStr = TEXT("autoUpdate2EndOld"); + pStr = L"autoUpdate2EndOld"; } else if (_nppGUI._fileAutoDetection & cdAutoUpdate) { - pStr = TEXT("autoOld"); + pStr = L"autoOld"; } else if (_nppGUI._fileAutoDetection & cdGo2end) { - pStr = TEXT("Update2EndOld"); + pStr = L"Update2EndOld"; } } else if (_nppGUI._fileAutoDetection & cdEnabledNew) { - pStr = TEXT("yes"); + pStr = L"yes"; if ((_nppGUI._fileAutoDetection & cdAutoUpdate) && (_nppGUI._fileAutoDetection & cdGo2end)) { - pStr = TEXT("autoUpdate2End"); + pStr = L"autoUpdate2End"; } else if (_nppGUI._fileAutoDetection & cdAutoUpdate) { - pStr = TEXT("auto"); + pStr = L"auto"; } else if (_nppGUI._fileAutoDetection & cdGo2end) { - pStr = TEXT("Update2End"); + pStr = L"Update2End"; } } - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("Auto-detection")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"Auto-detection"); GUIConfigElement->InsertEndChild(TiXmlText(pStr)); } // no { - insertGUIConfigBoolNode(newGUIRoot, TEXT("CheckHistoryFiles"), _nppGUI._checkHistoryFiles); + insertGUIConfigBoolNode(newGUIRoot, L"CheckHistoryFiles", _nppGUI._checkHistoryFiles); } // no { - insertGUIConfigBoolNode(newGUIRoot, TEXT("TrayIcon"), _nppGUI._isMinimizedToTray); + insertGUIConfigBoolNode(newGUIRoot, L"TrayIcon", _nppGUI._isMinimizedToTray); } // yes { - insertGUIConfigBoolNode(newGUIRoot, TEXT("MaintainIndent"), _nppGUI._maintainIndent); + insertGUIConfigBoolNode(newGUIRoot, L"MaintainIndent", _nppGUI._maintainIndent); } // yes< / GUIConfig> { - TiXmlElement * ele = insertGUIConfigBoolNode(newGUIRoot, TEXT("TagsMatchHighLight"), _nppGUI._enableTagsMatchHilite); - ele->SetAttribute(TEXT("TagAttrHighLight"), _nppGUI._enableTagAttrsHilite ? TEXT("yes") : TEXT("no")); - ele->SetAttribute(TEXT("HighLightNonHtmlZone"), _nppGUI._enableHiliteNonHTMLZone ? TEXT("yes") : TEXT("no")); + TiXmlElement * ele = insertGUIConfigBoolNode(newGUIRoot, L"TagsMatchHighLight", _nppGUI._enableTagsMatchHilite); + ele->SetAttribute(L"TagAttrHighLight", _nppGUI._enableTagAttrsHilite ? L"yes" : L"no"); + ele->SetAttribute(L"HighLightNonHtmlZone", _nppGUI._enableHiliteNonHTMLZone ? L"yes" : L"no"); } // yes< / GUIConfig> { - insertGUIConfigBoolNode(newGUIRoot, TEXT("RememberLastSession"), _nppGUI._rememberLastSession); + insertGUIConfigBoolNode(newGUIRoot, L"RememberLastSession", _nppGUI._rememberLastSession); } // yes< / GUIConfig> { - insertGUIConfigBoolNode(newGUIRoot, TEXT("KeepSessionAbsentFileEntries"), _nppGUI._keepSessionAbsentFileEntries); + insertGUIConfigBoolNode(newGUIRoot, L"KeepSessionAbsentFileEntries", _nppGUI._keepSessionAbsentFileEntries); } // yes< / GUIConfig> { - insertGUIConfigBoolNode(newGUIRoot, TEXT("DetectEncoding"), _nppGUI._detectEncoding); + insertGUIConfigBoolNode(newGUIRoot, L"DetectEncoding", _nppGUI._detectEncoding); } // yes< / GUIConfig> { - insertGUIConfigBoolNode(newGUIRoot, TEXT("SaveAllConfirm"), _nppGUI._saveAllConfirm); + insertGUIConfigBoolNode(newGUIRoot, L"SaveAllConfirm", _nppGUI._saveAllConfirm); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("NewDocDefaultSettings")); - GUIConfigElement->SetAttribute(TEXT("format"), static_cast(_nppGUI._newDocDefaultSettings._format)); - GUIConfigElement->SetAttribute(TEXT("encoding"), _nppGUI._newDocDefaultSettings._unicodeMode); - GUIConfigElement->SetAttribute(TEXT("lang"), _nppGUI._newDocDefaultSettings._lang); - GUIConfigElement->SetAttribute(TEXT("codepage"), _nppGUI._newDocDefaultSettings._codepage); - GUIConfigElement->SetAttribute(TEXT("openAnsiAsUTF8"), _nppGUI._newDocDefaultSettings._openAnsiAsUtf8 ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("addNewDocumentOnStartup"), _nppGUI._newDocDefaultSettings._addNewDocumentOnStartup ? TEXT("yes") : TEXT("no")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"NewDocDefaultSettings"); + GUIConfigElement->SetAttribute(L"format", static_cast(_nppGUI._newDocDefaultSettings._format)); + GUIConfigElement->SetAttribute(L"encoding", _nppGUI._newDocDefaultSettings._unicodeMode); + GUIConfigElement->SetAttribute(L"lang", _nppGUI._newDocDefaultSettings._lang); + GUIConfigElement->SetAttribute(L"codepage", _nppGUI._newDocDefaultSettings._codepage); + GUIConfigElement->SetAttribute(L"openAnsiAsUTF8", _nppGUI._newDocDefaultSettings._openAnsiAsUtf8 ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"addNewDocumentOnStartup", _nppGUI._newDocDefaultSettings._addNewDocumentOnStartup ? L"yes" : L"no"); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("langsExcluded")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"langsExcluded"); writeExcludedLangList(GUIConfigElement); - GUIConfigElement->SetAttribute(TEXT("langMenuCompact"), _nppGUI._isLangMenuCompact ? TEXT("yes") : TEXT("no")); + GUIConfigElement->SetAttribute(L"langMenuCompact", _nppGUI._isLangMenuCompact ? L"yes" : L"no"); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("Print")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"Print"); writePrintSetting(GUIConfigElement); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("Backup")); - GUIConfigElement->SetAttribute(TEXT("action"), _nppGUI._backup); - GUIConfigElement->SetAttribute(TEXT("useCustumDir"), _nppGUI._useDir ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("dir"), _nppGUI._backupDir.c_str()); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"Backup"); + GUIConfigElement->SetAttribute(L"action", _nppGUI._backup); + GUIConfigElement->SetAttribute(L"useCustumDir", _nppGUI._useDir ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"dir", _nppGUI._backupDir.c_str()); - GUIConfigElement->SetAttribute(TEXT("isSnapshotMode"), _nppGUI._isSnapshotMode ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("snapshotBackupTiming"), static_cast(_nppGUI._snapshotBackupTiming)); + GUIConfigElement->SetAttribute(L"isSnapshotMode", _nppGUI._isSnapshotMode ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"snapshotBackupTiming", static_cast(_nppGUI._snapshotBackupTiming)); } // yes< / GUIConfig> { - insertGUIConfigBoolNode(newGUIRoot, TEXT("TaskList"), _nppGUI._doTaskList); + insertGUIConfigBoolNode(newGUIRoot, L"TaskList", _nppGUI._doTaskList); } // yes< / GUIConfig> { - insertGUIConfigBoolNode(newGUIRoot, TEXT("MRU"), _nppGUI._styleMRU); + insertGUIConfigBoolNode(newGUIRoot, L"MRU", _nppGUI._styleMRU); } // 2 { - TCHAR szStr [12] = TEXT("0"); + wchar_t szStr [12] = L"0"; _itow(_nppGUI._styleURL, szStr, 10); - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("URL")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"URL"); GUIConfigElement->InsertEndChild(TiXmlText(szStr)); } // svn:// { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("uriCustomizedSchemes")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"uriCustomizedSchemes"); GUIConfigElement->InsertEndChild(TiXmlText(_nppGUI._uriSchemes.c_str())); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("globalOverride")); - GUIConfigElement->SetAttribute(TEXT("fg"), _nppGUI._globalOverride.enableFg ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("bg"), _nppGUI._globalOverride.enableBg ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("font"), _nppGUI._globalOverride.enableFont ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("fontSize"), _nppGUI._globalOverride.enableFontSize ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("bold"), _nppGUI._globalOverride.enableBold ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("italic"), _nppGUI._globalOverride.enableItalic ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("underline"), _nppGUI._globalOverride.enableUnderLine ? TEXT("yes") : TEXT("no")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"globalOverride"); + GUIConfigElement->SetAttribute(L"fg", _nppGUI._globalOverride.enableFg ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"bg", _nppGUI._globalOverride.enableBg ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"font", _nppGUI._globalOverride.enableFont ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"fontSize", _nppGUI._globalOverride.enableFontSize ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"bold", _nppGUI._globalOverride.enableBold ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"italic", _nppGUI._globalOverride.enableItalic ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"underline", _nppGUI._globalOverride.enableUnderLine ? L"yes" : L"no"); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("auto-completion")); - GUIConfigElement->SetAttribute(TEXT("autoCAction"), _nppGUI._autocStatus); - GUIConfigElement->SetAttribute(TEXT("triggerFromNbChar"), static_cast(_nppGUI._autocFromLen)); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"auto-completion"); + GUIConfigElement->SetAttribute(L"autoCAction", _nppGUI._autocStatus); + GUIConfigElement->SetAttribute(L"triggerFromNbChar", static_cast(_nppGUI._autocFromLen)); - const TCHAR * pStr = _nppGUI._autocIgnoreNumbers ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("autoCIgnoreNumbers"), pStr); + const wchar_t * pStr = _nppGUI._autocIgnoreNumbers ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"autoCIgnoreNumbers", pStr); - pStr = _nppGUI._autocInsertSelectedUseENTER ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("insertSelectedItemUseENTER"), pStr); + pStr = _nppGUI._autocInsertSelectedUseENTER ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"insertSelectedItemUseENTER", pStr); - pStr = _nppGUI._autocInsertSelectedUseTAB ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("insertSelectedItemUseTAB"), pStr); + pStr = _nppGUI._autocInsertSelectedUseTAB ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"insertSelectedItemUseTAB", pStr); - pStr = _nppGUI._autocBrief ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("autoCBrief"), pStr); + pStr = _nppGUI._autocBrief ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"autoCBrief", pStr); - pStr = _nppGUI._funcParams ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("funcParams"), pStr); + pStr = _nppGUI._funcParams ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"funcParams", pStr); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("auto-insert")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"auto-insert"); - GUIConfigElement->SetAttribute(TEXT("parentheses"), _nppGUI._matchedPairConf._doParentheses ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("brackets"), _nppGUI._matchedPairConf._doBrackets ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("curlyBrackets"), _nppGUI._matchedPairConf._doCurlyBrackets ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("quotes"), _nppGUI._matchedPairConf._doQuotes ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("doubleQuotes"), _nppGUI._matchedPairConf._doDoubleQuotes ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("htmlXmlTag"), _nppGUI._matchedPairConf._doHtmlXmlTag ? TEXT("yes") : TEXT("no")); + GUIConfigElement->SetAttribute(L"parentheses", _nppGUI._matchedPairConf._doParentheses ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"brackets", _nppGUI._matchedPairConf._doBrackets ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"curlyBrackets", _nppGUI._matchedPairConf._doCurlyBrackets ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"quotes", _nppGUI._matchedPairConf._doQuotes ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"doubleQuotes", _nppGUI._matchedPairConf._doDoubleQuotes ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"htmlXmlTag", _nppGUI._matchedPairConf._doHtmlXmlTag ? L"yes" : L"no"); - TiXmlElement hist_element{ TEXT("") }; - hist_element.SetValue(TEXT("UserDefinePair")); + TiXmlElement hist_element{ L"" }; + hist_element.SetValue(L"UserDefinePair"); for (size_t i = 0, nb = _nppGUI._matchedPairConf._matchedPairs.size(); i < nb; ++i) { int open = _nppGUI._matchedPairConf._matchedPairs[i].first; int close = _nppGUI._matchedPairConf._matchedPairs[i].second; - (hist_element.ToElement())->SetAttribute(TEXT("open"), open); - (hist_element.ToElement())->SetAttribute(TEXT("close"), close); + (hist_element.ToElement())->SetAttribute(L"open", open); + (hist_element.ToElement())->SetAttribute(L"close", close); GUIConfigElement->InsertEndChild(hist_element); } } // < / GUIConfig> { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("sessionExt")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"sessionExt"); GUIConfigElement->InsertEndChild(TiXmlText(_nppGUI._definedSessionExt.c_str())); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("workspaceExt")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"workspaceExt"); GUIConfigElement->InsertEndChild(TiXmlText(_nppGUI._definedWorkspaceExt.c_str())); } // show { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("MenuBar")); - GUIConfigElement->InsertEndChild(TiXmlText(_nppGUI._menuBarShow ? TEXT("show") : TEXT("hide"))); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"MenuBar"); + GUIConfigElement->InsertEndChild(TiXmlText(_nppGUI._menuBarShow ? L"show" : L"hide")); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("Caret")); - GUIConfigElement->SetAttribute(TEXT("width"), _nppGUI._caretWidth); - GUIConfigElement->SetAttribute(TEXT("blinkRate"), _nppGUI._caretBlinkRate); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"Caret"); + GUIConfigElement->SetAttribute(L"width", _nppGUI._caretWidth); + GUIConfigElement->SetAttribute(L"blinkRate", _nppGUI._caretBlinkRate); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("openSaveDir")); - GUIConfigElement->SetAttribute(TEXT("value"), _nppGUI._openSaveDir); - GUIConfigElement->SetAttribute(TEXT("defaultDirPath"), _nppGUI._defaultDir); - GUIConfigElement->SetAttribute(TEXT("lastUsedDirPath"), _nppGUI._lastUsedDir); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"openSaveDir"); + GUIConfigElement->SetAttribute(L"value", _nppGUI._openSaveDir); + GUIConfigElement->SetAttribute(L"defaultDirPath", _nppGUI._defaultDir); + GUIConfigElement->SetAttribute(L"lastUsedDirPath", _nppGUI._lastUsedDir); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("titleBar")); - const TCHAR *pStr = (_nppGUI._shortTitlebar) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("short"), pStr); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"titleBar"); + const wchar_t *pStr = (_nppGUI._shortTitlebar) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"short", pStr); } // { - TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("insertDateTime")); - GUIConfigElement->SetAttribute(TEXT("customizedFormat"), _nppGUI._dateTimeFormat.c_str()); - const TCHAR* pStr = (_nppGUI._dateTimeReverseDefaultOrder) ? TEXT("yes") : TEXT("no"); - GUIConfigElement->SetAttribute(TEXT("reverseDefaultOrder"), pStr); + TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"insertDateTime"); + GUIConfigElement->SetAttribute(L"customizedFormat", _nppGUI._dateTimeFormat.c_str()); + const wchar_t* pStr = (_nppGUI._dateTimeReverseDefaultOrder) ? L"yes" : L"no"; + GUIConfigElement->SetAttribute(L"reverseDefaultOrder", pStr); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("wordCharList")); - GUIConfigElement->SetAttribute(TEXT("useDefault"), _nppGUI._isWordCharDefault ? TEXT("yes") : TEXT("no")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"wordCharList"); + GUIConfigElement->SetAttribute(L"useDefault", _nppGUI._isWordCharDefault ? L"yes" : L"no"); WcharMbcsConvertor& wmc = WcharMbcsConvertor::getInstance(); const wchar_t* charsAddStr = wmc.char2wchar(_nppGUI._customWordChars.c_str(), SC_CP_UTF8); - GUIConfigElement->SetAttribute(TEXT("charsAdded"), charsAddStr); + GUIConfigElement->SetAttribute(L"charsAdded", charsAddStr); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("delimiterSelection")); - GUIConfigElement->SetAttribute(TEXT("leftmostDelimiter"), _nppGUI._leftmostDelimiter); - GUIConfigElement->SetAttribute(TEXT("rightmostDelimiter"), _nppGUI._rightmostDelimiter); - GUIConfigElement->SetAttribute(TEXT("delimiterSelectionOnEntireDocument"), _nppGUI._delimiterSelectionOnEntireDocument ? TEXT("yes") : TEXT("no")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"delimiterSelection"); + GUIConfigElement->SetAttribute(L"leftmostDelimiter", _nppGUI._leftmostDelimiter); + GUIConfigElement->SetAttribute(L"rightmostDelimiter", _nppGUI._rightmostDelimiter); + GUIConfigElement->SetAttribute(L"delimiterSelectionOnEntireDocument", _nppGUI._delimiterSelectionOnEntireDocument ? L"yes" : L"no"); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("largeFileRestriction")); - GUIConfigElement->SetAttribute(TEXT("fileSizeMB"), static_cast((_nppGUI._largeFileRestriction._largeFileSizeDefInByte / 1024) / 1024)); - GUIConfigElement->SetAttribute(TEXT("isEnabled"), _nppGUI._largeFileRestriction._isEnabled ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("allowAutoCompletion"), _nppGUI._largeFileRestriction._allowAutoCompletion ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("allowBraceMatch"), _nppGUI._largeFileRestriction._allowBraceMatch ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("allowSmartHilite"), _nppGUI._largeFileRestriction._allowSmartHilite ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("allowClickableLink"), _nppGUI._largeFileRestriction._allowClickableLink ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("deactivateWordWrap"), _nppGUI._largeFileRestriction._deactivateWordWrap ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("suppress2GBWarning"), _nppGUI._largeFileRestriction._suppress2GBWarning ? TEXT("yes") : TEXT("no")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"largeFileRestriction"); + GUIConfigElement->SetAttribute(L"fileSizeMB", static_cast((_nppGUI._largeFileRestriction._largeFileSizeDefInByte / 1024) / 1024)); + GUIConfigElement->SetAttribute(L"isEnabled", _nppGUI._largeFileRestriction._isEnabled ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"allowAutoCompletion", _nppGUI._largeFileRestriction._allowAutoCompletion ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"allowBraceMatch", _nppGUI._largeFileRestriction._allowBraceMatch ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"allowSmartHilite", _nppGUI._largeFileRestriction._allowSmartHilite ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"allowClickableLink", _nppGUI._largeFileRestriction._allowClickableLink ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"deactivateWordWrap", _nppGUI._largeFileRestriction._deactivateWordWrap ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"suppress2GBWarning", _nppGUI._largeFileRestriction._suppress2GBWarning ? L"yes" : L"no"); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("multiInst")); - GUIConfigElement->SetAttribute(TEXT("setting"), _nppGUI._multiInstSetting); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"multiInst"); + GUIConfigElement->SetAttribute(L"setting", _nppGUI._multiInstSetting); - auto setYesNoBoolAttribute = [&GUIConfigElement](const TCHAR* name, bool value) -> void { - const TCHAR* pStr = value ? TEXT("yes") : TEXT("no"); + auto setYesNoBoolAttribute = [&GUIConfigElement](const wchar_t* name, bool value) -> void { + const wchar_t* pStr = value ? L"yes" : L"no"; GUIConfigElement->SetAttribute(name, pStr); }; - setYesNoBoolAttribute(TEXT("clipboardHistory"), _nppGUI._clipboardHistoryPanelKeepState); - setYesNoBoolAttribute(TEXT("documentList"), _nppGUI._docListKeepState); - setYesNoBoolAttribute(TEXT("characterPanel"), _nppGUI._charPanelKeepState); - setYesNoBoolAttribute(TEXT("folderAsWorkspace"), _nppGUI._fileBrowserKeepState); - setYesNoBoolAttribute(TEXT("projectPanels"), _nppGUI._projectPanelKeepState); - setYesNoBoolAttribute(TEXT("documentMap"), _nppGUI._docMapKeepState); - setYesNoBoolAttribute(TEXT("fuctionList"), _nppGUI._funcListKeepState); - setYesNoBoolAttribute(TEXT("pluginPanels"), _nppGUI._pluginPanelKeepState); + setYesNoBoolAttribute(L"clipboardHistory", _nppGUI._clipboardHistoryPanelKeepState); + setYesNoBoolAttribute(L"documentList", _nppGUI._docListKeepState); + setYesNoBoolAttribute(L"characterPanel", _nppGUI._charPanelKeepState); + setYesNoBoolAttribute(L"folderAsWorkspace", _nppGUI._fileBrowserKeepState); + setYesNoBoolAttribute(L"projectPanels", _nppGUI._projectPanelKeepState); + setYesNoBoolAttribute(L"documentMap", _nppGUI._docMapKeepState); + setYesNoBoolAttribute(L"fuctionList", _nppGUI._funcListKeepState); + setYesNoBoolAttribute(L"pluginPanels", _nppGUI._pluginPanelKeepState); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("MISC")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"MISC"); - auto setYesNoBoolAttribute = [&GUIConfigElement](const TCHAR* name, bool value) -> void { - const TCHAR* pStr = value ? TEXT("yes") : TEXT("no"); + auto setYesNoBoolAttribute = [&GUIConfigElement](const wchar_t* name, bool value) -> void { + const wchar_t* pStr = value ? L"yes" : L"no"; GUIConfigElement->SetAttribute(name, pStr); }; - GUIConfigElement->SetAttribute(TEXT("fileSwitcherWithoutExtColumn"), _nppGUI._fileSwitcherWithoutExtColumn ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("fileSwitcherExtWidth"), _nppGUI._fileSwitcherExtWidth); - GUIConfigElement->SetAttribute(TEXT("fileSwitcherWithoutPathColumn"), _nppGUI._fileSwitcherWithoutPathColumn ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("fileSwitcherPathWidth"), _nppGUI._fileSwitcherPathWidth); - setYesNoBoolAttribute(TEXT("fileSwitcherNoGroups"), _nppGUI._fileSwitcherDisableListViewGroups); - GUIConfigElement->SetAttribute(TEXT("backSlashIsEscapeCharacterForSql"), _nppGUI._backSlashIsEscapeCharacterForSql ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("writeTechnologyEngine"), _nppGUI._writeTechnologyEngine); - GUIConfigElement->SetAttribute(TEXT("isFolderDroppedOpenFiles"), _nppGUI._isFolderDroppedOpenFiles ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("docPeekOnTab"), _nppGUI._isDocPeekOnTab ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("docPeekOnMap"), _nppGUI._isDocPeekOnMap ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("sortFunctionList"), _nppGUI._shouldSortFunctionList ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("saveDlgExtFilterToAllTypes"), _nppGUI._setSaveDlgExtFiltToAllTypes ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("muteSounds"), _nppGUI._muteSounds ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("enableFoldCmdToggable"), _nppGUI._enableFoldCmdToggable ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("hideMenuRightShortcuts"), _nppGUI._hideMenuRightShortcuts ? TEXT("yes") : TEXT("no")); + GUIConfigElement->SetAttribute(L"fileSwitcherWithoutExtColumn", _nppGUI._fileSwitcherWithoutExtColumn ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"fileSwitcherExtWidth", _nppGUI._fileSwitcherExtWidth); + GUIConfigElement->SetAttribute(L"fileSwitcherWithoutPathColumn", _nppGUI._fileSwitcherWithoutPathColumn ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"fileSwitcherPathWidth", _nppGUI._fileSwitcherPathWidth); + setYesNoBoolAttribute(L"fileSwitcherNoGroups", _nppGUI._fileSwitcherDisableListViewGroups); + GUIConfigElement->SetAttribute(L"backSlashIsEscapeCharacterForSql", _nppGUI._backSlashIsEscapeCharacterForSql ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"writeTechnologyEngine", _nppGUI._writeTechnologyEngine); + GUIConfigElement->SetAttribute(L"isFolderDroppedOpenFiles", _nppGUI._isFolderDroppedOpenFiles ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"docPeekOnTab", _nppGUI._isDocPeekOnTab ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"docPeekOnMap", _nppGUI._isDocPeekOnMap ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"sortFunctionList", _nppGUI._shouldSortFunctionList ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"saveDlgExtFilterToAllTypes", _nppGUI._setSaveDlgExtFiltToAllTypes ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"muteSounds", _nppGUI._muteSounds ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"enableFoldCmdToggable", _nppGUI._enableFoldCmdToggable ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"hideMenuRightShortcuts", _nppGUI._hideMenuRightShortcuts ? L"yes" : L"no"); } // { - TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("Searching")); + TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"Searching"); - GUIConfigElement->SetAttribute(TEXT("monospacedFontFindDlg"), _nppGUI._monospacedFontFindDlg ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("fillFindFieldWithSelected"), _nppGUI._fillFindFieldWithSelected ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("fillFindFieldSelectCaret"), _nppGUI._fillFindFieldSelectCaret ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("findDlgAlwaysVisible"), _nppGUI._findDlgAlwaysVisible ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("confirmReplaceInAllOpenDocs"), _nppGUI._confirmReplaceInAllOpenDocs ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("replaceStopsWithoutFindingNext"), _nppGUI._replaceStopsWithoutFindingNext ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("inSelectionAutocheckThreshold"), _nppGUI._inSelectionAutocheckThreshold); + GUIConfigElement->SetAttribute(L"monospacedFontFindDlg", _nppGUI._monospacedFontFindDlg ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"fillFindFieldWithSelected", _nppGUI._fillFindFieldWithSelected ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"fillFindFieldSelectCaret", _nppGUI._fillFindFieldSelectCaret ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"findDlgAlwaysVisible", _nppGUI._findDlgAlwaysVisible ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"confirmReplaceInAllOpenDocs", _nppGUI._confirmReplaceInAllOpenDocs ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"replaceStopsWithoutFindingNext", _nppGUI._replaceStopsWithoutFindingNext ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"inSelectionAutocheckThreshold", _nppGUI._inSelectionAutocheckThreshold); } // { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("searchEngine")); - GUIConfigElement->SetAttribute(TEXT("searchEngineChoice"), _nppGUI._searchEngineChoice); - GUIConfigElement->SetAttribute(TEXT("searchEngineCustom"), _nppGUI._searchEngineCustom); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"searchEngine"); + GUIConfigElement->SetAttribute(L"searchEngineChoice", _nppGUI._searchEngineChoice); + GUIConfigElement->SetAttribute(L"searchEngineCustom", _nppGUI._searchEngineCustom); } // { - TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("MarkAll")); - GUIConfigElement->SetAttribute(TEXT("matchCase"), _nppGUI._markAllCaseSensitive ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("wholeWordOnly"), _nppGUI._markAllWordOnly ? TEXT("yes") : TEXT("no")); + TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"MarkAll"); + GUIConfigElement->SetAttribute(L"matchCase", _nppGUI._markAllCaseSensitive ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"wholeWordOnly", _nppGUI._markAllWordOnly ? L"yes" : L"no"); } // yes { - TiXmlElement *GUIConfigElement = insertGUIConfigBoolNode(newGUIRoot, TEXT("SmartHighLight"), _nppGUI._enableSmartHilite); - GUIConfigElement->SetAttribute(TEXT("matchCase"), _nppGUI._smartHiliteCaseSensitive ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("wholeWordOnly"), _nppGUI._smartHiliteWordOnly ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("useFindSettings"), _nppGUI._smartHiliteUseFindSettings ? TEXT("yes") : TEXT("no")); - GUIConfigElement->SetAttribute(TEXT("onAnotherView"), _nppGUI._smartHiliteOnAnotherView ? TEXT("yes") : TEXT("no")); + TiXmlElement *GUIConfigElement = insertGUIConfigBoolNode(newGUIRoot, L"SmartHighLight", _nppGUI._enableSmartHilite); + GUIConfigElement->SetAttribute(L"matchCase", _nppGUI._smartHiliteCaseSensitive ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"wholeWordOnly", _nppGUI._smartHiliteWordOnly ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"useFindSettings", _nppGUI._smartHiliteUseFindSettings ? L"yes" : L"no"); + GUIConfigElement->SetAttribute(L"onAnotherView", _nppGUI._smartHiliteOnAnotherView ? L"yes" : L"no"); } // powershell if (_nppGUI._commandLineInterpreter.compare(CMD_INTERPRETER)) { - TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("commandLineInterpreter")); + TiXmlElement *GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"commandLineInterpreter"); GUIConfigElement->InsertEndChild(TiXmlText(_nppGUI._commandLineInterpreter.c_str())); } // { - TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), TEXT("DarkMode")); + TiXmlElement* GUIConfigElement = (newGUIRoot->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", L"DarkMode"); NppDarkMode::setAdvancedOptions(); - auto setYesNoBoolAttribute = [&GUIConfigElement](const TCHAR* name, bool value) { - const TCHAR* pStr = value ? TEXT("yes") : TEXT("no"); + auto setYesNoBoolAttribute = [&GUIConfigElement](const wchar_t* name, bool value) { + const wchar_t* pStr = value ? L"yes" : L"no"; GUIConfigElement->SetAttribute(name, pStr); }; - setYesNoBoolAttribute(TEXT("enable"), _nppGUI._darkmode._isEnabled); - GUIConfigElement->SetAttribute(TEXT("colorTone"), _nppGUI._darkmode._colorTone); + setYesNoBoolAttribute(L"enable", _nppGUI._darkmode._isEnabled); + GUIConfigElement->SetAttribute(L"colorTone", _nppGUI._darkmode._colorTone); - GUIConfigElement->SetAttribute(TEXT("customColorTop"), _nppGUI._darkmode._customColors.pureBackground); - GUIConfigElement->SetAttribute(TEXT("customColorMenuHotTrack"), _nppGUI._darkmode._customColors.hotBackground); - GUIConfigElement->SetAttribute(TEXT("customColorActive"), _nppGUI._darkmode._customColors.softerBackground); - GUIConfigElement->SetAttribute(TEXT("customColorMain"), _nppGUI._darkmode._customColors.background); - GUIConfigElement->SetAttribute(TEXT("customColorError"), _nppGUI._darkmode._customColors.errorBackground); - GUIConfigElement->SetAttribute(TEXT("customColorText"), _nppGUI._darkmode._customColors.text); - GUIConfigElement->SetAttribute(TEXT("customColorDarkText"), _nppGUI._darkmode._customColors.darkerText); - GUIConfigElement->SetAttribute(TEXT("customColorDisabledText"), _nppGUI._darkmode._customColors.disabledText); - GUIConfigElement->SetAttribute(TEXT("customColorLinkText"), _nppGUI._darkmode._customColors.linkText); - GUIConfigElement->SetAttribute(TEXT("customColorEdge"), _nppGUI._darkmode._customColors.edge); - GUIConfigElement->SetAttribute(TEXT("customColorHotEdge"), _nppGUI._darkmode._customColors.hotEdge); - GUIConfigElement->SetAttribute(TEXT("customColorDisabledEdge"), _nppGUI._darkmode._customColors.disabledEdge); + GUIConfigElement->SetAttribute(L"customColorTop", _nppGUI._darkmode._customColors.pureBackground); + GUIConfigElement->SetAttribute(L"customColorMenuHotTrack", _nppGUI._darkmode._customColors.hotBackground); + GUIConfigElement->SetAttribute(L"customColorActive", _nppGUI._darkmode._customColors.softerBackground); + GUIConfigElement->SetAttribute(L"customColorMain", _nppGUI._darkmode._customColors.background); + GUIConfigElement->SetAttribute(L"customColorError", _nppGUI._darkmode._customColors.errorBackground); + GUIConfigElement->SetAttribute(L"customColorText", _nppGUI._darkmode._customColors.text); + GUIConfigElement->SetAttribute(L"customColorDarkText", _nppGUI._darkmode._customColors.darkerText); + GUIConfigElement->SetAttribute(L"customColorDisabledText", _nppGUI._darkmode._customColors.disabledText); + GUIConfigElement->SetAttribute(L"customColorLinkText", _nppGUI._darkmode._customColors.linkText); + GUIConfigElement->SetAttribute(L"customColorEdge", _nppGUI._darkmode._customColors.edge); + GUIConfigElement->SetAttribute(L"customColorHotEdge", _nppGUI._darkmode._customColors.hotEdge); + GUIConfigElement->SetAttribute(L"customColorDisabledEdge", _nppGUI._darkmode._customColors.disabledEdge); // advanced options section - setYesNoBoolAttribute(TEXT("enableWindowsMode"), _nppGUI._darkmode._advOptions._enableWindowsMode); + setYesNoBoolAttribute(L"enableWindowsMode", _nppGUI._darkmode._advOptions._enableWindowsMode); - GUIConfigElement->SetAttribute(TEXT("darkThemeName"), _nppGUI._darkmode._advOptions._darkDefaults._xmlFileName.c_str()); - GUIConfigElement->SetAttribute(TEXT("darkToolBarIconSet"), _nppGUI._darkmode._advOptions._darkDefaults._toolBarIconSet); - GUIConfigElement->SetAttribute(TEXT("darkTabIconSet"), _nppGUI._darkmode._advOptions._darkDefaults._tabIconSet); - setYesNoBoolAttribute(TEXT("darkTabUseTheme"), _nppGUI._darkmode._advOptions._darkDefaults._tabUseTheme); + GUIConfigElement->SetAttribute(L"darkThemeName", _nppGUI._darkmode._advOptions._darkDefaults._xmlFileName.c_str()); + GUIConfigElement->SetAttribute(L"darkToolBarIconSet", _nppGUI._darkmode._advOptions._darkDefaults._toolBarIconSet); + GUIConfigElement->SetAttribute(L"darkTabIconSet", _nppGUI._darkmode._advOptions._darkDefaults._tabIconSet); + setYesNoBoolAttribute(L"darkTabUseTheme", _nppGUI._darkmode._advOptions._darkDefaults._tabUseTheme); - GUIConfigElement->SetAttribute(TEXT("lightThemeName"), _nppGUI._darkmode._advOptions._lightDefaults._xmlFileName.c_str()); - GUIConfigElement->SetAttribute(TEXT("lightToolBarIconSet"), _nppGUI._darkmode._advOptions._lightDefaults._toolBarIconSet); - GUIConfigElement->SetAttribute(TEXT("lightTabIconSet"), _nppGUI._darkmode._advOptions._lightDefaults._tabIconSet); - setYesNoBoolAttribute(TEXT("lightTabUseTheme"), _nppGUI._darkmode._advOptions._lightDefaults._tabUseTheme); + GUIConfigElement->SetAttribute(L"lightThemeName", _nppGUI._darkmode._advOptions._lightDefaults._xmlFileName.c_str()); + GUIConfigElement->SetAttribute(L"lightToolBarIconSet", _nppGUI._darkmode._advOptions._lightDefaults._toolBarIconSet); + GUIConfigElement->SetAttribute(L"lightTabIconSet", _nppGUI._darkmode._advOptions._lightDefaults._tabIconSet); + setYesNoBoolAttribute(L"lightTabUseTheme", _nppGUI._darkmode._advOptions._lightDefaults._tabUseTheme); } // @@ -7763,75 +7765,75 @@ bool NppParameters::writeFindHistory() { if (!_pXmlUserDoc) return false; - TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(TEXT("NotepadPlus")); + TiXmlNode *nppRoot = _pXmlUserDoc->FirstChild(L"NotepadPlus"); if (!nppRoot) { - nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(TEXT("NotepadPlus"))); + nppRoot = _pXmlUserDoc->InsertEndChild(TiXmlElement(L"NotepadPlus")); } - TiXmlNode *findHistoryRoot = nppRoot->FirstChildElement(TEXT("FindHistory")); + TiXmlNode *findHistoryRoot = nppRoot->FirstChildElement(L"FindHistory"); if (!findHistoryRoot) { - TiXmlElement element(TEXT("FindHistory")); + TiXmlElement element(L"FindHistory"); findHistoryRoot = nppRoot->InsertEndChild(element); } findHistoryRoot->Clear(); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("nbMaxFindHistoryPath"), _findHistory._nbMaxFindHistoryPath); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("nbMaxFindHistoryFilter"), _findHistory._nbMaxFindHistoryFilter); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("nbMaxFindHistoryFind"), _findHistory._nbMaxFindHistoryFind); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("nbMaxFindHistoryReplace"), _findHistory._nbMaxFindHistoryReplace); + (findHistoryRoot->ToElement())->SetAttribute(L"nbMaxFindHistoryPath", _findHistory._nbMaxFindHistoryPath); + (findHistoryRoot->ToElement())->SetAttribute(L"nbMaxFindHistoryFilter", _findHistory._nbMaxFindHistoryFilter); + (findHistoryRoot->ToElement())->SetAttribute(L"nbMaxFindHistoryFind", _findHistory._nbMaxFindHistoryFind); + (findHistoryRoot->ToElement())->SetAttribute(L"nbMaxFindHistoryReplace", _findHistory._nbMaxFindHistoryReplace); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("matchWord"), _findHistory._isMatchWord?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("matchCase"), _findHistory._isMatchCase?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("wrap"), _findHistory._isWrap?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("directionDown"), _findHistory._isDirectionDown?TEXT("yes"):TEXT("no")); + (findHistoryRoot->ToElement())->SetAttribute(L"matchWord", _findHistory._isMatchWord ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"matchCase", _findHistory._isMatchCase ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"wrap", _findHistory._isWrap?L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"directionDown", _findHistory._isDirectionDown ? L"yes" : L"no"); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("fifRecuisive"), _findHistory._isFifRecuisive?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("fifInHiddenFolder"), _findHistory._isFifInHiddenFolder?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("fifProjectPanel1"), _findHistory._isFifProjectPanel_1?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("fifProjectPanel2"), _findHistory._isFifProjectPanel_2?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("fifProjectPanel3"), _findHistory._isFifProjectPanel_3?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("fifFilterFollowsDoc"), _findHistory._isFilterFollowDoc?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("fifFolderFollowsDoc"), _findHistory._isFolderFollowDoc?TEXT("yes"):TEXT("no")); + (findHistoryRoot->ToElement())->SetAttribute(L"fifRecuisive", _findHistory._isFifRecuisive ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"fifInHiddenFolder", _findHistory._isFifInHiddenFolder ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"fifProjectPanel1", _findHistory._isFifProjectPanel_1 ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"fifProjectPanel2", _findHistory._isFifProjectPanel_2 ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"fifProjectPanel3", _findHistory._isFifProjectPanel_3 ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"fifFilterFollowsDoc", _findHistory._isFilterFollowDoc ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"fifFolderFollowsDoc", _findHistory._isFolderFollowDoc ? L"yes" : L"no"); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("searchMode"), _findHistory._searchMode); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("transparencyMode"), _findHistory._transparencyMode); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("transparency"), _findHistory._transparency); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("dotMatchesNewline"), _findHistory._dotMatchesNewline?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("isSearch2ButtonsMode"), _findHistory._isSearch2ButtonsMode?TEXT("yes"):TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("regexBackward4PowerUser"), _findHistory._regexBackward4PowerUser ? TEXT("yes") : TEXT("no")); + (findHistoryRoot->ToElement())->SetAttribute(L"searchMode", _findHistory._searchMode); + (findHistoryRoot->ToElement())->SetAttribute(L"transparencyMode", _findHistory._transparencyMode); + (findHistoryRoot->ToElement())->SetAttribute(L"transparency", _findHistory._transparency); + (findHistoryRoot->ToElement())->SetAttribute(L"dotMatchesNewline", _findHistory._dotMatchesNewline ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"isSearch2ButtonsMode", _findHistory._isSearch2ButtonsMode ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"regexBackward4PowerUser", _findHistory._regexBackward4PowerUser ? L"yes" : L"no"); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("bookmarkLine"), _findHistory._isBookmarkLine ? TEXT("yes") : TEXT("no")); - (findHistoryRoot->ToElement())->SetAttribute(TEXT("purge"), _findHistory._isPurge ? TEXT("yes") : TEXT("no")); + (findHistoryRoot->ToElement())->SetAttribute(L"bookmarkLine", _findHistory._isBookmarkLine ? L"yes" : L"no"); + (findHistoryRoot->ToElement())->SetAttribute(L"purge", _findHistory._isPurge ? L"yes" : L"no"); - TiXmlElement hist_element{TEXT("")}; + TiXmlElement hist_element{L""}; - hist_element.SetValue(TEXT("Path")); + hist_element.SetValue(L"Path"); for (size_t i = 0, len = _findHistory._findHistoryPaths.size(); i < len; ++i) { - (hist_element.ToElement())->SetAttribute(TEXT("name"), _findHistory._findHistoryPaths[i].c_str()); + (hist_element.ToElement())->SetAttribute(L"name", _findHistory._findHistoryPaths[i].c_str()); findHistoryRoot->InsertEndChild(hist_element); } - hist_element.SetValue(TEXT("Filter")); + hist_element.SetValue(L"Filter"); for (size_t i = 0, len = _findHistory._findHistoryFilters.size(); i < len; ++i) { - (hist_element.ToElement())->SetAttribute(TEXT("name"), _findHistory._findHistoryFilters[i].c_str()); + (hist_element.ToElement())->SetAttribute(L"name", _findHistory._findHistoryFilters[i].c_str()); findHistoryRoot->InsertEndChild(hist_element); } - hist_element.SetValue(TEXT("Find")); + hist_element.SetValue(L"Find"); for (size_t i = 0, len = _findHistory._findHistoryFinds.size(); i < len; ++i) { - (hist_element.ToElement())->SetAttribute(TEXT("name"), _findHistory._findHistoryFinds[i].c_str()); + (hist_element.ToElement())->SetAttribute(L"name", _findHistory._findHistoryFinds[i].c_str()); findHistoryRoot->InsertEndChild(hist_element); } - hist_element.SetValue(TEXT("Replace")); + hist_element.SetValue(L"Replace"); for (size_t i = 0, len = _findHistory._findHistoryReplaces.size(); i < len; ++i) { - (hist_element.ToElement())->SetAttribute(TEXT("name"), _findHistory._findHistoryReplaces[i].c_str()); + (hist_element.ToElement())->SetAttribute(L"name", _findHistory._findHistoryReplaces[i].c_str()); findHistoryRoot->InsertEndChild(hist_element); } @@ -7840,22 +7842,22 @@ bool NppParameters::writeFindHistory() void NppParameters::insertDockingParamNode(TiXmlNode *GUIRoot) { - TiXmlElement DMNode(TEXT("GUIConfig")); - DMNode.SetAttribute(TEXT("name"), TEXT("DockingManager")); - DMNode.SetAttribute(TEXT("leftWidth"), _nppGUI._dockingData._leftWidth); - DMNode.SetAttribute(TEXT("rightWidth"), _nppGUI._dockingData._rightWidth); - DMNode.SetAttribute(TEXT("topHeight"), _nppGUI._dockingData._topHeight); - DMNode.SetAttribute(TEXT("bottomHeight"), _nppGUI._dockingData._bottomHeight); + TiXmlElement DMNode(L"GUIConfig"); + DMNode.SetAttribute(L"name", L"DockingManager"); + DMNode.SetAttribute(L"leftWidth", _nppGUI._dockingData._leftWidth); + DMNode.SetAttribute(L"rightWidth", _nppGUI._dockingData._rightWidth); + DMNode.SetAttribute(L"topHeight", _nppGUI._dockingData._topHeight); + DMNode.SetAttribute(L"bottomHeight", _nppGUI._dockingData._bottomHeight); for (size_t i = 0, len = _nppGUI._dockingData._floatingWindowInfo.size(); i < len ; ++i) { FloatingWindowInfo & fwi = _nppGUI._dockingData._floatingWindowInfo[i]; - TiXmlElement FWNode(TEXT("FloatingWindow")); - FWNode.SetAttribute(TEXT("cont"), fwi._cont); - FWNode.SetAttribute(TEXT("x"), fwi._pos.left); - FWNode.SetAttribute(TEXT("y"), fwi._pos.top); - FWNode.SetAttribute(TEXT("width"), fwi._pos.right); - FWNode.SetAttribute(TEXT("height"), fwi._pos.bottom); + TiXmlElement FWNode(L"FloatingWindow"); + FWNode.SetAttribute(L"cont", fwi._cont); + FWNode.SetAttribute(L"x", fwi._pos.left); + FWNode.SetAttribute(L"y", fwi._pos.top); + FWNode.SetAttribute(L"width", fwi._pos.right); + FWNode.SetAttribute(L"height", fwi._pos.bottom); DMNode.InsertEndChild(FWNode); } @@ -7863,12 +7865,12 @@ void NppParameters::insertDockingParamNode(TiXmlNode *GUIRoot) for (size_t i = 0, len = _nppGUI._dockingData._pluginDockInfo.size() ; i < len ; ++i) { PluginDlgDockingInfo & pdi = _nppGUI._dockingData._pluginDockInfo[i]; - TiXmlElement PDNode(TEXT("PluginDlg")); - PDNode.SetAttribute(TEXT("pluginName"), pdi._name); - PDNode.SetAttribute(TEXT("id"), pdi._internalID); - PDNode.SetAttribute(TEXT("curr"), pdi._currContainer); - PDNode.SetAttribute(TEXT("prev"), pdi._prevContainer); - PDNode.SetAttribute(TEXT("isVisible"), pdi._isVisible?TEXT("yes"):TEXT("no")); + TiXmlElement PDNode(L"PluginDlg"); + PDNode.SetAttribute(L"pluginName", pdi._name); + PDNode.SetAttribute(L"id", pdi._internalID); + PDNode.SetAttribute(L"curr", pdi._currContainer); + PDNode.SetAttribute(L"prev", pdi._prevContainer); + PDNode.SetAttribute(L"isVisible", pdi._isVisible ? L"yes" : L"no"); DMNode.InsertEndChild(PDNode); } @@ -7876,9 +7878,9 @@ void NppParameters::insertDockingParamNode(TiXmlNode *GUIRoot) for (size_t i = 0, len = _nppGUI._dockingData._containerTabInfo.size(); i < len ; ++i) { ContainerTabInfo & cti = _nppGUI._dockingData._containerTabInfo[i]; - TiXmlElement CTNode(TEXT("ActiveTabs")); - CTNode.SetAttribute(TEXT("cont"), cti._cont); - CTNode.SetAttribute(TEXT("activeTab"), cti._activeTab); + TiXmlElement CTNode(L"ActiveTabs"); + CTNode.SetAttribute(L"cont", cti._cont); + CTNode.SetAttribute(L"activeTab", cti._activeTab); DMNode.InsertEndChild(CTNode); } @@ -7887,29 +7889,29 @@ void NppParameters::insertDockingParamNode(TiXmlNode *GUIRoot) void NppParameters::writePrintSetting(TiXmlElement *element) { - const TCHAR *pStr = _nppGUI._printSettings._printLineNumber?TEXT("yes"):TEXT("no"); - element->SetAttribute(TEXT("lineNumber"), pStr); + const wchar_t *pStr = _nppGUI._printSettings._printLineNumber ? L"yes" : L"no"; + element->SetAttribute(L"lineNumber", pStr); - element->SetAttribute(TEXT("printOption"), _nppGUI._printSettings._printOption); + element->SetAttribute(L"printOption", _nppGUI._printSettings._printOption); - element->SetAttribute(TEXT("headerLeft"), _nppGUI._printSettings._headerLeft.c_str()); - element->SetAttribute(TEXT("headerMiddle"), _nppGUI._printSettings._headerMiddle.c_str()); - element->SetAttribute(TEXT("headerRight"), _nppGUI._printSettings._headerRight.c_str()); - element->SetAttribute(TEXT("footerLeft"), _nppGUI._printSettings._footerLeft.c_str()); - element->SetAttribute(TEXT("footerMiddle"), _nppGUI._printSettings._footerMiddle.c_str()); - element->SetAttribute(TEXT("footerRight"), _nppGUI._printSettings._footerRight.c_str()); + element->SetAttribute(L"headerLeft", _nppGUI._printSettings._headerLeft.c_str()); + element->SetAttribute(L"headerMiddle", _nppGUI._printSettings._headerMiddle.c_str()); + element->SetAttribute(L"headerRight", _nppGUI._printSettings._headerRight.c_str()); + element->SetAttribute(L"footerLeft", _nppGUI._printSettings._footerLeft.c_str()); + element->SetAttribute(L"footerMiddle", _nppGUI._printSettings._footerMiddle.c_str()); + element->SetAttribute(L"footerRight", _nppGUI._printSettings._footerRight.c_str()); - element->SetAttribute(TEXT("headerFontName"), _nppGUI._printSettings._headerFontName.c_str()); - element->SetAttribute(TEXT("headerFontStyle"), _nppGUI._printSettings._headerFontStyle); - element->SetAttribute(TEXT("headerFontSize"), _nppGUI._printSettings._headerFontSize); - element->SetAttribute(TEXT("footerFontName"), _nppGUI._printSettings._footerFontName.c_str()); - element->SetAttribute(TEXT("footerFontStyle"), _nppGUI._printSettings._footerFontStyle); - element->SetAttribute(TEXT("footerFontSize"), _nppGUI._printSettings._footerFontSize); + element->SetAttribute(L"headerFontName", _nppGUI._printSettings._headerFontName.c_str()); + element->SetAttribute(L"headerFontStyle", _nppGUI._printSettings._headerFontStyle); + element->SetAttribute(L"headerFontSize", _nppGUI._printSettings._headerFontSize); + element->SetAttribute(L"footerFontName", _nppGUI._printSettings._footerFontName.c_str()); + element->SetAttribute(L"footerFontStyle", _nppGUI._printSettings._footerFontStyle); + element->SetAttribute(L"footerFontSize", _nppGUI._printSettings._footerFontSize); - element->SetAttribute(TEXT("margeLeft"), _nppGUI._printSettings._marge.left); - element->SetAttribute(TEXT("margeRight"), _nppGUI._printSettings._marge.right); - element->SetAttribute(TEXT("margeTop"), _nppGUI._printSettings._marge.top); - element->SetAttribute(TEXT("margeBottom"), _nppGUI._printSettings._marge.bottom); + element->SetAttribute(L"margeLeft", _nppGUI._printSettings._marge.left); + element->SetAttribute(L"margeRight", _nppGUI._printSettings._marge.right); + element->SetAttribute(L"margeTop", _nppGUI._printSettings._marge.top); + element->SetAttribute(L"margeBottom", _nppGUI._printSettings._marge.bottom); } void NppParameters::writeExcludedLangList(TiXmlElement *element) @@ -7984,26 +7986,26 @@ void NppParameters::writeExcludedLangList(TiXmlElement *element) } } - element->SetAttribute(TEXT("gr0"), g0); - element->SetAttribute(TEXT("gr1"), g1); - element->SetAttribute(TEXT("gr2"), g2); - element->SetAttribute(TEXT("gr3"), g3); - element->SetAttribute(TEXT("gr4"), g4); - element->SetAttribute(TEXT("gr5"), g5); - element->SetAttribute(TEXT("gr6"), g6); - element->SetAttribute(TEXT("gr7"), g7); - element->SetAttribute(TEXT("gr8"), g8); - element->SetAttribute(TEXT("gr9"), g9); - element->SetAttribute(TEXT("gr10"), g10); - element->SetAttribute(TEXT("gr11"), g11); - element->SetAttribute(TEXT("gr12"), g12); + element->SetAttribute(L"gr0", g0); + element->SetAttribute(L"gr1", g1); + element->SetAttribute(L"gr2", g2); + element->SetAttribute(L"gr3", g3); + element->SetAttribute(L"gr4", g4); + element->SetAttribute(L"gr5", g5); + element->SetAttribute(L"gr6", g6); + element->SetAttribute(L"gr7", g7); + element->SetAttribute(L"gr8", g8); + element->SetAttribute(L"gr9", g9); + element->SetAttribute(L"gr10", g10); + element->SetAttribute(L"gr11", g11); + element->SetAttribute(L"gr12", g12); } -TiXmlElement * NppParameters::insertGUIConfigBoolNode(TiXmlNode *r2w, const TCHAR *name, bool bVal) +TiXmlElement * NppParameters::insertGUIConfigBoolNode(TiXmlNode *r2w, const wchar_t *name, bool bVal) { - const TCHAR *pStr = bVal?TEXT("yes"):TEXT("no"); - TiXmlElement *GUIConfigElement = (r2w->InsertEndChild(TiXmlElement(TEXT("GUIConfig"))))->ToElement(); - GUIConfigElement->SetAttribute(TEXT("name"), name); + const wchar_t *pStr = bVal ? L"yes" : L"no"; + TiXmlElement *GUIConfigElement = (r2w->InsertEndChild(TiXmlElement(L"GUIConfig")))->ToElement(); + GUIConfigElement->SetAttribute(L"name", name); GUIConfigElement->InsertEndChild(TiXmlText(pStr)); return GUIConfigElement; } @@ -8261,22 +8263,22 @@ std::wstring NppParameters:: getWinVersionStr() const { switch (_winVersion) { - case WV_WIN32S: return TEXT("Windows 3.1"); - case WV_95: return TEXT("Windows 95"); - case WV_98: return TEXT("Windows 98"); - case WV_ME: return TEXT("Windows Millennium Edition"); - case WV_NT: return TEXT("Windows NT"); - case WV_W2K: return TEXT("Windows 2000"); - case WV_XP: return TEXT("Windows XP"); - case WV_S2003: return TEXT("Windows Server 2003"); - case WV_XPX64: return TEXT("Windows XP 64 bits"); - case WV_VISTA: return TEXT("Windows Vista"); - case WV_WIN7: return TEXT("Windows 7"); - case WV_WIN8: return TEXT("Windows 8"); - case WV_WIN81: return TEXT("Windows 8.1"); - case WV_WIN10: return TEXT("Windows 10"); - case WV_WIN11: return TEXT("Windows 11"); - default: /*case WV_UNKNOWN:*/ return TEXT("Windows unknown version"); + case WV_WIN32S: return L"Windows 3.1"; + case WV_95: return L"Windows 95"; + case WV_98: return L"Windows 98"; + case WV_ME: return L"Windows Millennium Edition"; + case WV_NT: return L"Windows NT"; + case WV_W2K: return L"Windows 2000"; + case WV_XP: return L"Windows XP"; + case WV_S2003: return L"Windows Server 2003"; + case WV_XPX64: return L"Windows XP 64 bits"; + case WV_VISTA: return L"Windows Vista"; + case WV_WIN7: return L"Windows 7"; + case WV_WIN8: return L"Windows 8"; + case WV_WIN81: return L"Windows 8.1"; + case WV_WIN10: return L"Windows 10"; + case WV_WIN11: return L"Windows 11"; + default: /*case WV_UNKNOWN:*/ return L"Windows unknown version"; } } @@ -8285,41 +8287,41 @@ std::wstring NppParameters::getWinVerBitStr() const switch (_platForm) { case PF_X86: - return TEXT("32-bit"); + return L"32-bit"; case PF_X64: case PF_IA64: case PF_ARM64: - return TEXT("64-bit"); + return L"64-bit"; default: - return TEXT("Unknown-bit"); + return L"Unknown-bit"; } } std::wstring NppParameters::writeStyles(LexerStylerArray & lexersStylers, StyleArray & globalStylers) { - TiXmlNode *lexersRoot = (_pXmlUserStylerDoc->FirstChild(TEXT("NotepadPlus")))->FirstChildElement(TEXT("LexerStyles")); - for (TiXmlNode *childNode = lexersRoot->FirstChildElement(TEXT("LexerType")); + TiXmlNode *lexersRoot = (_pXmlUserStylerDoc->FirstChild(L"NotepadPlus"))->FirstChildElement(L"LexerStyles"); + for (TiXmlNode *childNode = lexersRoot->FirstChildElement(L"LexerType"); childNode ; - childNode = childNode->NextSibling(TEXT("LexerType"))) + childNode = childNode->NextSibling(L"LexerType")) { TiXmlElement *element = childNode->ToElement(); - const TCHAR *nm = element->Attribute(TEXT("name")); + const wchar_t *nm = element->Attribute(L"name"); LexerStyler *pLs = _lexerStylerVect.getLexerStylerByName(nm); LexerStyler *pLs2 = lexersStylers.getLexerStylerByName(nm); if (pLs) { - const TCHAR *extStr = pLs->getLexerUserExt(); - element->SetAttribute(TEXT("ext"), extStr); - for (TiXmlNode *grChildNode = childNode->FirstChildElement(TEXT("WordsStyle")); + const wchar_t *extStr = pLs->getLexerUserExt(); + element->SetAttribute(L"ext", extStr); + for (TiXmlNode *grChildNode = childNode->FirstChildElement(L"WordsStyle"); grChildNode ; - grChildNode = grChildNode->NextSibling(TEXT("WordsStyle"))) + grChildNode = grChildNode->NextSibling(L"WordsStyle")) { TiXmlElement *grElement = grChildNode->ToElement(); - const TCHAR *styleName = grElement->Attribute(TEXT("name")); + const wchar_t *styleName = grElement->Attribute(L"name"); const Style * pStyle = pLs->findByName(styleName); Style * pStyle2Sync = pLs2 ? pLs2->findByName(styleName) : nullptr; if (pStyle && pStyle2Sync) @@ -8332,28 +8334,28 @@ std::wstring NppParameters::writeStyles(LexerStylerArray & lexersStylers, StyleA for (size_t x = 0; x < _pXmlExternalLexerDoc.size(); ++x) { - TiXmlNode* lexersRoot2 = ( _pXmlExternalLexerDoc[x]->FirstChild(TEXT("NotepadPlus")))->FirstChildElement(TEXT("LexerStyles")); - for (TiXmlNode* childNode = lexersRoot2->FirstChildElement(TEXT("LexerType")); + TiXmlNode* lexersRoot2 = ( _pXmlExternalLexerDoc[x]->FirstChild(L"NotepadPlus"))->FirstChildElement(L"LexerStyles"); + for (TiXmlNode* childNode = lexersRoot2->FirstChildElement(L"LexerType"); childNode ; - childNode = childNode->NextSibling(TEXT("LexerType"))) + childNode = childNode->NextSibling(L"LexerType")) { TiXmlElement *element = childNode->ToElement(); - const TCHAR *nm = element->Attribute(TEXT("name")); + const wchar_t *nm = element->Attribute(L"name"); LexerStyler *pLs = _lexerStylerVect.getLexerStylerByName(nm); LexerStyler *pLs2 = lexersStylers.getLexerStylerByName(nm); if (pLs) { - const TCHAR *extStr = pLs->getLexerUserExt(); - element->SetAttribute(TEXT("ext"), extStr); + const wchar_t *extStr = pLs->getLexerUserExt(); + element->SetAttribute(L"ext", extStr); - for (TiXmlNode *grChildNode = childNode->FirstChildElement(TEXT("WordsStyle")); + for (TiXmlNode *grChildNode = childNode->FirstChildElement(L"WordsStyle"); grChildNode ; - grChildNode = grChildNode->NextSibling(TEXT("WordsStyle"))) + grChildNode = grChildNode->NextSibling(L"WordsStyle")) { TiXmlElement *grElement = grChildNode->ToElement(); - const TCHAR *styleName = grElement->Attribute(TEXT("name")); + const wchar_t *styleName = grElement->Attribute(L"name"); const Style * pStyle = pLs->findByName(styleName); Style * pStyle2Sync = pLs2 ? pLs2->findByName(styleName) : nullptr; if (pStyle && pStyle2Sync) @@ -8366,14 +8368,14 @@ std::wstring NppParameters::writeStyles(LexerStylerArray & lexersStylers, StyleA _pXmlExternalLexerDoc[x]->SaveFile(); } - TiXmlNode *globalStylesRoot = (_pXmlUserStylerDoc->FirstChild(TEXT("NotepadPlus")))->FirstChildElement(TEXT("GlobalStyles")); + TiXmlNode *globalStylesRoot = (_pXmlUserStylerDoc->FirstChild(L"NotepadPlus"))->FirstChildElement(L"GlobalStyles"); - for (TiXmlNode *childNode = globalStylesRoot->FirstChildElement(TEXT("WidgetStyle")); + for (TiXmlNode *childNode = globalStylesRoot->FirstChildElement(L"WidgetStyle"); childNode ; - childNode = childNode->NextSibling(TEXT("WidgetStyle"))) + childNode = childNode->NextSibling(L"WidgetStyle")) { TiXmlElement *pElement = childNode->ToElement(); - const TCHAR *styleName = pElement->Attribute(TEXT("name")); + const wchar_t *styleName = pElement->Attribute(L"name"); const Style * pStyle = _widgetStyleArray.findByName(styleName); Style * pStyle2Sync = globalStylers.findByName(styleName); if (pStyle && pStyle2Sync) @@ -8392,24 +8394,24 @@ std::wstring NppParameters::writeStyles(LexerStylerArray & lexersStylers, StyleA return savePath; } } - return TEXT(""); + return L""; } -bool NppParameters::insertTabInfo(const TCHAR* langName, int tabInfo, bool backspaceUnindent) +bool NppParameters::insertTabInfo(const wchar_t* langName, int tabInfo, bool backspaceUnindent) { if (!_pXmlDoc) return false; - TiXmlNode *langRoot = (_pXmlDoc->FirstChild(TEXT("NotepadPlus")))->FirstChildElement(TEXT("Languages")); - for (TiXmlNode *childNode = langRoot->FirstChildElement(TEXT("Language")); + TiXmlNode *langRoot = (_pXmlDoc->FirstChild(L"NotepadPlus"))->FirstChildElement(L"Languages"); + for (TiXmlNode *childNode = langRoot->FirstChildElement(L"Language"); childNode ; - childNode = childNode->NextSibling(TEXT("Language"))) + childNode = childNode->NextSibling(L"Language")) { TiXmlElement *element = childNode->ToElement(); - const TCHAR *nm = element->Attribute(TEXT("name")); + const wchar_t *nm = element->Attribute(L"name"); if (nm && lstrcmp(langName, nm) == 0) { - childNode->ToElement()->SetAttribute(TEXT("tabSettings"), tabInfo); - childNode->ToElement()->SetAttribute(TEXT("backspaceUnindent"), backspaceUnindent ? TEXT("yes") : TEXT("no")); + childNode->ToElement()->SetAttribute(L"tabSettings", tabInfo); + childNode->ToElement()->SetAttribute(L"backspaceUnindent", backspaceUnindent ? L"yes" : L"no"); _pXmlDoc->SaveFile(); return true; } @@ -8422,30 +8424,30 @@ void NppParameters::writeStyle2Element(const Style & style2Write, Style & style2 if (HIBYTE(HIWORD(style2Write._fgColor)) != 0xFF) { int rgbVal = RGB2int(style2Write._fgColor); - TCHAR fgStr[7]; - wsprintf(fgStr, TEXT("%.6X"), rgbVal); - element->SetAttribute(TEXT("fgColor"), fgStr); + wchar_t fgStr[7]; + wsprintf(fgStr, L"%.6X", rgbVal); + element->SetAttribute(L"fgColor", fgStr); } if (HIBYTE(HIWORD(style2Write._bgColor)) != 0xFF) { int rgbVal = RGB2int(style2Write._bgColor); - TCHAR bgStr[7]; - wsprintf(bgStr, TEXT("%.6X"), rgbVal); - element->SetAttribute(TEXT("bgColor"), bgStr); + wchar_t bgStr[7]; + wsprintf(bgStr, L"%.6X", rgbVal); + element->SetAttribute(L"bgColor", bgStr); } if (style2Write._colorStyle != COLORSTYLE_ALL) { - element->SetAttribute(TEXT("colorStyle"), style2Write._colorStyle); + element->SetAttribute(L"colorStyle", style2Write._colorStyle); } if (!style2Write._fontName.empty()) { - const TCHAR * oldFontName = element->Attribute(TEXT("fontName")); + const wchar_t * oldFontName = element->Attribute(L"fontName"); if (oldFontName && oldFontName != style2Write._fontName) { - element->SetAttribute(TEXT("fontName"), style2Write._fontName); + element->SetAttribute(L"fontName", style2Write._fontName); style2Sync._fontName = style2Write._fontName; } } @@ -8453,14 +8455,14 @@ void NppParameters::writeStyle2Element(const Style & style2Write, Style & style2 if (style2Write._fontSize != STYLE_NOT_USED) { if (!style2Write._fontSize) - element->SetAttribute(TEXT("fontSize"), TEXT("")); + element->SetAttribute(L"fontSize", L""); else - element->SetAttribute(TEXT("fontSize"), style2Write._fontSize); + element->SetAttribute(L"fontSize", style2Write._fontSize); } if (style2Write._fontStyle != STYLE_NOT_USED) { - element->SetAttribute(TEXT("fontStyle"), style2Write._fontStyle); + element->SetAttribute(L"fontStyle", style2Write._fontStyle); } @@ -8477,98 +8479,98 @@ void NppParameters::writeStyle2Element(const Style & style2Write, Style & style2 void NppParameters::insertUserLang2Tree(TiXmlNode *node, UserLangContainer *userLang) { - TiXmlElement *rootElement = (node->InsertEndChild(TiXmlElement(TEXT("UserLang"))))->ToElement(); + TiXmlElement *rootElement = (node->InsertEndChild(TiXmlElement(L"UserLang")))->ToElement(); - TCHAR temp[32]; + wchar_t temp[32]; std::wstring udlVersion; udlVersion += _itow(SCE_UDL_VERSION_MAJOR, temp, 10); - udlVersion += TEXT("."); + udlVersion += L"."; udlVersion += _itow(SCE_UDL_VERSION_MINOR, temp, 10); - rootElement->SetAttribute(TEXT("name"), userLang->_name); - rootElement->SetAttribute(TEXT("ext"), userLang->_ext); + rootElement->SetAttribute(L"name", userLang->_name); + rootElement->SetAttribute(L"ext", userLang->_ext); if (userLang->_isDarkModeTheme) - rootElement->SetAttribute(TEXT("darkModeTheme"), TEXT("yes")); - rootElement->SetAttribute(TEXT("udlVersion"), udlVersion.c_str()); + rootElement->SetAttribute(L"darkModeTheme", L"yes"); + rootElement->SetAttribute(L"udlVersion", udlVersion.c_str()); - TiXmlElement *settingsElement = (rootElement->InsertEndChild(TiXmlElement(TEXT("Settings"))))->ToElement(); + TiXmlElement *settingsElement = (rootElement->InsertEndChild(TiXmlElement(L"Settings")))->ToElement(); { - TiXmlElement *globalElement = (settingsElement->InsertEndChild(TiXmlElement(TEXT("Global"))))->ToElement(); - globalElement->SetAttribute(TEXT("caseIgnored"), userLang->_isCaseIgnored ? TEXT("yes"):TEXT("no")); - globalElement->SetAttribute(TEXT("allowFoldOfComments"), userLang->_allowFoldOfComments ? TEXT("yes"):TEXT("no")); - globalElement->SetAttribute(TEXT("foldCompact"), userLang->_foldCompact ? TEXT("yes"):TEXT("no")); - globalElement->SetAttribute(TEXT("forcePureLC"), userLang->_forcePureLC); - globalElement->SetAttribute(TEXT("decimalSeparator"), userLang->_decimalSeparator); + TiXmlElement *globalElement = (settingsElement->InsertEndChild(TiXmlElement(L"Global")))->ToElement(); + globalElement->SetAttribute(L"caseIgnored", userLang->_isCaseIgnored ? L"yes" : L"no"); + globalElement->SetAttribute(L"allowFoldOfComments", userLang->_allowFoldOfComments ? L"yes" : L"no"); + globalElement->SetAttribute(L"foldCompact", userLang->_foldCompact ? L"yes" : L"no"); + globalElement->SetAttribute(L"forcePureLC", userLang->_forcePureLC); + globalElement->SetAttribute(L"decimalSeparator", userLang->_decimalSeparator); - TiXmlElement *prefixElement = (settingsElement->InsertEndChild(TiXmlElement(TEXT("Prefix"))))->ToElement(); + TiXmlElement *prefixElement = (settingsElement->InsertEndChild(TiXmlElement(L"Prefix")))->ToElement(); for (int i = 0 ; i < SCE_USER_TOTAL_KEYWORD_GROUPS ; ++i) - prefixElement->SetAttribute(globalMappper().keywordNameMapper[i+SCE_USER_KWLIST_KEYWORDS1], userLang->_isPrefix[i]?TEXT("yes"):TEXT("no")); + prefixElement->SetAttribute(globalMappper().keywordNameMapper[i+SCE_USER_KWLIST_KEYWORDS1], userLang->_isPrefix[i]?L"yes" : L"no"); } - TiXmlElement *kwlElement = (rootElement->InsertEndChild(TiXmlElement(TEXT("KeywordLists"))))->ToElement(); + TiXmlElement *kwlElement = (rootElement->InsertEndChild(TiXmlElement(L"KeywordLists")))->ToElement(); for (int i = 0 ; i < SCE_USER_KWLIST_TOTAL ; ++i) { - TiXmlElement *kwElement = (kwlElement->InsertEndChild(TiXmlElement(TEXT("Keywords"))))->ToElement(); - kwElement->SetAttribute(TEXT("name"), globalMappper().keywordNameMapper[i]); + TiXmlElement *kwElement = (kwlElement->InsertEndChild(TiXmlElement(L"Keywords")))->ToElement(); + kwElement->SetAttribute(L"name", globalMappper().keywordNameMapper[i]); kwElement->InsertEndChild(TiXmlText(userLang->_keywordLists[i])); } - TiXmlElement *styleRootElement = (rootElement->InsertEndChild(TiXmlElement(TEXT("Styles"))))->ToElement(); + TiXmlElement *styleRootElement = (rootElement->InsertEndChild(TiXmlElement(L"Styles")))->ToElement(); for (const Style & style2Write : userLang->_styles) { - TiXmlElement *styleElement = (styleRootElement->InsertEndChild(TiXmlElement(TEXT("WordsStyle"))))->ToElement(); + TiXmlElement *styleElement = (styleRootElement->InsertEndChild(TiXmlElement(L"WordsStyle")))->ToElement(); if (style2Write._styleID == -1) continue; - styleElement->SetAttribute(TEXT("name"), style2Write._styleDesc); + styleElement->SetAttribute(L"name", style2Write._styleDesc); //if (HIBYTE(HIWORD(style2Write._fgColor)) != 0xFF) { int rgbVal = RGB2int(style2Write._fgColor); - TCHAR fgStr[7]; - wsprintf(fgStr, TEXT("%.6X"), rgbVal); - styleElement->SetAttribute(TEXT("fgColor"), fgStr); + wchar_t fgStr[7]; + wsprintf(fgStr, L"%.6X", rgbVal); + styleElement->SetAttribute(L"fgColor", fgStr); } //if (HIBYTE(HIWORD(style2Write._bgColor)) != 0xFF) { int rgbVal = RGB2int(style2Write._bgColor); - TCHAR bgStr[7]; - wsprintf(bgStr, TEXT("%.6X"), rgbVal); - styleElement->SetAttribute(TEXT("bgColor"), bgStr); + wchar_t bgStr[7]; + wsprintf(bgStr, L"%.6X", rgbVal); + styleElement->SetAttribute(L"bgColor", bgStr); } if (style2Write._colorStyle != COLORSTYLE_ALL) { - styleElement->SetAttribute(TEXT("colorStyle"), style2Write._colorStyle); + styleElement->SetAttribute(L"colorStyle", style2Write._colorStyle); } if (!style2Write._fontName.empty()) { - styleElement->SetAttribute(TEXT("fontName"), style2Write._fontName); + styleElement->SetAttribute(L"fontName", style2Write._fontName); } if (style2Write._fontStyle == STYLE_NOT_USED) { - styleElement->SetAttribute(TEXT("fontStyle"), TEXT("0")); + styleElement->SetAttribute(L"fontStyle", L"0"); } else { - styleElement->SetAttribute(TEXT("fontStyle"), style2Write._fontStyle); + styleElement->SetAttribute(L"fontStyle", style2Write._fontStyle); } if (style2Write._fontSize != STYLE_NOT_USED) { if (!style2Write._fontSize) - styleElement->SetAttribute(TEXT("fontSize"), TEXT("")); + styleElement->SetAttribute(L"fontSize", L""); else - styleElement->SetAttribute(TEXT("fontSize"), style2Write._fontSize); + styleElement->SetAttribute(L"fontSize", style2Write._fontSize); } - styleElement->SetAttribute(TEXT("nesting"), style2Write._nesting); + styleElement->SetAttribute(L"nesting", style2Write._nesting); } } @@ -8628,7 +8630,7 @@ void NppParameters::addScintillaModifiedIndex(int index) void NppParameters::safeWow64EnableWow64FsRedirection(BOOL Wow64FsEnableRedirection) { - HMODULE kernel = GetModuleHandle(TEXT("kernel32")); + HMODULE kernel = GetModuleHandle(L"kernel32"); if (kernel) { BOOL isWow64 = FALSE; @@ -8721,7 +8723,7 @@ void NppParameters::setUdlXmlDirtyFromXmlDoc(const TiXmlDocument* xmlDoc) } } -Date::Date(const TCHAR *dateStr) +Date::Date(const wchar_t *dateStr) { // timeStr should be Notepad++ date format : YYYYMMDD assert(dateStr); diff --git a/PowerEditor/src/Parameters.h b/PowerEditor/src/Parameters.h index eb1c7a784..8a3ab7917 100644 --- a/PowerEditor/src/Parameters.h +++ b/PowerEditor/src/Parameters.h @@ -47,7 +47,7 @@ #endif -#define CMD_INTERPRETER TEXT("%COMSPEC%") +#define CMD_INTERPRETER L"%COMSPEC%" class NativeLangSpeaker; @@ -150,17 +150,17 @@ const int COPYDATA_FULL_CMDLINE = 3; const int FINDREPLACE_INSELECTION_THRESHOLD_DEFAULT = 1024; -const TCHAR fontSizeStrs[][3] = {TEXT(""), TEXT("5"), TEXT("6"), TEXT("7"), TEXT("8"), TEXT("9"), TEXT("10"), TEXT("11"), TEXT("12"), TEXT("14"), TEXT("16"), TEXT("18"), TEXT("20"), TEXT("22"), TEXT("24"), TEXT("26"), TEXT("28")}; +const wchar_t fontSizeStrs[][3] = {L"", L"5", L"6", L"7", L"8", L"9", L"10", L"11", L"12", L"14", L"16", L"18", L"20", L"22", L"24", L"26", L"28"}; -const TCHAR localConfFile[] = TEXT("doLocalConf.xml"); -const TCHAR notepadStyleFile[] = TEXT("asNotepad.xml"); +const wchar_t localConfFile[] = L"doLocalConf.xml"; +const wchar_t notepadStyleFile[] = L"asNotepad.xml"; // issue xml/log file name -const TCHAR nppLogNetworkDriveIssue[] = TEXT("nppLogNetworkDriveIssue"); -const TCHAR nppLogNulContentCorruptionIssue[] = TEXT("nppLogNulContentCorruptionIssue"); +const wchar_t nppLogNetworkDriveIssue[] = L"nppLogNetworkDriveIssue"; +const wchar_t nppLogNulContentCorruptionIssue[] = L"nppLogNulContentCorruptionIssue"; -void cutString(const TCHAR *str2cut, std::vector & patternVect); -void cutStringBy(const TCHAR *str2cut, std::vector & patternVect, char byChar, bool allowEmptyStr); +void cutString(const wchar_t *str2cut, std::vector & patternVect); +void cutStringBy(const wchar_t *str2cut, std::vector & patternVect, char byChar, bool allowEmptyStr); // style names const wchar_t g_npcStyleName[] = L"Non-printing characters custom color"; @@ -203,7 +203,7 @@ public: struct sessionFileInfo : public Position { - sessionFileInfo(const wchar_t* fn, const TCHAR *ln, int encoding, bool userReadOnly, const Position& pos, const TCHAR *backupFilePath, FILETIME originalFileLastModifTimestamp, const MapPosition & mapPos) : + sessionFileInfo(const wchar_t* fn, const wchar_t *ln, int encoding, bool userReadOnly, const Position& pos, const wchar_t *backupFilePath, FILETIME originalFileLastModifTimestamp, const MapPosition & mapPos) : Position(pos), _encoding(encoding), _isUserReadOnly(userReadOnly), _originalFileLastModifTimestamp(originalFileLastModifTimestamp), _mapPos(mapPos) { if (fn) _fileName = fn; @@ -352,7 +352,7 @@ struct PluginDlgDockingInfo final int _prevContainer = -1; bool _isVisible = false; - PluginDlgDockingInfo(const TCHAR* pluginName, int id, int curr, int prev, bool isVis) + PluginDlgDockingInfo(const wchar_t* pluginName, int id, int curr, int prev, bool isVis) : _name(pluginName), _internalID(id), _currContainer(curr), _prevContainer(prev), _isVisible(isVis) {} @@ -515,23 +515,23 @@ public: return *this; } - void setLexerName(const TCHAR *lexerName) + void setLexerName(const wchar_t *lexerName) { _lexerName = lexerName; } - void setLexerDesc(const TCHAR *lexerDesc) + void setLexerDesc(const wchar_t *lexerDesc) { _lexerDesc = lexerDesc; } - void setLexerUserExt(const TCHAR *lexerUserExt) { + void setLexerUserExt(const wchar_t *lexerUserExt) { _lexerUserExt = lexerUserExt; }; - const TCHAR * getLexerName() const {return _lexerName.c_str();}; - const TCHAR * getLexerDesc() const {return _lexerDesc.c_str();}; - const TCHAR * getLexerUserExt() const {return _lexerUserExt.c_str();}; + const wchar_t * getLexerName() const {return _lexerName.c_str();}; + const wchar_t * getLexerDesc() const {return _lexerDesc.c_str();}; + const wchar_t * getLexerUserExt() const {return _lexerUserExt.c_str();}; private : std::wstring _lexerName; @@ -541,9 +541,9 @@ private : struct SortLexersInAlphabeticalOrder { bool operator() (const LexerStyler& l, const LexerStyler& r) { - if (!lstrcmp(l.getLexerDesc(), TEXT("Search result"))) + if (!lstrcmp(l.getLexerDesc(), L"Search result")) return false; - if (!lstrcmp(r.getLexerDesc(), TEXT("Search result"))) + if (!lstrcmp(r.getLexerDesc(), L"Search result")) return true; return lstrcmp(l.getLexerDesc(), r.getLexerDesc()) < 0; } @@ -560,10 +560,10 @@ struct LexerStylerArray return _lexerStylerVect[index]; }; - const TCHAR * getLexerNameFromIndex(size_t index) const { return _lexerStylerVect[index].getLexerName(); } - const TCHAR * getLexerDescFromIndex(size_t index) const { return _lexerStylerVect[index].getLexerDesc(); } + const wchar_t * getLexerNameFromIndex(size_t index) const { return _lexerStylerVect[index].getLexerName(); } + const wchar_t * getLexerDescFromIndex(size_t index) const { return _lexerStylerVect[index].getLexerDesc(); } - LexerStyler * getLexerStylerByName(const TCHAR *lexerName) { + LexerStyler * getLexerStylerByName(const wchar_t *lexerName) { if (!lexerName) return nullptr; for (size_t i = 0 ; i < _lexerStylerVect.size() ; ++i) { @@ -573,7 +573,7 @@ struct LexerStylerArray return nullptr; }; - void addLexerStyler(const TCHAR *lexerName, const TCHAR *lexerDesc, const TCHAR *lexerUserExt, TiXmlNode *lexerNode); + void addLexerStyler(const wchar_t *lexerName, const wchar_t *lexerDesc, const wchar_t *lexerUserExt, TiXmlNode *lexerNode); void sort() { std::sort(_lexerStylerVect.begin(), _lexerStylerVect.end(), SortLexersInAlphabeticalOrder()); @@ -601,7 +601,7 @@ struct LangMenuItem final int _cmdID = -1; std::wstring _langName; - LangMenuItem(LangType lt, int cmdID = 0, const std::wstring& langName = TEXT("")): + LangMenuItem(LangType lt, int cmdID = 0, const std::wstring& langName = L""): _langType(lt), _cmdID(cmdID), _langName(langName){}; bool operator<(const LangMenuItem& rhs) const @@ -638,11 +638,11 @@ struct PrintSettings final { }; bool isHeaderPresent() const { - return ((_headerLeft != TEXT("")) || (_headerMiddle != TEXT("")) || (_headerRight != TEXT(""))); + return (!_headerLeft.empty() || !_headerMiddle.empty() || !_headerRight.empty()); }; bool isFooterPresent() const { - return ((_footerLeft != TEXT("")) || (_footerMiddle != TEXT("")) || (_footerRight != TEXT(""))); + return (!_footerLeft.empty() || !_footerMiddle.empty() || !_footerRight.empty()); }; bool isUserMargePresent() const { @@ -670,7 +670,7 @@ public: !(month == 11 && day > 30)); } - explicit Date(const TCHAR *dateStr); + explicit Date(const wchar_t *dateStr); // The constructor which makes the date of number of days from now // nbDaysFromNow could be negative if user want to make a date in the past @@ -681,8 +681,8 @@ public: std::wstring toString() const // Return Notepad++ date format : YYYYMMDD { - TCHAR dateStr[16]; - wsprintf(dateStr, TEXT("%04u%02u%02u"), _year, _month, _day); + wchar_t dateStr[16]; + wsprintf(dateStr, L"%04u%02u%02u", _year, _month, _day); return dateStr; } @@ -851,10 +851,10 @@ struct NppGUI final bool _isWordCharDefault = true; std::string _customWordChars; urlMode _styleURL = urlUnderLineFg; - std::wstring _uriSchemes = TEXT("svn:// cvs:// git:// imap:// irc:// irc6:// ircs:// ldap:// ldaps:// news: telnet:// gopher:// ssh:// sftp:// smb:// skype: snmp:// spotify: steam:// sms: slack:// chrome:// bitcoin:"); + std::wstring _uriSchemes = L"svn:// cvs:// git:// imap:// irc:// irc6:// ircs:// ldap:// ldaps:// news: telnet:// gopher:// ssh:// sftp:// smb:// skype: snmp:// spotify: steam:// sms: slack:// chrome:// bitcoin:"; NewDocDefaultSettings _newDocDefaultSettings; - std::wstring _dateTimeFormat = TEXT("yyyy-MM-dd HH:mm:ss"); + std::wstring _dateTimeFormat = L"yyyy-MM-dd HH:mm:ss"; bool _dateTimeReverseDefaultOrder = false; void setTabReplacedBySpace(bool b) {_tabReplacedBySpace = b;}; @@ -901,9 +901,9 @@ struct NppGUI final OpenSaveDirSetting _openSaveDir = dir_followCurrent; - TCHAR _defaultDir[MAX_PATH]{}; - TCHAR _defaultDirExp[MAX_PATH]{}; //expanded environment variables - TCHAR _lastUsedDir[MAX_PATH]{}; + wchar_t _defaultDir[MAX_PATH]{}; + wchar_t _defaultDirExp[MAX_PATH]{}; //expanded environment variables + wchar_t _lastUsedDir[MAX_PATH]{}; std::wstring _themeName; MultiInstSetting _multiInstSetting = monoInst; @@ -1034,11 +1034,11 @@ struct Lang final { LangType _langID = L_TEXT; std::wstring _langName; - const TCHAR* _defaultExtList = nullptr; - const TCHAR* _langKeyWordList[NB_LIST]; - const TCHAR* _pCommentLineSymbol = nullptr; - const TCHAR* _pCommentStart = nullptr; - const TCHAR* _pCommentEnd = nullptr; + const wchar_t* _defaultExtList = nullptr; + const wchar_t* _langKeyWordList[NB_LIST]; + const wchar_t* _pCommentLineSymbol = nullptr; + const wchar_t* _pCommentStart = nullptr; + const wchar_t* _pCommentEnd = nullptr; bool _isTabReplacedBySpace = false; int _tabSize = -1; @@ -1049,26 +1049,26 @@ struct Lang final for (int i = 0 ; i < NB_LIST ; _langKeyWordList[i] = NULL, ++i); } - Lang(LangType langID, const TCHAR *name) : _langID(langID), _langName(name ? name : TEXT("")) + Lang(LangType langID, const wchar_t *name) : _langID(langID), _langName(name ? name : L"") { for (int i = 0 ; i < NB_LIST ; _langKeyWordList[i] = NULL, ++i); } ~Lang() = default; - void setDefaultExtList(const TCHAR *extLst){ + void setDefaultExtList(const wchar_t *extLst){ _defaultExtList = extLst; } - void setCommentLineSymbol(const TCHAR *commentLine){ + void setCommentLineSymbol(const wchar_t *commentLine){ _pCommentLineSymbol = commentLine; } - void setCommentStart(const TCHAR *commentStart){ + void setCommentStart(const wchar_t *commentStart){ _pCommentStart = commentStart; } - void setCommentEnd(const TCHAR *commentEnd){ + void setCommentEnd(const wchar_t *commentEnd){ _pCommentEnd = commentEnd; } @@ -1083,20 +1083,20 @@ struct Lang final _isBackspaceUnindent = isBackspaceUnindent; } - const TCHAR * getDefaultExtList() const { + const wchar_t * getDefaultExtList() const { return _defaultExtList; } - void setWords(const TCHAR *words, int index) { + void setWords(const wchar_t *words, int index) { _langKeyWordList[index] = words; } - const TCHAR * getWords(int index) const { + const wchar_t * getWords(int index) const { return _langKeyWordList[index]; } LangType getLangID() const {return _langID;}; - const TCHAR * getLangName() const {return _langName.c_str();}; + const wchar_t * getLangName() const {return _langName.c_str();}; int getTabInfo() const { @@ -1110,11 +1110,11 @@ struct Lang final class UserLangContainer final { public: - UserLangContainer() :_name(TEXT("new user define")), _ext(TEXT("")), _udlVersion(TEXT("")) { + UserLangContainer() :_name(L"new user define"), _ext(L""), _udlVersion(L"") { for (int i = 0; i < SCE_USER_KWLIST_TOTAL; ++i) *_keywordLists[i] = '\0'; } - UserLangContainer(const TCHAR *name, const TCHAR *ext, bool isDarkModeTheme, const TCHAR *udlVer): + UserLangContainer(const wchar_t *name, const wchar_t *ext, bool isDarkModeTheme, const wchar_t *udlVer): _name(name), _ext(ext), _isDarkModeTheme(isDarkModeTheme), _udlVersion(udlVer) { for (int i = 0; i < SCE_USER_KWLIST_TOTAL; ++i) *_keywordLists[i] = '\0'; } @@ -1150,9 +1150,9 @@ public: return *this; } - const TCHAR * getName() {return _name.c_str();}; - const TCHAR * getExtention() {return _ext.c_str();}; - const TCHAR * getUdlVersion() {return _udlVersion.c_str();}; + const wchar_t * getName() {return _name.c_str();}; + const wchar_t * getExtention() {return _ext.c_str();}; + const wchar_t * getUdlVersion() {return _udlVersion.c_str();}; private: StyleArray _styles; @@ -1161,7 +1161,7 @@ private: bool _isDarkModeTheme = false; std::wstring _udlVersion; - TCHAR _keywordLists[SCE_USER_KWLIST_TOTAL][max_char]; + wchar_t _keywordLists[SCE_USER_KWLIST_TOTAL][max_char]; bool _isPrefix[SCE_USER_TOTAL_KEYWORD_GROUPS] = {false}; bool _isCaseIgnored = false; @@ -1319,16 +1319,16 @@ public: _themeList.push_back(std::pair(_defaultThemeLabel, xmlFullPath)); } - std::wstring getThemeFromXmlFileName(const TCHAR *fn) const; + std::wstring getThemeFromXmlFileName(const wchar_t *fn) const; - std::wstring getXmlFilePathFromThemeName(const TCHAR *themeName) const { + std::wstring getXmlFilePathFromThemeName(const wchar_t *themeName) const { if (!themeName || themeName[0]) return std::wstring(); std::wstring themePath = _stylesXmlPath; return themePath; } - bool themeNameExists(const TCHAR *themeName) { + bool themeNameExists(const wchar_t *themeName) { for (size_t i = 0; i < _themeList.size(); ++i ) { auto& themeNameOnList = getElementFromIndex(i).first; @@ -1356,7 +1356,7 @@ public: const auto iter = _themeStylerSavePath.find(path); if (iter == _themeStylerSavePath.end()) { - return TEXT(""); + return L""; } else { @@ -1372,7 +1372,7 @@ private: std::vector> _themeList; std::map _themeStylerSavePath; std::wstring _themeDirPath; - const std::wstring _defaultThemeLabel = TEXT("Default (stylers.xml)"); + const std::wstring _defaultThemeLabel = L"Default (stylers.xml)"; std::wstring _stylesXmlPath; }; @@ -1436,12 +1436,12 @@ public: return *getInstancePointer(); }; - static LangType getLangIDFromStr(const TCHAR *langName); + static LangType getLangIDFromStr(const wchar_t *langName); static std::wstring getLocPathFromStr(const std::wstring & localizationCode); bool load(); bool reloadLang(); - bool reloadStylers(const TCHAR *stylePath = nullptr); + bool reloadStylers(const wchar_t *stylePath = nullptr); void destroyInstance(); std::wstring getSettingsFolder(); @@ -1452,7 +1452,7 @@ public: return _nppGUI; } - const TCHAR * getWordList(LangType langID, int typeIndex) const + const wchar_t * getWordList(LangType langID, int typeIndex) const { const Lang* pLang = getLangFromID(langID); if (!pLang) return nullptr; @@ -1477,9 +1477,9 @@ public: int getNbLang() const {return _nbLang;}; - LangType getLangFromExt(const TCHAR *ext); + LangType getLangFromExt(const wchar_t *ext); - const TCHAR * getLangExtFromName(const TCHAR *langName) const + const wchar_t * getLangExtFromName(const wchar_t *langName) const { for (int i = 0 ; i < _nbLang ; ++i) { @@ -1489,7 +1489,7 @@ public: return nullptr; } - const TCHAR * getLangExtFromLangType(LangType langType) const + const wchar_t * getLangExtFromLangType(LangType langType) const { for (int i = 0 ; i < _nbLang ; ++i) { @@ -1529,19 +1529,19 @@ public: } bool writeRecentFileHistorySettings(int nbMaxFile = -1) const; - bool writeHistory(const TCHAR *fullpath); + bool writeHistory(const wchar_t *fullpath); bool writeProjectPanelsSettings() const; bool writeColumnEditorSettings() const; bool writeFileBrowserSettings(const std::vector & rootPath, const std::wstring & latestSelectedItemPath) const; - TiXmlNode* getChildElementByAttribut(TiXmlNode *pere, const TCHAR *childName, const TCHAR *attributName, const TCHAR *attributVal) const; + TiXmlNode* getChildElementByAttribut(TiXmlNode *pere, const wchar_t *childName, const wchar_t *attributName, const wchar_t *attributVal) const; bool writeScintillaParams(); void createXmlTreeFromGUIParams(); std::wstring writeStyles(LexerStylerArray & lexersStylers, StyleArray & globalStylers); // return "" if saving file succeeds, otherwise return the new saved file path - bool insertTabInfo(const TCHAR* langName, int tabInfo, bool backspaceUnindent); + bool insertTabInfo(const wchar_t* langName, int tabInfo, bool backspaceUnindent); LexerStylerArray & getLStylerArray() {return _lexerStylerVect;}; StyleArray & getGlobalStylers() {return _widgetStyleArray;}; @@ -1558,10 +1558,10 @@ public: int getNbUserLang() const {return _nbUserLang;} UserLangContainer & getULCFromIndex(size_t i) {return *_userLangArray[i];}; - UserLangContainer * getULCFromName(const TCHAR *userLangName); + UserLangContainer * getULCFromName(const wchar_t *userLangName); int getNbExternalLang() const {return _nbExternalLang;}; - int getExternalLangIndexFromName(const TCHAR *externalLangName) const; + int getExternalLangIndexFromName(const wchar_t *externalLangName) const; ExternalLangContainer & getELCFromIndex(int i) {return *_externalLangArray[i];}; @@ -1574,10 +1574,10 @@ public: void writeNonDefaultUDL(); void writeNeed2SaveUDL(); void writeShortcuts(); - void writeSession(const Session & session, const TCHAR *fileName = NULL); + void writeSession(const Session & session, const wchar_t *fileName = NULL); bool writeFindHistory(); - bool isExistingUserLangName(const TCHAR *newName) const + bool isExistingUserLangName(const wchar_t *newName) const { if ((!newName) || (!newName[0])) return true; @@ -1590,9 +1590,9 @@ public: return false; } - const TCHAR * getUserDefinedLangNameFromExt(TCHAR *ext, TCHAR *fullName) const; + const wchar_t * getUserDefinedLangNameFromExt(wchar_t *ext, wchar_t *fullName) const; - int addUserLangToEnd(const UserLangContainer & userLang, const TCHAR *newName); + int addUserLangToEnd(const UserLangContainer & userLang, const wchar_t *newName); void removeUserLang(size_t index); bool isExistingExternalLangName(const char* newName) const; @@ -1657,12 +1657,12 @@ public: std::wstring getNppPath() const {return _nppPath;}; std::wstring getContextMenuPath() const {return _contextMenuPath;}; - const TCHAR * getAppDataNppDir() const {return _appdataNppDir.c_str();}; - const TCHAR * getPluginRootDir() const { return _pluginRootDir.c_str(); }; - const TCHAR * getPluginConfDir() const { return _pluginConfDir.c_str(); }; - const TCHAR * getUserPluginConfDir() const { return _userPluginConfDir.c_str(); }; - const TCHAR * getWorkingDir() const {return _currentDirectory.c_str();}; - const TCHAR * getWorkSpaceFilePath(int i) const { + const wchar_t * getAppDataNppDir() const {return _appdataNppDir.c_str();}; + const wchar_t * getPluginRootDir() const { return _pluginRootDir.c_str(); }; + const wchar_t * getPluginConfDir() const { return _pluginConfDir.c_str(); }; + const wchar_t * getUserPluginConfDir() const { return _userPluginConfDir.c_str(); }; + const wchar_t * getWorkingDir() const {return _currentDirectory.c_str();}; + const wchar_t * getWorkSpaceFilePath(int i) const { if (i < 0 || i > 2) return nullptr; return _workSpaceFilePathes[i].c_str(); }; @@ -1670,9 +1670,9 @@ public: const std::vector getFileBrowserRoots() const { return _fileBrowserRoot; }; std::wstring getFileBrowserSelectedItemPath() const { return _fileBrowserSelectedItemPath; }; - void setWorkSpaceFilePath(int i, const TCHAR *wsFile); + void setWorkSpaceFilePath(int i, const wchar_t *wsFile); - void setWorkingDir(const TCHAR * newPath); + void setWorkingDir(const wchar_t * newPath); void setStartWithLocFileName(const std::wstring& locPath) { _startWithLocFileName = locPath; @@ -1692,7 +1692,7 @@ public: return _doPrintAndExit; }; - bool loadSession(Session& session, const TCHAR* sessionFileName, const bool bSuppressErrorMsg = false); + bool loadSession(Session& session, const wchar_t* sessionFileName, const bool bSuppressErrorMsg = false); void setLoadedSessionFilePath(const std::wstring & loadedSessionFilePath) { _loadedSessionFullFilePath = loadedSessionFilePath; @@ -1780,7 +1780,7 @@ public: } bool writeSettingsFilesOnCloudForThe1stTime(const std::wstring & cloudSettingsPath); - void setCloudChoice(const TCHAR *pathChoice); + void setCloudChoice(const wchar_t *pathChoice); void removeCloudChoice(); bool isCloudPathChanged() const; int archType() const { return ARCH_TYPE; }; @@ -1935,7 +1935,7 @@ private: std::wstring _nppPath; std::wstring _userPath; std::wstring _stylerPath; - std::wstring _appdataNppDir; // sentinel of the absence of "doLocalConf.xml" : (_appdataNppDir == TEXT(""))?"doLocalConf.xml present":"doLocalConf.xml absent" + std::wstring _appdataNppDir; // sentinel of the absence of "doLocalConf.xml" : (_appdataNppDir == L""))?"doLocalConf.xml present":"doLocalConf.xml absent" std::wstring _pluginRootDir; // plugins root where all the plugins are installed std::wstring _pluginConfDir; // plugins config dir where the plugin list is installed std::wstring _userPluginConfDir; // plugins config dir for per user where the plugin parameters are saved / loaded @@ -2047,7 +2047,7 @@ private: void insertUserCmd(TiXmlNodeA *userCmdRoot, const UserCommand & userCmd, const std::string& folderName); void insertScintKey(TiXmlNodeA *scintKeyRoot, const ScintillaKeyMap & scintKeyMap); void insertPluginCmd(TiXmlNodeA *pluginCmdRoot, const PluginCmdShortcut & pluginCmd); - TiXmlElement * insertGUIConfigBoolNode(TiXmlNode *r2w, const TCHAR *name, bool bVal); + TiXmlElement * insertGUIConfigBoolNode(TiXmlNode *r2w, const wchar_t *name, bool bVal); void insertDockingParamNode(TiXmlNode *GUIRoot); void writeExcludedLangList(TiXmlElement *element); void writePrintSetting(TiXmlElement *element);