mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-07-27 07:44:24 +02:00
Fix a x64 crash issue on macro recording
This commit is contained in:
parent
517d82a29a
commit
8e9e8c04cd
@ -805,11 +805,14 @@ BOOL Notepad_plus::notify(SCNotification *notification)
|
||||
|
||||
case SCN_MACRORECORD:
|
||||
{
|
||||
_macro.push_back(recordedMacroStep(
|
||||
_macro.push_back(
|
||||
recordedMacroStep(
|
||||
notification->message,
|
||||
static_cast<long>(notification->wParam),
|
||||
static_cast<long>(notification->lParam),
|
||||
static_cast<int32_t>(_pEditView->execute(SCI_GETCODEPAGE))));
|
||||
notification->wParam,
|
||||
notification->lParam,
|
||||
static_cast<int32_t>(_pEditView->execute(SCI_GETCODEPAGE))
|
||||
)
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -2842,8 +2842,8 @@ void NppParameters::insertMacro(TiXmlNode *macrosRoot, const MacroShortcut & mac
|
||||
const recordedMacroStep & action = macro._macro[i];
|
||||
actionNode->ToElement()->SetAttribute(TEXT("type"), action._macroType);
|
||||
actionNode->ToElement()->SetAttribute(TEXT("message"), action._message);
|
||||
actionNode->ToElement()->SetAttribute(TEXT("wParam"), action._wParameter);
|
||||
actionNode->ToElement()->SetAttribute(TEXT("lParam"), action._lParameter);
|
||||
actionNode->ToElement()->SetAttribute(TEXT("wParam"), static_cast<int>(action._wParameter));
|
||||
actionNode->ToElement()->SetAttribute(TEXT("lParam"), static_cast<int>(action._lParameter));
|
||||
actionNode->ToElement()->SetAttribute(TEXT("sParam"), action._sParameter.c_str());
|
||||
}
|
||||
}
|
||||
|
@ -2283,7 +2283,7 @@ void FindReplaceDlg::setStatusbarMessage(const generic_string & msg, FindStatus
|
||||
}
|
||||
}
|
||||
|
||||
void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stringValue)
|
||||
void FindReplaceDlg::execSavedCommand(int cmd, uptr_t intValue, generic_string stringValue)
|
||||
{
|
||||
switch(cmd)
|
||||
{
|
||||
@ -2306,7 +2306,7 @@ void FindReplaceDlg::execSavedCommand(int cmd, int intValue, generic_string stri
|
||||
_env->_dotMatchesNewline = ((intValue & IDF_REDOTMATCHNL)> 0);
|
||||
break;
|
||||
case IDNORMAL:
|
||||
_env->_searchType = (SearchType)intValue;
|
||||
_env->_searchType = static_cast<SearchType>(intValue);
|
||||
break;
|
||||
case IDREPLACEWITH:
|
||||
_env->_str4Replace = stringValue;
|
||||
|
@ -329,7 +329,7 @@ public :
|
||||
}
|
||||
};
|
||||
|
||||
void execSavedCommand(int cmd, int intValue, generic_string stringValue);
|
||||
void execSavedCommand(int cmd, uptr_t intValue, generic_string stringValue);
|
||||
void setStatusbarMessage(const generic_string & msg, FindStatus staus);
|
||||
Finder * createFinder();
|
||||
bool removeFinder(Finder *finder2remove);
|
||||
|
@ -616,7 +616,7 @@ void Accelerator::updateMenuItemByCommand(CommandShortcut csc)
|
||||
::ModifyMenu(_hAccelMenu, cmdID, cmdFlags, cmdID, csc.toMenuItemString().c_str());
|
||||
}
|
||||
|
||||
recordedMacroStep::recordedMacroStep(int iMessage, long wParam, long lParam, int codepage)
|
||||
recordedMacroStep::recordedMacroStep(int iMessage, uptr_t wParam, uptr_t lParam, int codepage)
|
||||
: _message(iMessage), _wParameter(wParam), _lParameter(lParam), _macroType(mtUseLParameter)
|
||||
{
|
||||
if (_lParameter) {
|
||||
|
@ -273,15 +273,15 @@ struct recordedMacroStep {
|
||||
enum MacroTypeIndex {mtUseLParameter, mtUseSParameter, mtMenuCommand, mtSavedSnR};
|
||||
|
||||
int _message = 0;
|
||||
long _wParameter = 0;
|
||||
long _lParameter = 0;
|
||||
uptr_t _wParameter = 0;
|
||||
uptr_t _lParameter = 0;
|
||||
generic_string _sParameter;
|
||||
MacroTypeIndex _macroType = mtMenuCommand;
|
||||
|
||||
recordedMacroStep(int iMessage, long wParam, long lParam, int codepage);
|
||||
recordedMacroStep(int iMessage, uptr_t wParam, uptr_t lParam, int codepage);
|
||||
explicit recordedMacroStep(int iCommandID): _wParameter(iCommandID) {};
|
||||
|
||||
recordedMacroStep(int iMessage, long wParam, long lParam, const TCHAR *sParam, int type)
|
||||
recordedMacroStep(int iMessage, uptr_t wParam, uptr_t lParam, const TCHAR *sParam, int type)
|
||||
: _message(iMessage), _wParameter(wParam), _lParameter(lParam), _macroType(MacroTypeIndex(type)){
|
||||
_sParameter = (sParam)?generic_string(sParam):TEXT("");
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user