| 464 | } |
| 465 | |
| 466 | void GuiTextEditCtrl::onCopy(bool andCut) |
| 467 | { |
| 468 | // Don't copy/cut password field! |
| 469 | if(mPasswordText) |
| 470 | return; |
| 471 | |
| 472 | if (mBlockEnd > 0) |
| 473 | { |
| 474 | //save the current state |
| 475 | saveUndoState(); |
| 476 | |
| 477 | //copy the text to the clipboard |
| 478 | UTF8* clipBuff = mTextBuffer.createSubstring8(mBlockStart, mBlockEnd - mBlockStart); |
| 479 | Platform::setClipboard(clipBuff); |
| 480 | delete[] clipBuff; |
| 481 | |
| 482 | //if we pressed the cut shortcut, we need to cut the selected text from the control... |
| 483 | if (andCut) |
| 484 | { |
| 485 | mTextBuffer.cut(mBlockStart, mBlockEnd - mBlockStart); |
| 486 | mCursorPos = mBlockStart; |
| 487 | } |
| 488 | |
| 489 | mBlockStart = 0; |
| 490 | mBlockEnd = 0; |
| 491 | } |
| 492 | |
| 493 | } |
| 494 | |
| 495 | void GuiTextEditCtrl::onPaste() |
| 496 | { |
nothing calls this directly
no test coverage detected