diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2012-12-20 22:00:09 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-12-21 01:09:33 +0100 |
commit | b9511fe1e92186f468cd7d6ad6b9c7318118e093 (patch) | |
tree | 18925133467ae7bde0d0620742932f0423788774 /src/plugins/bineditor | |
parent | 70a14404c20369b3df04ba481c499aa5189e1aab (diff) | |
download | qt-creator-b9511fe1e92186f468cd7d6ad6b9c7318118e093.tar.gz |
BinEditor: Fix selection
* Last column is not selectable using the mouse
* Last byte is not selectable at all
Task-number: QTCREATORBUG-5209
Change-Id: I9b87819818bb3dab80ef2803208391599d206f1f
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/bineditor')
-rw-r--r-- | src/plugins/bineditor/bineditor.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/bineditor/bineditor.cpp b/src/plugins/bineditor/bineditor.cpp index 512a4629e2..f77c247e10 100644 --- a/src/plugins/bineditor/bineditor.cpp +++ b/src/plugins/bineditor/bineditor.cpp @@ -734,7 +734,7 @@ void BinEditor::paintEvent(QPaintEvent *e) selEnd = m_cursorPosition; } else { selStart = m_cursorPosition; - selEnd = m_anchorPosition + 1; + selEnd = m_anchorPosition; } QString itemString(m_bytesPerLine*3, QLatin1Char(' ')); @@ -834,7 +834,7 @@ void BinEditor::paintEvent(QPaintEvent *e) m_lineHeight, color); } - if (selStart < selEnd && !isFullySelected && pos >= selStart && pos < selEnd) { + if (selStart < selEnd && !isFullySelected && pos >= selStart && pos <= selEnd) { selectionRect |= QRect(item_x, y-m_ascent, m_columnWidth, m_lineHeight); int printable_item_x = -xoffset + m_margin + m_labelWidth + m_bytesPerLine * m_columnWidth + m_charWidth + fm.width(printable.left(c)); @@ -1380,7 +1380,7 @@ void BinEditor::copy(bool raw) if (selStart >= selEnd) qSwap(selStart, selEnd); - const int selectionLength = selEnd - selStart; + const int selectionLength = selEnd - selStart + 1; if (selectionLength >> 22) { QMessageBox::warning(this, tr("Copying Failed"), tr("You cannot copy more than 4 MB of binary data.")); |