mirror of
https://gitee.com/openharmony/arkui_ace_engine
synced 2024-10-07 08:24:11 +00:00
!44024 【RichEditor】修复Crash问题
Merge pull request !44024 from FreemanBao/cherry-pick-1726815241
This commit is contained in:
commit
1ee232942a
@ -5621,6 +5621,13 @@ int32_t RichEditorPattern::ProcessDeleteNodes(std::list<RichEditorAbstractSpanRe
|
||||
CHECK_NULL_RETURN(spanItem, eraseLength);
|
||||
auto text = spanItem->content;
|
||||
std::wstring textTemp = StringUtils::ToWstring(text);
|
||||
auto textTempSize = static_cast<int32_t>(textTemp.size());
|
||||
if (textTempSize < it.OffsetInSpan()) {
|
||||
TAG_LOGW(AceLogTag::ACE_RICH_TEXT, "ProcessDeleteNodes failed, "
|
||||
"content = %{private}s, spanItemSize = %{public}d, offsetInSpan = %{public}d",
|
||||
text.c_str(), textTempSize, it.OffsetInSpan());
|
||||
continue;
|
||||
}
|
||||
textTemp.erase(it.OffsetInSpan(), it.GetEraseLength());
|
||||
if (textTemp.size() == 0) {
|
||||
deleteNodes.emplace(it.GetSpanIndex());
|
||||
|
Loading…
Reference in New Issue
Block a user