fix textbox crash, fix ctrl+c / ctrl+x to not copy an empty string when the textbox is empty
This commit is contained in:
parent
a629979d8b
commit
81b2efaf5b
@ -215,6 +215,8 @@ void Label::copySelection()
|
||||
copyText = currentText.substr(selectionIndex0, selectionIndex1-selectionIndex0).c_str();
|
||||
else if(selectionIndex0 > selectionIndex1)
|
||||
copyText = currentText.substr(selectionIndex1, selectionIndex0-selectionIndex1).c_str();
|
||||
else if (!currentText.length())
|
||||
return;
|
||||
else
|
||||
copyText = currentText.c_str();
|
||||
ClipboardPush(format::CleanString(copyText, false, true, false));
|
||||
|
@ -146,8 +146,11 @@ void Textbox::cutSelection()
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!backingText.length())
|
||||
return;
|
||||
ClipboardPush(format::CleanString(backingText, false, true, false));
|
||||
backingText.clear();
|
||||
cursor = 0;
|
||||
}
|
||||
ClearSelection();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user