From b204be90124be5c05670e0701aec6c8e9e08a201 Mon Sep 17 00:00:00 2001 From: Shridhar Kumar <45252729+shriprem@users.noreply.github.com> Date: Tue, 31 May 2022 17:00:54 -0400 Subject: [PATCH] Fix a small regression in DebugInfo dialog Remove "$COMMAND_LINE_PLACEHOLDER$ from the copied DebugInfo text. Fix #11752, close #11753 --- PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp | 14 +++++++------- PowerEditor/src/WinControls/AboutDlg/AboutDlg.h | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp index 7173501dd..282b38166 100644 --- a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp +++ b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.cpp @@ -359,10 +359,10 @@ intptr_t CALLBACK DebugInfoDlg::run_dlgProc(UINT message, WPARAM wParam, LPARAM if ((GetKeyState(VK_LBUTTON) & 0x100) != 0) { // Visual effect - ::SendDlgItemMessage(_hSelf, IDC_DEBUGINFO_EDIT, EM_SETSEL, 0, _debugInfoStr.length() - 1); + ::SendDlgItemMessage(_hSelf, IDC_DEBUGINFO_EDIT, EM_SETSEL, 0, _debugInfoDisplay.length() - 1); // Copy to clipboard - str2Clipboard(_debugInfoStr, _hSelf); + str2Clipboard(_debugInfoDisplay, _hSelf); } return TRUE; } @@ -394,17 +394,17 @@ void DebugInfoDlg::doDialog() void DebugInfoDlg::refreshDebugInfo() { - generic_string debugInfoDisplay { _debugInfoStr }; + _debugInfoDisplay = _debugInfoStr; - size_t replacePos = debugInfoDisplay.find(_cmdLinePlaceHolder); + size_t replacePos = _debugInfoDisplay.find(_cmdLinePlaceHolder); if (replacePos != std::string::npos) { - debugInfoDisplay.replace(replacePos, _cmdLinePlaceHolder.length(), NppParameters::getInstance().getCmdLineString()); + _debugInfoDisplay.replace(replacePos, _cmdLinePlaceHolder.length(), NppParameters::getInstance().getCmdLineString()); } // Set Debug Info text and leave the text in selected state - ::SetDlgItemText(_hSelf, IDC_DEBUGINFO_EDIT, debugInfoDisplay.c_str()); - ::SendDlgItemMessage(_hSelf, IDC_DEBUGINFO_EDIT, EM_SETSEL, 0, debugInfoDisplay.length() - 1); + ::SetDlgItemText(_hSelf, IDC_DEBUGINFO_EDIT, _debugInfoDisplay.c_str()); + ::SendDlgItemMessage(_hSelf, IDC_DEBUGINFO_EDIT, EM_SETSEL, 0, _debugInfoDisplay.length() - 1); ::SetFocus(::GetDlgItem(_hSelf, IDC_DEBUGINFO_EDIT)); } diff --git a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h index 119e0bf19..fe631d5c0 100644 --- a/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h +++ b/PowerEditor/src/WinControls/AboutDlg/AboutDlg.h @@ -82,6 +82,7 @@ protected: private: typedef const CHAR * (__cdecl * PWINEGETVERSION)(); generic_string _debugInfoStr; + generic_string _debugInfoDisplay; const generic_string _cmdLinePlaceHolder { L"$COMMAND_LINE_PLACEHOLDER$" }; bool _isAdmin = false; generic_string _loadedPlugins;