diff options
author | Gerald Combs <gerald@wireshark.org> | 2012-11-06 22:17:06 +0000 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2012-11-06 22:17:06 +0000 |
commit | 8865f925c21d5acfcdca8e050b5f9981e6298b01 (patch) | |
tree | dee432b9e757dca107b7cff02659a4af99e8ac80 /ui | |
parent | 32074376acc8400f808688660a518d2e827d2edc (diff) | |
download | wireshark-8865f925c21d5acfcdca8e050b5f9981e6298b01.tar.gz wireshark-8865f925c21d5acfcdca8e050b5f9981e6298b01.tar.bz2 wireshark-8865f925c21d5acfcdca8e050b5f9981e6298b01.zip |
Fix our offset calculation.
svn path=/trunk/; revision=45954
Diffstat (limited to 'ui')
-rw-r--r-- | ui/qt/byte_view_text.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/ui/qt/byte_view_text.cpp b/ui/qt/byte_view_text.cpp index 7f21da3ebb..d4801d8a9d 100644 --- a/ui/qt/byte_view_text.cpp +++ b/ui/qt/byte_view_text.cpp @@ -27,6 +27,7 @@ #include "wireshark_application.h" #include <QTextCursor> +#include <QTextBlock> #include <QApplication> #include <QMouseEvent> @@ -51,6 +52,7 @@ ByteViewText::ByteViewText(QWidget *parent, tvbuff_t *tvb, proto_tree *tree, QTr offset_width_(4) { setReadOnly(true); + setUndoRedoEnabled(false); setLineWrapMode(QTextEdit::NoWrap); setState(StateNormal); @@ -315,8 +317,9 @@ int ByteViewText::flushBytes(QString &str) void ByteViewText::scrollToByte(int byte) { QTextCursor cursor(textCursor()); + cursor.setPosition(0); - cursor.setPosition(byte * (per_line_ + 1)); // Newline + cursor.setPosition(byte * cursor.block().length() / per_line_); setTextCursor(cursor); ensureCursorVisible(); } |