Changeset 78484 in vbox for trunk/src/VBox
- Timestamp:
- May 13, 2019 1:36:02 PM (6 years ago)
- svn:sync-xref-src-repo-rev:
- 130522
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Frontends/VirtualBox/src/logviewer/UIVMLogViewerSearchPanel.cpp
r78462 r78484 27 27 #include <QLineEdit> 28 28 #include <QPlainTextEdit> 29 #include <QScrollBar> 29 30 #include <QTextBlock> 30 31 … … 494 495 QTextCursor cursor(pDocument); 495 496 QTextDocument::FindFlags flags = constructFindFlags(ForwardSearch); 496 int lineCount = pDocument->lineCount();497 int blockCount = pDocument->blockCount(); 497 498 while (!cursor.isNull() && !cursor.atEnd()) 498 499 { … … 504 505 /* The following assumes we have single line blocks only: */ 505 506 int cursorLine = pDocument->findBlock(cursor.position()).blockNumber(); 506 if ( lineCount != 0)507 m_matchLocationVector.push_back(cursorLine / static_cast<float>( lineCount));507 if (blockCount != 0) 508 m_matchLocationVector.push_back(cursorLine / static_cast<float>(blockCount)); 508 509 } 509 510 } … … 523 524 cursor.setPosition(m_matchedCursorPosition.at(iMatchIndex), QTextCursor::MoveAnchor); 524 525 /* Move the cursor to the end of the matched string while keeping the anchor at the begining thus selecting the text: */ 525 cursor.setPosition(m_matchedCursorPosition.at(iMatchIndex)+searchString.length(), QTextCursor::KeepAnchor); 526 cursor.setPosition(m_matchedCursorPosition.at(iMatchIndex) + searchString.length(), QTextCursor::KeepAnchor); 527 textEdit()->ensureCursorVisible(); 526 528 textEdit()->setTextCursor(cursor); 527 529 return;
Note:
See TracChangeset
for help on using the changeset viewer.