mirror of
https://github.com/notepad-plus-plus/notepad-plus-plus.git
synced 2025-09-23 01:48:20 +02:00
Fix a crash issue while doing a column insertion on a CJK unicode document
Fixes #3314
This commit is contained in:
parent
85216fe577
commit
a00a913752
@ -136,6 +136,9 @@ INT_PTR CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||||||
{
|
{
|
||||||
auto posAbs2Start = (*_ppEditView)->execute(SCI_FINDCOLUMN, i, cursorCol);
|
auto posAbs2Start = (*_ppEditView)->execute(SCI_FINDCOLUMN, i, cursorCol);
|
||||||
auto posRelative2Start = posAbs2Start - lineBegin;
|
auto posRelative2Start = posAbs2Start - lineBegin;
|
||||||
|
if (posRelative2Start > static_cast<long long>(s2r.length()))
|
||||||
|
posRelative2Start = s2r.length();
|
||||||
|
|
||||||
s2r.insert(posRelative2Start, str);
|
s2r.insert(posRelative2Start, str);
|
||||||
}
|
}
|
||||||
(*_ppEditView)->replaceTarget(s2r.c_str(), int(lineBegin), int(lineEnd));
|
(*_ppEditView)->replaceTarget(s2r.c_str(), int(lineBegin), int(lineEnd));
|
||||||
@ -249,6 +252,9 @@ INT_PTR CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
|
|||||||
{
|
{
|
||||||
auto posAbs2Start = (*_ppEditView)->execute(SCI_FINDCOLUMN, i, cursorCol);
|
auto posAbs2Start = (*_ppEditView)->execute(SCI_FINDCOLUMN, i, cursorCol);
|
||||||
auto posRelative2Start = posAbs2Start - lineBegin;
|
auto posRelative2Start = posAbs2Start - lineBegin;
|
||||||
|
if (posRelative2Start > static_cast<long long>(s2r.length()))
|
||||||
|
posRelative2Start = s2r.length();
|
||||||
|
|
||||||
s2r.insert(posRelative2Start, str);
|
s2r.insert(posRelative2Start, str);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user