Fix a crash issue while doing a column insertion on a CJK unicode document

Fixes #3314
This commit is contained in:
Don HO 2017-05-30 09:01:51 +02:00
parent 85216fe577
commit a00a913752

View File

@ -136,6 +136,9 @@ INT_PTR CALLBACK ColumnEditorDlg::run_dlgProc(UINT message, WPARAM wParam, LPARA
{
auto posAbs2Start = (*_ppEditView)->execute(SCI_FINDCOLUMN, i, cursorCol);
auto posRelative2Start = posAbs2Start - lineBegin;
if (posRelative2Start > static_cast<long long>(s2r.length()))
posRelative2Start = s2r.length();
s2r.insert(posRelative2Start, str);
}
(*_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 posRelative2Start = posAbs2Start - lineBegin;
if (posRelative2Start > static_cast<long long>(s2r.length()))
posRelative2Start = s2r.length();
s2r.insert(posRelative2Start, str);
}