forked from qt-creator/qt-creator
TextEditor: Consolidate document access functions.
There was document(), textDocument() and baseTextDocument(). Two should be enough... Change-Id: Id9e41c8d857c5cb3269a9fce5ab594d34448c982 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
@@ -550,7 +550,7 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
|
||||
}
|
||||
|
||||
// Now we prefer the doc from the snapshot with macros expanded.
|
||||
Document::Ptr doc = snapshot.document(m_widget->baseTextDocument()->filePath());
|
||||
Document::Ptr doc = snapshot.document(m_widget->textDocument()->filePath());
|
||||
if (!doc) {
|
||||
doc = documentFromSemanticInfo;
|
||||
if (!doc)
|
||||
@@ -645,7 +645,7 @@ BaseTextEditorWidget::Link FollowSymbolUnderCursor::findLink(const QTextCursor &
|
||||
if (Symbol *d = r.declaration()) {
|
||||
if (d->isDeclaration() || d->isFunction()) {
|
||||
const QString fileName = QString::fromUtf8(d->fileName(), d->fileNameLength());
|
||||
if (m_widget->baseTextDocument()->filePath() == fileName) {
|
||||
if (m_widget->textDocument()->filePath() == fileName) {
|
||||
if (unsigned(lineNumber) == d->line()
|
||||
&& unsigned(positionInBlock) >= d->column()) { // TODO: check the end
|
||||
result = r; // take the symbol under cursor.
|
||||
|
||||
Reference in New Issue
Block a user