diff --git a/PowerEditor/src/MISC/Common/Common.cpp b/PowerEditor/src/MISC/Common/Common.cpp index 1b99f5609..1e92386fc 100644 --- a/PowerEditor/src/MISC/Common/Common.cpp +++ b/PowerEditor/src/MISC/Common/Common.cpp @@ -46,7 +46,7 @@ void printStr(const wchar_t *str2print) wstring commafyInt(size_t n) { - generic_stringstream ss; + std::basic_stringstream ss; ss.imbue(std::locale("")); ss << n; return ss.str(); diff --git a/PowerEditor/src/MISC/Common/Common.h b/PowerEditor/src/MISC/Common/Common.h index 50468815d..9e45397f3 100644 --- a/PowerEditor/src/MISC/Common/Common.h +++ b/PowerEditor/src/MISC/Common/Common.h @@ -49,8 +49,6 @@ const bool dirDown = false; #define NPP_INTERNAL_FUCTION_STR L"Notepad++::InternalFunction" -typedef std::basic_string generic_string; -typedef std::basic_stringstream generic_stringstream; std::wstring folderBrowser(HWND parent, const std::wstring & title = L"", int outputCtrlID = 0, const wchar_t *defaultStr = NULL); std::wstring getFolderName(HWND parent, const wchar_t *defaultDir = NULL); diff --git a/PowerEditor/src/MISC/FileNameStringSplitter.h b/PowerEditor/src/MISC/FileNameStringSplitter.h index d8d43cfd5..4c6e4399e 100644 --- a/PowerEditor/src/MISC/FileNameStringSplitter.h +++ b/PowerEditor/src/MISC/FileNameStringSplitter.h @@ -16,7 +16,7 @@ #pragma once -typedef std::vector stringVector; +typedef std::vector stringVector; class FileNameStringSplitter { @@ -44,7 +44,7 @@ public: { str[i] = '\0'; if (str[0]) - _fileNames.push_back(generic_string(str)); + _fileNames.push_back(std::wstring(str)); i = 0; } isInsideQuotes = !isInsideQuotes; @@ -63,7 +63,7 @@ public: { str[i] = '\0'; if (str[0]) - _fileNames.push_back(generic_string(str)); + _fileNames.push_back(std::wstring(str)); i = 0; } pStr++; @@ -74,7 +74,7 @@ public: { str[i] = *pStr; if (str[0]) - _fileNames.push_back(generic_string(str)); + _fileNames.push_back(std::wstring(str)); fini = true; break; } diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index b0eb4438b..458229db0 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -2971,7 +2971,7 @@ bool FindReplaceDlg::processReplace(const wchar_t *txt2find, const wchar_t *txt2 } else if (status == FSTopReached) { - generic_string msg = pNativeSpeaker->getLocalizedStrFromID("find-status-replace-top-reached", L"Replace: Replaced the last occurrence from the bottom. The begin of document has been reached."); + wstring msg = pNativeSpeaker->getLocalizedStrFromID("find-status-replace-top-reached", L"Replace: Replaced the last occurrence from the bottom. The begin of document has been reached."); setStatusbarMessage(msg, FSTopReached); } else diff --git a/PowerEditor/src/ScintillaComponent/FunctionCallTip.cpp b/PowerEditor/src/ScintillaComponent/FunctionCallTip.cpp index 11356e853..7173df50e 100644 --- a/PowerEditor/src/ScintillaComponent/FunctionCallTip.cpp +++ b/PowerEditor/src/ScintillaComponent/FunctionCallTip.cpp @@ -397,7 +397,7 @@ void FunctionCallTip::showCalltip() } } - generic_stringstream callTipText; + std::basic_stringstream callTipText; if (_currentNbOverloads > 1) { diff --git a/PowerEditor/src/ScintillaComponent/FunctionCallTip.h b/PowerEditor/src/ScintillaComponent/FunctionCallTip.h index 4818bceae..98b7d5684 100644 --- a/PowerEditor/src/ScintillaComponent/FunctionCallTip.h +++ b/PowerEditor/src/ScintillaComponent/FunctionCallTip.h @@ -53,7 +53,7 @@ private: wchar_t _stop = ')'; wchar_t _param = ','; wchar_t _terminal = ';'; - generic_string _additionalWordChar = L""; + std::wstring _additionalWordChar = L""; bool _ignoreCase = true; bool _selfActivated = false; diff --git a/PowerEditor/src/ScintillaComponent/SmartHighlighter.cpp b/PowerEditor/src/ScintillaComponent/SmartHighlighter.cpp index 5a615264e..a291ab0a3 100644 --- a/PowerEditor/src/ScintillaComponent/SmartHighlighter.cpp +++ b/PowerEditor/src/ScintillaComponent/SmartHighlighter.cpp @@ -26,7 +26,7 @@ SmartHighlighter::SmartHighlighter(FindReplaceDlg * pFRDlg) //Nothing to do } -void SmartHighlighter::highlightViewWithWord(ScintillaEditView * pHighlightView, const generic_string & word2Hilite) +void SmartHighlighter::highlightViewWithWord(ScintillaEditView * pHighlightView, const std::wstring & word2Hilite) { // save target locations for other search functions auto originalStartPos = pHighlightView->execute(SCI_GETTARGETSTART); diff --git a/PowerEditor/src/ScintillaComponent/SmartHighlighter.h b/PowerEditor/src/ScintillaComponent/SmartHighlighter.h index 1f6a6241d..f94c23c0d 100644 --- a/PowerEditor/src/ScintillaComponent/SmartHighlighter.h +++ b/PowerEditor/src/ScintillaComponent/SmartHighlighter.h @@ -25,7 +25,7 @@ class SmartHighlighter { public: explicit SmartHighlighter(FindReplaceDlg * pFRDlg); void highlightView(ScintillaEditView * pHighlightView, ScintillaEditView * unfocusView); - void highlightViewWithWord(ScintillaEditView * pHighlightView, const generic_string & word2Hilite); + void highlightViewWithWord(ScintillaEditView * pHighlightView, const std::wstring & word2Hilite); private: FindReplaceDlg * _pFRDlg = nullptr; diff --git a/PowerEditor/src/ScintillaComponent/columnEditor.cpp b/PowerEditor/src/ScintillaComponent/columnEditor.cpp index d88edae0f..c26302357 100644 --- a/PowerEditor/src/ScintillaComponent/columnEditor.cpp +++ b/PowerEditor/src/ScintillaComponent/columnEditor.cpp @@ -20,6 +20,7 @@ #include "columnEditor.h" #include "ScintillaEditView.h" +using namespace std; void ColumnEditorDlg::init(HINSTANCE hInst, HWND hPere, ScintillaEditView **ppEditView) { @@ -215,11 +216,11 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR line = new wchar_t[lineLen]; } (*_ppEditView)->getGenericText(line, lineLen, lineBegin, lineEnd); - generic_string s2r(line); + wstring s2r(line); if (lineEndCol < cursorCol) { - generic_string s_space(cursorCol - lineEndCol, ' '); + wstring s_space(cursorCol - lineEndCol, ' '); s2r.append(s_space); s2r.append(str); } @@ -323,16 +324,16 @@ intptr_t CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPAR } (*_ppEditView)->getGenericText(line, lineLen, lineBegin, lineEnd); - generic_string s2r(line); + wstring s2r(line); // - // Calcule generic_string + // Calcule wstring // variedFormatNumber2String(str, stringSize, numbers.at(i - cursorLine), base, nb, getLeading()); if (lineEndCol < cursorCol) { - generic_string s_space(cursorCol - lineEndCol, ' '); + wstring s_space(cursorCol - lineEndCol, ' '); s2r.append(s_space); s2r.append(str); } diff --git a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h index 161db50c0..4562a0120 100644 --- a/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h +++ b/PowerEditor/src/WinControls/AboutDlg/URLCtrl.h @@ -29,7 +29,7 @@ private: HCURSOR& loadHandCursor(); void action(); protected : - generic_string _URL; + std::wstring _URL; HFONT _hfUnderlined = nullptr; HCURSOR _hCursor = nullptr; diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/ListView.cpp b/PowerEditor/src/WinControls/AnsiCharPanel/ListView.cpp index d13d075b0..37488b7a0 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/ListView.cpp +++ b/PowerEditor/src/WinControls/AnsiCharPanel/ListView.cpp @@ -79,7 +79,7 @@ void ListView::destroy() _hSelf = NULL; } -void ListView::addLine(const vector & values2Add, LPARAM lParam, int pos2insert) +void ListView::addLine(const vector & values2Add, LPARAM lParam, int pos2insert) { if (!values2Add.size()) return; @@ -106,7 +106,7 @@ void ListView::addLine(const vector & values2Add, LPARAM lParam, } } -size_t ListView::findAlphabeticalOrderPos(const generic_string& string2Cmp, SortDirection sortDir) +size_t ListView::findAlphabeticalOrderPos(const wstring& string2Cmp, SortDirection sortDir) { size_t nbItem = ListView_GetItemCount(_hSelf); if (!nbItem) diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h b/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h index 0418c4c20..081a2088b 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h +++ b/PowerEditor/src/WinControls/AnsiCharPanel/ListView.h @@ -24,9 +24,9 @@ struct columnInfo { size_t _width; - generic_string _label; + std::wstring _label; - columnInfo(const generic_string & label, size_t width) : _width(width), _label(label) {}; + columnInfo(const std::wstring & label, size_t width) : _width(width), _label(label) {}; }; class ListView : public Window @@ -44,7 +44,7 @@ public: _columnInfos.push_back(column2Add); }; - void setColumnText(size_t i, generic_string txt2Set) { + void setColumnText(size_t i, std::wstring txt2Set) { LVCOLUMN lvColumn{}; lvColumn.mask = LVCF_TEXT; lvColumn.pszText = const_cast(txt2Set.c_str()); @@ -56,9 +56,9 @@ public: _extraStyle = extraStyle; }; - size_t findAlphabeticalOrderPos(const generic_string& string2search, SortDirection sortDir); + size_t findAlphabeticalOrderPos(const std::wstring& string2search, SortDirection sortDir); - void addLine(const std::vector & values2Add, LPARAM lParam = 0, int pos2insert = -1); + void addLine(const std::vector & values2Add, LPARAM lParam = 0, int pos2insert = -1); size_t nbItem() const { return ListView_GetItemCount(_hSelf); diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/asciiListView.cpp b/PowerEditor/src/WinControls/AnsiCharPanel/asciiListView.cpp index 4201d5d28..7a0dcb3f9 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/asciiListView.cpp +++ b/PowerEditor/src/WinControls/AnsiCharPanel/asciiListView.cpp @@ -18,6 +18,8 @@ #include "asciiListView.h" #include "Parameters.h" +using namespace std; + void AsciiListView::resetValues(int codepage) { if (codepage == -1) @@ -30,7 +32,7 @@ void AsciiListView::resetValues(int codepage) setValues(codepage); } -generic_string AsciiListView::getAscii(unsigned char value) +wstring AsciiListView::getAscii(unsigned char value) { switch (value) { @@ -115,7 +117,7 @@ generic_string AsciiListView::getAscii(unsigned char value) } } -generic_string AsciiListView::getHtmlName(unsigned char value) +wstring AsciiListView::getHtmlName(unsigned char value) { switch (value) { @@ -515,10 +517,10 @@ void AsciiListView::setValues(int codepage) wchar_t hex[bufSize]{}; wchar_t htmlNumber[bufSize]{}; wchar_t htmlHexNumber[bufSizeHex]{}; - generic_string htmlName; + wstring htmlName; swprintf(dec, bufSize, L"%d", i); swprintf(hex, bufSize, L"%02X", i); - generic_string s = getAscii(static_cast(i)); + wstring s = getAscii(static_cast(i)); if (codepage == 0 || codepage == 1252) { @@ -551,7 +553,7 @@ void AsciiListView::setValues(int codepage) htmlName = L""; } - std::vector values2Add; + std::vector values2Add; values2Add.push_back(dec); values2Add.push_back(hex); diff --git a/PowerEditor/src/WinControls/AnsiCharPanel/asciiListView.h b/PowerEditor/src/WinControls/AnsiCharPanel/asciiListView.h index 99f0cf22c..36fb468ee 100644 --- a/PowerEditor/src/WinControls/AnsiCharPanel/asciiListView.h +++ b/PowerEditor/src/WinControls/AnsiCharPanel/asciiListView.h @@ -24,8 +24,8 @@ public: void setValues(int codepage = 0); void resetValues(int codepage); - generic_string getAscii(unsigned char value); - generic_string getHtmlName(unsigned char value); + std::wstring getAscii(unsigned char value); + std::wstring getHtmlName(unsigned char value); int getHtmlNumber(unsigned char value); private: int _codepage = -1; diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp index 272ae14ad..1c0d8d56d 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.cpp @@ -103,7 +103,7 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM ThemeSwitcher & themeSwitcher = nppParamInst.getThemeSwitcher(); for (size_t i = 0 ; i < themeSwitcher.size() ; ++i) { - pair & themeInfo = themeSwitcher.getElementFromIndex(i); + pair & themeInfo = themeSwitcher.getElementFromIndex(i); int j = static_cast(::SendMessage(_hSwitch2ThemeCombo, CB_ADDSTRING, 0, reinterpret_cast(themeInfo.first.c_str()))); if (! themeInfo.second.compare( nppParamInst.getNppGUI()._themeName ) ) { @@ -124,7 +124,7 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM for (size_t i = 0 ; i < sizeof(fontSizeStrs)/(3*sizeof(wchar_t)) ; ++i) ::SendMessage(_hFontSizeCombo, CB_ADDSTRING, 0, reinterpret_cast(fontSizeStrs[i])); - const std::vector & fontlist = (NppParameters::getInstance()).getFontList(); + const std::vector & fontlist = (NppParameters::getInstance()).getFontList(); for (size_t i = 0, len = fontlist.size() ; i < len ; ++i) { auto j = ::SendMessage(_hFontNameCombo, CB_ADDSTRING, 0, reinterpret_cast(fontlist[i].c_str())); @@ -339,7 +339,7 @@ intptr_t CALLBACK WordStyleDlg::run_dlgProc(UINT Message, WPARAM wParam, LPARAM NppParameters& nppParamInst = NppParameters::getInstance(); if (_restoreInvalid) { - generic_string str(nppParamInst.getNppGUI()._themeName); + wstring str(nppParamInst.getNppGUI()._themeName); nppParamInst.reloadStylers(str.c_str()); loadLangListFromNppParam(); } @@ -611,7 +611,7 @@ void WordStyleDlg::loadLangListFromNppParam() setStyleListFromLexer(index2Begin); } -void WordStyleDlg::updateThemeName(const generic_string& themeName) +void WordStyleDlg::updateThemeName(const wstring& themeName) { NppParameters& nppParam = NppParameters::getInstance(); NppGUI & nppGUI = (NppGUI & )nppParam.getNppGUI(); @@ -782,12 +782,12 @@ void WordStyleDlg::switchToTheme() { auto iSel = ::SendMessage(_hSwitch2ThemeCombo, CB_GETCURSEL, 0, 0); - generic_string prevThemeName(_themeName); + wstring prevThemeName(_themeName); _themeName.clear(); NppParameters& nppParamInst = NppParameters::getInstance(); ThemeSwitcher & themeSwitcher = nppParamInst.getThemeSwitcher(); - pair & themeInfo = themeSwitcher.getElementFromIndex(iSel); + pair & themeInfo = themeSwitcher.getElementFromIndex(iSel); _themeName = themeInfo.second; if (_isThemeDirty) @@ -841,7 +841,7 @@ bool WordStyleDlg::goToSection(const wchar_t* sectionNames) if (!sectionNames || !sectionNames[0]) return false; - std::vector sections = tokenizeString(sectionNames, ':'); + std::vector sections = tokenizeString(sectionNames, ':'); if (sections.size() == 0 || sections.size() >= 3) return false; @@ -1163,7 +1163,7 @@ void WordStyleDlg::setVisualFromStyleList() LangType lType = nppParams.getLangIDFromStr(lexerStyler.getLexerName()); if (lType == L_TEXT) { - generic_string lexerNameStr = lexerStyler.getLexerName(); + wstring lexerNameStr = lexerStyler.getLexerName(); lexerNameStr += L" is not defined in NppParameters::getLangIDFromStr()"; printStr(lexerNameStr.c_str()); } @@ -1280,7 +1280,7 @@ void WordStyleDlg::addLastThemeEntry() { NppParameters& nppParamInst = NppParameters::getInstance(); ThemeSwitcher& themeSwitcher = nppParamInst.getThemeSwitcher(); - std::pair& themeInfo = themeSwitcher.getElementFromIndex(themeSwitcher.size() - 1); + std::pair& themeInfo = themeSwitcher.getElementFromIndex(themeSwitcher.size() - 1); ::SendMessage(_hSwitch2ThemeCombo, CB_ADDSTRING, 0, reinterpret_cast(themeInfo.first.c_str())); } diff --git a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h index 3e1e25357..3beedd768 100644 --- a/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h +++ b/PowerEditor/src/WinControls/ColourPicker/WordStyleDlg.h @@ -97,7 +97,7 @@ private : LexerStylerArray _lsArray; StyleArray _globalStyles; - generic_string _themeName; + std::wstring _themeName; LexerStylerArray _styles2restored; StyleArray _gstyles2restored; @@ -128,7 +128,7 @@ private : void updateFontSize(); void updateUserKeywords(); void switchToTheme(); - void updateThemeName(const generic_string& themeName); + void updateThemeName(const std::wstring& themeName); void loadLangListFromNppParam(); void enableFontStyle(bool isEnable); long notifyDataModified(); diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp index 0cd72d5e4..ab57b1a38 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.cpp @@ -425,7 +425,7 @@ LRESULT DockingCont::runProcCaption(HWND hwnd, UINT Message, WPARAM wParam, LPAR else { NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); - generic_string tip = pNativeSpeaker->getLocalizedStrFromID("close-panel-tip", L"Close"); + wstring tip = pNativeSpeaker->getLocalizedStrFromID("close-panel-tip", L"Close"); toolTip.Show(rc, tip.c_str(), pt.x, pt.y + 20); } return 0; @@ -1722,7 +1722,7 @@ void DockingCont::selectTab(int iTab) for (int iItem = 0; iItem < iItemCnt; ++iItem) { - generic_string szText; + wstring szText; if (iItem == iTab && pszMaxTxt) { // fake here an icon before text ... diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h index 986ccaebf..9f9fc234e 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingCont.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingCont.h @@ -186,7 +186,7 @@ private: // caption params BOOL _isTopCaption = CAPTION_TOP; - generic_string _pszCaption; + std::wstring _pszCaption; BOOL _isMouseDown = FALSE; BOOL _isMouseClose = FALSE; diff --git a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h index 0beaca97b..ffd4b3ed5 100644 --- a/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h +++ b/PowerEditor/src/WinControls/DockingWnd/DockingDlgInterface.h @@ -86,8 +86,8 @@ protected : int _dlgID = -1; bool _isFloating = true; int _iDockedPos = 0; - generic_string _moduleName; - generic_string _pluginName; + std::wstring _moduleName; + std::wstring _pluginName; bool _isClosed = false; intptr_t CALLBACK run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam) override { diff --git a/PowerEditor/src/WinControls/DocumentMap/documentMap.h b/PowerEditor/src/WinControls/DocumentMap/documentMap.h index 35a8fed6b..8f559dcdb 100644 --- a/PowerEditor/src/WinControls/DocumentMap/documentMap.h +++ b/PowerEditor/src/WinControls/DocumentMap/documentMap.h @@ -150,5 +150,5 @@ private: // for needToRecomputeWith function intptr_t _displayZoom = -1; intptr_t _displayWidth = 0; - generic_string id4dockingCont = DM_NOFOCUSWHILECLICKINGCAPTION; + std::wstring id4dockingCont = DM_NOFOCUSWHILECLICKINGCAPTION; }; diff --git a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp index 21e0cc9c0..6c9c15365 100644 --- a/PowerEditor/src/WinControls/Grid/BabyGrid.cpp +++ b/PowerEditor/src/WinControls/Grid/BabyGrid.cpp @@ -1532,7 +1532,7 @@ LRESULT CALLBACK GridProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { holdfont = (HFONT)SelectObject(hdc, BGHS[SelfIndex].hfont); } - //if there are \n codes in the generic_string, find the longest line + //if there are \n codes in the string, find the longest line int longestline = FindLongestLine(hdc, (wchar_t*)lParam, &size); int required_width = longestline + 15; required_height = size.cy; diff --git a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp index a0b0bdece..a5dbbcf45 100644 --- a/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp +++ b/PowerEditor/src/WinControls/SplitterContainer/SplitterContainer.cpp @@ -244,9 +244,9 @@ LRESULT SplitterContainer::runProc(UINT message, WPARAM wParam, LPARAM lParam) _hPopupMenu = ::CreatePopupMenu(); NativeLangSpeaker* nativeLangSpeaker = NppParameters::getInstance().getNativeLangSpeaker(); - const generic_string textLeft = + const std::wstring textLeft = nativeLangSpeaker->getLocalizedStrFromID("splitter-rotate-left", L"Rotate to left"); - const generic_string textRight = + const std::wstring textRight = nativeLangSpeaker->getLocalizedStrFromID("splitter-rotate-right", L"Rotate to right"); ::InsertMenu(_hPopupMenu, 1, MF_BYPOSITION, ROTATION_LEFT, textLeft.c_str()); diff --git a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp index a91f5728a..8e516a7a9 100644 --- a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp +++ b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.cpp @@ -23,6 +23,7 @@ #include "Notepad_plus.h" #include +using namespace std; void Command::extractArgs(wchar_t* cmd2Exec, size_t cmd2ExecLen, wchar_t* args, size_t argsLen, const wchar_t* cmdEntier) { @@ -224,7 +225,7 @@ HINSTANCE Command::run(HWND hWnd, const wchar_t* cwd) int retResult = static_cast(reinterpret_cast(res)); if (retResult <= 32) { - generic_string errorMsg; + wstring errorMsg; errorMsg += GetLastErrorAsString(retResult); errorMsg += L"An attempt was made to execute the below command."; errorMsg += L"\n----------------------------------------------------------"; @@ -381,7 +382,7 @@ intptr_t CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam // Insert the separator and modify/delete command ::InsertMenu(hRunMenu, posBase + nbTopLevelItem + 1, MF_BYPOSITION, static_cast(-1), 0); NativeLangSpeaker *pNativeLangSpeaker = nppParams.getNativeLangSpeaker(); - generic_string nativeLangShortcutMapperMacro = pNativeLangSpeaker->getNativeLangMenuString(IDM_SETTING_SHORTCUT_MAPPER_MACRO); + wstring nativeLangShortcutMapperMacro = pNativeLangSpeaker->getNativeLangMenuString(IDM_SETTING_SHORTCUT_MAPPER_MACRO); if (nativeLangShortcutMapperMacro == L"") nativeLangShortcutMapperMacro = runMenu.getLastCmdLabel(); @@ -399,12 +400,12 @@ intptr_t CALLBACK RunDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lParam fd.setExtFilter(L"Executable File", { L".exe", L".com", L".cmd", L".bat" }); fd.setExtFilter(L"All Files", L".*"); - generic_string fn = fd.doOpenSingleFileDlg(); + wstring fn = fd.doOpenSingleFileDlg(); if (!fn.empty()) { - if (fn.find(' ') != generic_string::npos) + if (fn.find(' ') != wstring::npos) { - generic_string fn_quotes(fn); + wstring fn_quotes(fn); fn_quotes = L"\"" + fn_quotes + L"\""; addTextToCombo(fn_quotes.c_str()); } diff --git a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h index 2bebdf129..da9d34c9c 100644 --- a/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h +++ b/PowerEditor/src/WinControls/StaticDialog/RunDlg/RunDlg.h @@ -40,12 +40,12 @@ class Command { public : Command() = default; explicit Command(const wchar_t *cmd) : _cmdLine(cmd){}; - explicit Command(const generic_string& cmd) : _cmdLine(cmd){}; + explicit Command(const std::wstring& cmd) : _cmdLine(cmd){}; HINSTANCE run(HWND hWnd); HINSTANCE run(HWND hWnd, const wchar_t* cwd); protected : - generic_string _cmdLine; + std::wstring _cmdLine; private : void extractArgs(wchar_t *cmd2Exec, size_t cmd2ExecLen, wchar_t *args, size_t argsLen, const wchar_t *cmdEntier); }; diff --git a/PowerEditor/src/WinControls/StatusBar/StatusBar.h b/PowerEditor/src/WinControls/StatusBar/StatusBar.h index d06b1c2a7..b34475780 100644 --- a/PowerEditor/src/WinControls/StatusBar/StatusBar.h +++ b/PowerEditor/src/WinControls/StatusBar/StatusBar.h @@ -51,6 +51,6 @@ private: private: std::vector _partWidthArray; int *_lpParts = nullptr; - generic_string _lastSetText; + std::wstring _lastSetText; StatusBarSubclassInfo* _pStatusBarInfo = nullptr; }; \ No newline at end of file diff --git a/PowerEditor/src/WinControls/TabBar/ControlsTab.h b/PowerEditor/src/WinControls/TabBar/ControlsTab.h index f5bcf5c72..4b51c0d51 100644 --- a/PowerEditor/src/WinControls/TabBar/ControlsTab.h +++ b/PowerEditor/src/WinControls/TabBar/ControlsTab.h @@ -24,8 +24,8 @@ struct DlgInfo { Window *_dlg; - generic_string _name; - generic_string _internalName; + std::wstring _name; + std::wstring _internalName; DlgInfo(Window *dlg, const wchar_t *name, const wchar_t *internalName = L""): _dlg(dlg), _name(name), _internalName(internalName) {}; }; diff --git a/PowerEditor/src/WinControls/TaskList/TaskListDlg.h b/PowerEditor/src/WinControls/TaskList/TaskListDlg.h index 99f55093f..fdb3dcf49 100644 --- a/PowerEditor/src/WinControls/TaskList/TaskListDlg.h +++ b/PowerEditor/src/WinControls/TaskList/TaskListDlg.h @@ -29,12 +29,12 @@ struct TaskLstFnStatus { int _iView = -1; int _docIndex = 0; - generic_string _fn; + std::wstring _fn; int _status = 0; void *_bufID = nullptr; int _docColor = -1; - TaskLstFnStatus(const generic_string& str, int status) : _fn(str), _status(status){}; - TaskLstFnStatus(int iView, int docIndex, generic_string str, int status, void *bufID, int docColor) : + TaskLstFnStatus(const std::wstring& str, int status) : _fn(str), _status(status){}; + TaskLstFnStatus(int iView, int docIndex, std::wstring str, int status, void *bufID, int docColor) : _iView(iView), _docIndex(docIndex), _fn(str), _status(status), _bufID(bufID), _docColor(docColor) {}; }; diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp index c3d775133..83d5d8270 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.cpp @@ -22,11 +22,13 @@ #include "FindReplaceDlg_rc.h" #include "NppDarkMode.h" +using namespace std; + constexpr DWORD WS_TOOLBARSTYLE = WS_CHILD | WS_VISIBLE | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT | CCS_TOP | CCS_NOPARENTALIGN | CCS_NORESIZE | CCS_NODIVIDER; struct ToolbarIconIdUnit { - generic_string _id; + wstring _id; bool hasDisabledIcon = false; }; @@ -73,21 +75,21 @@ void ToolBar::initTheme(TiXmlDocument *toolIconsDocRoot) _toolIcons = _toolIcons->FirstChild(L"ToolBarIcons"); if (_toolIcons) { - generic_string iconFolderDir = NppParameters::getInstance().getUserPath(); - generic_string toolbarIconsRootFolderName = L"toolbarIcons"; + wstring iconFolderDir = NppParameters::getInstance().getUserPath(); + wstring toolbarIconsRootFolderName = L"toolbarIcons"; pathAppend(iconFolderDir, toolbarIconsRootFolderName); - generic_string folderName = (_toolIcons->ToElement())->Attribute(L"icoFolderName"); + wstring folderName = (_toolIcons->ToElement())->Attribute(L"icoFolderName"); if (folderName.empty()) folderName = L"default"; pathAppend(iconFolderDir, folderName); size_t i = 0; - generic_string disabled_suffix = L"_disabled"; - generic_string ext = L".ico"; + wstring disabled_suffix = L"_disabled"; + wstring ext = L".ico"; for (ToolbarIconIdUnit icoUnit : toolbarIconIDs) { - generic_string locator = iconFolderDir; + wstring locator = iconFolderDir; locator += L"\\"; locator += icoUnit._id; locator += ext; @@ -101,7 +103,7 @@ void ToolBar::initTheme(TiXmlDocument *toolIconsDocRoot) if (icoUnit.hasDisabledIcon) { - generic_string locator_dis = iconFolderDir; + wstring locator_dis = iconFolderDir; locator_dis += L"\\"; locator_dis += icoUnit._id; locator_dis += disabled_suffix; @@ -497,7 +499,7 @@ void ToolBar::doPopop(POINT chevPoint) if (start < _nbCurrentButtons) { //some buttons are hidden HMENU menu = ::CreatePopupMenu(); - generic_string text; + wstring text; while (start < _nbCurrentButtons) { int cmd = _pTBB[start].idCommand; diff --git a/PowerEditor/src/WinControls/ToolBar/ToolBar.h b/PowerEditor/src/WinControls/ToolBar/ToolBar.h index da24e433c..bd6ac0920 100644 --- a/PowerEditor/src/WinControls/ToolBar/ToolBar.h +++ b/PowerEditor/src/WinControls/ToolBar/ToolBar.h @@ -37,9 +37,9 @@ enum toolBarStatusType {TB_SMALL, TB_LARGE, TB_SMALL2, TB_LARGE2, TB_STANDARD}; struct iconLocator { size_t _listIndex = 0; size_t _iconIndex = 0; - generic_string _iconLocation; + std::wstring _iconLocation; - iconLocator(size_t iList, size_t iIcon, const generic_string& iconLoc) + iconLocator(size_t iList, size_t iIcon, const std::wstring& iconLoc) : _listIndex(iList), _iconIndex(iIcon), _iconLocation(iconLoc){}; }; diff --git a/PowerEditor/src/WinControls/TreeView/TreeView.cpp b/PowerEditor/src/WinControls/TreeView/TreeView.cpp index 6de235156..2c42f931f 100644 --- a/PowerEditor/src/WinControls/TreeView/TreeView.cpp +++ b/PowerEditor/src/WinControls/TreeView/TreeView.cpp @@ -19,6 +19,8 @@ #include "TreeView.h" #include "Parameters.h" +using namespace std; + #define CY_ITEMHEIGHT 18 void TreeView::init(HINSTANCE hInst, HWND parent, int treeViewID) @@ -135,7 +137,7 @@ LPARAM TreeView::getItemParam(HTREEITEM Item2Get) const return tvItem.lParam; } -generic_string TreeView::getItemDisplayName(HTREEITEM Item2Set) const +wstring TreeView::getItemDisplayName(HTREEITEM Item2Set) const { if (!Item2Set) return L""; @@ -623,7 +625,7 @@ bool TreeView::canDragOut(HTREEITEM targetItem) -bool TreeView::searchLeafAndBuildTree(const TreeView & tree2Build, const generic_string & text2Search, int index2Search) +bool TreeView::searchLeafAndBuildTree(const TreeView & tree2Build, const wstring & text2Search, int index2Search) { //tree2Build.removeAllItems(); //HTREEITEM root = getRoot(); @@ -631,7 +633,7 @@ bool TreeView::searchLeafAndBuildTree(const TreeView & tree2Build, const generic return searchLeafRecusivelyAndBuildTree(tree2Build.getRoot(), text2Search, index2Search, getRoot()); } -bool TreeView::searchLeafRecusivelyAndBuildTree(HTREEITEM tree2Build, const generic_string & text2Search, int index2Search, HTREEITEM tree2Search) +bool TreeView::searchLeafRecusivelyAndBuildTree(HTREEITEM tree2Build, const wstring & text2Search, int index2Search, HTREEITEM tree2Search) { if (!tree2Search) return false; @@ -646,11 +648,11 @@ bool TreeView::searchLeafRecusivelyAndBuildTree(HTREEITEM tree2Build, const gene if (tvItem.iImage == index2Search) { - generic_string itemNameUpperCase = stringToUpper(tvItem.pszText); - generic_string text2SearchUpperCase = stringToUpper(text2Search); + wstring itemNameUpperCase = stringToUpper(tvItem.pszText); + wstring text2SearchUpperCase = stringToUpper(text2Search); size_t res = itemNameUpperCase.find(text2SearchUpperCase); - if (res != generic_string::npos) + if (res != wstring::npos) { TVINSERTSTRUCT tvInsertStruct{}; tvInsertStruct.item = tvItem; @@ -690,7 +692,7 @@ bool TreeView::retrieveFoldingStateTo(TreeStateNode & treeState2Construct, HTREE if (tvItem.lParam) { - treeState2Construct._extraData = *((generic_string *)tvItem.lParam); + treeState2Construct._extraData = *((wstring *)tvItem.lParam); } int i = 0; diff --git a/PowerEditor/src/WinControls/TreeView/TreeView.h b/PowerEditor/src/WinControls/TreeView/TreeView.h index 8b253a8f7..046312f5c 100644 --- a/PowerEditor/src/WinControls/TreeView/TreeView.h +++ b/PowerEditor/src/WinControls/TreeView/TreeView.h @@ -25,8 +25,8 @@ #define CY_BITMAP 16 struct TreeStateNode { - generic_string _label; - generic_string _extraData; + std::wstring _label; + std::wstring _extraData; bool _isExpanded = false; bool _isSelected = false; std::vector _children; @@ -43,7 +43,7 @@ public: HTREEITEM addItem(const wchar_t *itemName, HTREEITEM hParentItem, int iImage, LPARAM lParam = 0); bool setItemParam(HTREEITEM Item2Set, LPARAM param); LPARAM getItemParam(HTREEITEM Item2Get) const; - generic_string getItemDisplayName(HTREEITEM Item2Set) const; + std::wstring getItemDisplayName(HTREEITEM Item2Set) const; HTREEITEM searchSubItemByName(const wchar_t *itemName, HTREEITEM hParentItem); void removeItem(HTREEITEM hTreeItem); void removeAllItems(); @@ -116,7 +116,7 @@ public: bool swapTreeViewItem(HTREEITEM itemGoDown, HTREEITEM itemGoUp); bool restoreFoldingStateFrom(const TreeStateNode & treeState2Compare, HTREEITEM treeviewNode); bool retrieveFoldingStateTo(TreeStateNode & treeState2Construct, HTREEITEM treeviewNode); - bool searchLeafAndBuildTree(const TreeView & tree2Build, const generic_string & text2Search, int index2Search); + bool searchLeafAndBuildTree(const TreeView & tree2Build, const std::wstring & text2Search, int index2Search); void sort(HTREEITEM hTreeItem, bool isRecusive); void customSorting(HTREEITEM hTreeItem, PFNTVCOMPARE sortingCallbackFunc, LPARAM lParam, bool isRecursive); BOOL setImageList(int w, int h, int nbImage, int image_id, ...); @@ -132,7 +132,7 @@ protected: void cleanSubEntries(HTREEITEM hTreeItem); void dupTree(HTREEITEM hTree2Dup, HTREEITEM hParentItem); - bool searchLeafRecusivelyAndBuildTree(HTREEITEM tree2Build, const generic_string & text2Search, int index2Search, HTREEITEM tree2Search); + bool searchLeafRecusivelyAndBuildTree(HTREEITEM tree2Build, const std::wstring & text2Search, int index2Search, HTREEITEM tree2Search); // Drag and Drop operations HTREEITEM _draggedItem = nullptr; diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp index dfe0c2d2a..02265dc0c 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.cpp @@ -22,6 +22,8 @@ #include "resource.h" #include "localization.h" +using namespace std; + #define GET_X_LPARAM(lp) static_cast(LOWORD(lp)) #define GET_Y_LPARAM(lp) static_cast(HIWORD(lp)) @@ -414,7 +416,7 @@ intptr_t CALLBACK VerticalFileSwitcher::run_dlgProc(UINT message, WPARAM wParam, int i = pGetInfoTip->iItem; if (i == -1) return TRUE; - generic_string fn = getFullFilePath((size_t)i); + wstring fn = getFullFilePath((size_t)i); lstrcpyn(pGetInfoTip->pszText, fn.c_str(), pGetInfoTip->cchTextMax); return TRUE; } @@ -533,9 +535,9 @@ void VerticalFileSwitcher::initPopupMenus() NativeLangSpeaker* pNativeSpeaker = NppParameters::getInstance().getNativeLangSpeaker(); NppGUI& nppGUI = NppParameters::getInstance().getNppGUI(); - generic_string extStr = pNativeSpeaker->getAttrNameStr(L"Ext.", FS_ROOTNODE, FS_CLMNEXT); - generic_string pathStr = pNativeSpeaker->getAttrNameStr(L"Path", FS_ROOTNODE, FS_CLMNPATH); - generic_string groupStr = pNativeSpeaker->getAttrNameStr(L"Group by View", FS_ROOTNODE, FS_LVGROUPS); + wstring extStr = pNativeSpeaker->getAttrNameStr(L"Ext.", FS_ROOTNODE, FS_CLMNEXT); + wstring pathStr = pNativeSpeaker->getAttrNameStr(L"Path", FS_ROOTNODE, FS_CLMNPATH); + wstring groupStr = pNativeSpeaker->getAttrNameStr(L"Group by View", FS_ROOTNODE, FS_LVGROUPS); _hGlobalMenu = ::CreatePopupMenu(); ::InsertMenu(_hGlobalMenu, CLMNEXT_ID, MF_BYCOMMAND | MF_STRING, CLMNEXT_ID, extStr.c_str()); diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h index 75a3d8f1b..ecc03fcab 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcher.h @@ -71,7 +71,7 @@ public: _fileListView.setItemColor(bufferID); }; - generic_string getFullFilePath(size_t i) const { + std::wstring getFullFilePath(size_t i) const { return _fileListView.getFullFilePath(i); }; diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp index ff2cd1bb2..4dfc303bd 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.cpp @@ -20,6 +20,8 @@ #include "Buffer.h" #include "localization.h" +using namespace std; + void VerticalFileSwitcherListView::init(HINSTANCE hInst, HWND parent, HIMAGELIST hImaLst) { Window::init(hInst, parent); @@ -109,16 +111,16 @@ void VerticalFileSwitcherListView::initList() nameWidth -= nppParams._dpiManager.scaleX(nppParams.getNppGUI()._fileSwitcherPathWidth); //add columns - generic_string nameStr = pNativeSpeaker->getAttrNameStr(L"Name", FS_ROOTNODE, FS_CLMNNAME); + wstring nameStr = pNativeSpeaker->getAttrNameStr(L"Name", FS_ROOTNODE, FS_CLMNNAME); insertColumn(nameStr.c_str(), nameWidth, ++colIndex); if (isExtColumn) { - generic_string extStr = pNativeSpeaker->getAttrNameStr(L"Ext.", FS_ROOTNODE, FS_CLMNEXT); + wstring extStr = pNativeSpeaker->getAttrNameStr(L"Ext.", FS_ROOTNODE, FS_CLMNEXT); insertColumn(extStr.c_str(), nppParams._dpiManager.scaleX(nppParams.getNppGUI()._fileSwitcherExtWidth), ++colIndex); //2nd column } if (isPathColumn) { - generic_string pathStr = pNativeSpeaker->getAttrNameStr(L"Path", FS_ROOTNODE, FS_CLMNPATH); + wstring pathStr = pNativeSpeaker->getAttrNameStr(L"Path", FS_ROOTNODE, FS_CLMNPATH); insertColumn(pathStr.c_str(), nppParams._dpiManager.scaleX(nppParams.getNppGUI()._fileSwitcherPathWidth), ++colIndex); //2nd column if .ext is off } @@ -284,7 +286,7 @@ void VerticalFileSwitcherListView::setItemColor(BufferID bufferID) redraw(); } -generic_string VerticalFileSwitcherListView::getFullFilePath(size_t i) const +wstring VerticalFileSwitcherListView::getFullFilePath(size_t i) const { size_t nbItem = ListView_GetItemCount(_hSelf); if (i > nbItem) diff --git a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h index 6c4c07dbd..9ff25bbf9 100644 --- a/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h +++ b/PowerEditor/src/WinControls/VerticalFileSwitcher/VerticalFileSwitcherListView.h @@ -49,7 +49,7 @@ public: int closeItem(BufferID bufferID, int iView); void activateItem(BufferID bufferID, int iView); void setItemIconStatus(BufferID bufferID); - generic_string getFullFilePath(size_t i) const; + std::wstring getFullFilePath(size_t i) const; void setItemColor(BufferID bufferID); void insertColumn(const wchar_t *name, int width, int index); diff --git a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp index e6919475b..fdeaf1644 100644 --- a/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp +++ b/PowerEditor/src/WinControls/WindowsDlg/WindowsDlg.cpp @@ -378,7 +378,7 @@ intptr_t CALLBACK WindowsDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM lP Buffer* buf = getBuffer(pLvdi->item.iItem); if (!buf) return FALSE; - generic_string text; + wstring text; if (pLvdi->item.iSubItem == 0) // file name { text = buf->getFileName(); @@ -598,7 +598,7 @@ BOOL WindowsDlg::onInitDialog() lvColumn.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM | LVCF_FMT; lvColumn.fmt = LVCFMT_LEFT; - generic_string columnText; + wstring columnText; NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); columnText = L"⇵ " + pNativeSpeaker->getAttrNameStr(L"Name", WD_ROOTNODE, WD_CLMNNAME); @@ -644,7 +644,7 @@ void WindowsDlg::updateColumnNames() lvColumn.mask = LVCF_WIDTH | LVCF_TEXT | LVCF_SUBITEM | LVCF_FMT; lvColumn.fmt = LVCFMT_LEFT; - generic_string columnText; + wstring columnText; NativeLangSpeaker *pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); columnText = pNativeSpeaker->getAttrNameStr(L"Name", WD_ROOTNODE, WD_CLMNNAME); @@ -937,7 +937,7 @@ void WindowsDlg::doCount() { NativeLangSpeaker* pNativeSpeaker = (NppParameters::getInstance()).getNativeLangSpeaker(); - generic_string msg = pNativeSpeaker->getAttrNameStr(L"Windows", "Dialog", "Window", "title"); + wstring msg = pNativeSpeaker->getAttrNameStr(L"Windows", "Dialog", "Window", "title"); msg += L" - "; msg += pNativeSpeaker->getAttrNameStr(L"Total documents: ", WD_ROOTNODE, WD_NBDOCSTOTAL); msg += L" "; @@ -1166,7 +1166,7 @@ void WindowsMenu::initPopupMenu(HMENU hMenu, DocTabView* pTab) mii.cbSize = sizeof(mii); mii.fMask = MIIM_STRING | MIIM_STATE | MIIM_ID; - generic_string strBuffer(BuildMenuFileName(60, static_cast(pos), buf->getFileName(), !isDropListMenu)); + wstring strBuffer(BuildMenuFileName(60, static_cast(pos), buf->getFileName(), !isDropListMenu)); std::vector vBuffer(strBuffer.begin(), strBuffer.end()); vBuffer.push_back('\0'); mii.dwTypeData = (&vBuffer[0]); diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.cpp b/PowerEditor/src/WinControls/shortcut/shortcut.cpp index c708bd205..5c5e36194 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.cpp +++ b/PowerEditor/src/WinControls/shortcut/shortcut.cpp @@ -996,7 +996,7 @@ void ScintillaAccelerator::updateMenuItemByID(const ScintillaKeyMap& skm, int id } ++i; } - generic_string menuItem = cmdName; + wstring menuItem = cmdName; if (skm.isEnabled()) { menuItem += L"\t"; @@ -1189,7 +1189,7 @@ intptr_t CALLBACK ScintillaKeyMap::run_dlgProc(UINT Message, WPARAM wParam, LPAR ::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_INSERTSTRING, static_cast(-1), reinterpret_cast(string2wstring(toString(res), CP_UTF8).c_str())); } else - { //update current generic_string, can happen if it was disabled + { //update current string, can happen if it was disabled updateListItem(res); } ::SendDlgItemMessage(_hSelf, IDC_LIST_KEYS, LB_SETCURSEL, res, 0); diff --git a/PowerEditor/src/WinControls/shortcut/shortcut.h b/PowerEditor/src/WinControls/shortcut/shortcut.h index 018b3a474..465c78cab 100644 --- a/PowerEditor/src/WinControls/shortcut/shortcut.h +++ b/PowerEditor/src/WinControls/shortcut/shortcut.h @@ -142,7 +142,7 @@ public: }; virtual std::string toString() const; //the hotkey part - std::string toMenuItemString() const { //generic_string suitable for menu + std::string toMenuItemString() const { //std::wstring suitable for menu std::string str = _menuName; if (isEnabled()) { @@ -199,8 +199,8 @@ public: private : unsigned long _id = 0; - generic_string _category; - generic_string _shortcutName; + std::wstring _category; + std::wstring _shortcutName; int _nth = 0; // Allow several shortcuts for the same command (_id). // If there is the 2nd identical command in winKeyDefs array, the value of _nth will be 1. // This variable member allows the application to distinguish the different shortcuts assigned to the same command.