Commit b976a34e authored by hjk's avatar hjk
Browse files

bineditor: allow copying also if selection is "backwards"

parent ad0eff18
......@@ -1290,9 +1290,11 @@ void BinEditor::zoomOut(int range)
void BinEditor::copy(bool raw)
{
const int selStart = selectionStart();
const int selEnd = selectionEnd();
if (selStart < selEnd) {
int selStart = selectionStart();
int selEnd = selectionEnd();
if (selStart >= selEnd)
qSwap(selStart, selEnd);
const int selectionLength = selEnd - selStart;
if (selectionLength >> 22) {
QMessageBox::warning(this, tr("Copying Failed"),
......@@ -1313,7 +1315,6 @@ void BinEditor::copy(bool raw)
}
hexString.chop(1);
QApplication::clipboard()->setText(hexString);
}
}
void BinEditor::highlightSearchResults(const QByteArray &pattern, QTextDocument::FindFlags findFlags)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment