Permalink
Browse files

fix textbox crash, fix ctrl+c / ctrl+x to not copy an empty string wh…

…en the textbox is empty
  • Loading branch information...
jacob1 committed Sep 11, 2015
1 parent a629979 commit 81b2efaf5bb0cc539a05e4d50caeb8793c63beb3
Showing with 5 additions and 0 deletions.
  1. +2 −0 src/gui/interface/Label.cpp
  2. +3 −0 src/gui/interface/Textbox.cpp
@@ -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();

0 comments on commit 81b2efa

Please sign in to comment.