From c76f178534bba518f263c8120b732801e13c4916 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 23 Apr 2023 03:46:29 +0200 Subject: [PATCH] Fix regression of macro recording Fix #13565, close #13570 --- PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp index 900997041..3cff00e33 100644 --- a/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp +++ b/PowerEditor/src/ScintillaComponent/FindReplaceDlg.cpp @@ -3565,7 +3565,7 @@ void FindReplaceDlg::saveInMacro(size_t cmd, int cmdType) { int booleans = 0; ::SendMessage(_hParent, WM_FRSAVE_INT, IDC_FRCOMMAND_INIT, 0); - ::SendMessage(_hParent, WM_FRSAVE_STR, IDFINDWHAT, reinterpret_cast(cmd == IDC_CLEAR_ALL ? TEXT("") : _options._str2Search.c_str())); + ::SendMessage(_hParent, WM_FRSAVE_STR, IDFINDWHAT, reinterpret_cast(cmd == IDC_CLEAR_ALL ? "" : wstring2string(_options._str2Search, CP_UTF8).c_str())); booleans |= _options._isWholeWord?IDF_WHOLEWORD:0; booleans |= _options._isMatchCase?IDF_MATCHCASE:0; booleans |= _options._dotMatchesNewline?IDF_REDOTMATCHNL:0; @@ -3577,17 +3577,17 @@ void FindReplaceDlg::saveInMacro(size_t cmd, int cmdType) booleans |= _options._doMarkLine?IDF_MARKLINE_CHECK:0; } if (cmdType & FR_OP_REPLACE) - ::SendMessage(_hParent, WM_FRSAVE_STR, IDREPLACEWITH, reinterpret_cast(_options._str4Replace.c_str())); + ::SendMessage(_hParent, WM_FRSAVE_STR, IDREPLACEWITH, reinterpret_cast(wstring2string(_options._str4Replace, CP_UTF8).c_str())); if (cmdType & FR_OP_FIF) { - ::SendMessage(_hParent, WM_FRSAVE_STR, IDD_FINDINFILES_DIR_COMBO, reinterpret_cast(_options._directory.c_str())); - ::SendMessage(_hParent, WM_FRSAVE_STR, IDD_FINDINFILES_FILTERS_COMBO, reinterpret_cast(_options._filters.c_str())); + ::SendMessage(_hParent, WM_FRSAVE_STR, IDD_FINDINFILES_DIR_COMBO, reinterpret_cast(wstring2string(_options._directory, CP_UTF8).c_str())); + ::SendMessage(_hParent, WM_FRSAVE_STR, IDD_FINDINFILES_FILTERS_COMBO, reinterpret_cast(wstring2string(_options._filters, CP_UTF8).c_str())); booleans |= _options._isRecursive?IDF_FINDINFILES_RECURSIVE_CHECK:0; booleans |= _options._isInHiddenDir?IDF_FINDINFILES_INHIDDENDIR_CHECK:0; } if (cmdType & FR_OP_FIP) { - ::SendMessage(_hParent, WM_FRSAVE_STR, IDD_FINDINFILES_FILTERS_COMBO, reinterpret_cast(_options._filters.c_str())); + ::SendMessage(_hParent, WM_FRSAVE_STR, IDD_FINDINFILES_FILTERS_COMBO, reinterpret_cast(wstring2string(_options._filters, CP_UTF8).c_str())); booleans |= _options._isProjectPanel_1?IDF_FINDINFILES_PROJECT1_CHECK:0; booleans |= _options._isProjectPanel_2?IDF_FINDINFILES_PROJECT2_CHECK:0; booleans |= _options._isProjectPanel_3?IDF_FINDINFILES_PROJECT3_CHECK:0;