| 452 | } |
| 453 | |
| 454 | void InlineChatWidgetPrivate::handleReject() |
| 455 | { |
| 456 | if (!chatInfo.tempText.isEmpty()) { |
| 457 | QString replaceText = chatInfo.originalText; |
| 458 | if (!replaceText.endsWith('\n')) |
| 459 | replaceText.append('\n'); |
| 460 | |
| 461 | int endLineOffset = chatInfo.tempText.count('\n') - chatInfo.originalText.count('\n') - 1; |
| 462 | chatInfo.tempText.clear(); |
| 463 | Edit::Range replaceRange = chatInfo.originalRange; |
| 464 | replaceRange.end.line += endLineOffset; |
| 465 | editSrv->replaceRange(chatInfo.fileName, replaceRange, replaceText); |
| 466 | editSrv->setRangeBackgroundColor(chatInfo.fileName, chatInfo.originalRange.start.line, |
| 467 | chatInfo.originalRange.end.line, selectionMarker); |
| 468 | } |
| 469 | |
| 470 | if (insertMarker != -1) |
| 471 | editSrv->clearAllBackgroundColor(chatInfo.fileName, insertMarker); |
| 472 | if (deleteMarker != -1) |
| 473 | editSrv->clearAllBackgroundColor(chatInfo.fileName, deleteMarker); |
| 474 | setState(Original); |
| 475 | q->setFocus(); |
| 476 | } |
| 477 | |
| 478 | void InlineChatWidgetPrivate::handleClose() |
| 479 | { |
no test coverage detected