forked from qt-creator/qt-creator
CppEditor: Replace Q_ASSERT with QTC_ASSERT/QTC_CHECK
Change-Id: I1ae059f2fcc2b667d9fe36799b15358815c8acea Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
@@ -50,6 +50,8 @@
|
|||||||
|
|
||||||
#include <extensionsystem/pluginmanager.h>
|
#include <extensionsystem/pluginmanager.h>
|
||||||
|
|
||||||
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
|
|
||||||
@@ -104,7 +106,7 @@ CppQuickFixAssistInterface::CppQuickFixAssistInterface(CPPEditorWidget *editor,
|
|||||||
, m_currentFile(CppRefactoringChanges::file(editor, m_semanticInfo.doc))
|
, m_currentFile(CppRefactoringChanges::file(editor, m_semanticInfo.doc))
|
||||||
, m_context(m_semanticInfo.doc, m_snapshot)
|
, m_context(m_semanticInfo.doc, m_snapshot)
|
||||||
{
|
{
|
||||||
Q_ASSERT(!m_semanticInfo.doc.isNull());
|
QTC_CHECK(!m_semanticInfo.doc.isNull());
|
||||||
CPlusPlus::ASTPath astPath(m_semanticInfo.doc);
|
CPlusPlus::ASTPath astPath(m_semanticInfo.doc);
|
||||||
m_path = astPath(editor->textCursor());
|
m_path = astPath(editor->textCursor());
|
||||||
}
|
}
|
||||||
|
@@ -253,8 +253,8 @@ QString RefactoringFile::fileName() const
|
|||||||
|
|
||||||
int RefactoringFile::position(unsigned line, unsigned column) const
|
int RefactoringFile::position(unsigned line, unsigned column) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(line != 0);
|
QTC_ASSERT(line != 0, return -1);
|
||||||
Q_ASSERT(column != 0);
|
QTC_ASSERT(column != 0, return -1);
|
||||||
if (const QTextDocument *doc = document())
|
if (const QTextDocument *doc = document())
|
||||||
return doc->findBlockByNumber(line - 1).position() + column - 1;
|
return doc->findBlockByNumber(line - 1).position() + column - 1;
|
||||||
return -1;
|
return -1;
|
||||||
@@ -262,9 +262,9 @@ int RefactoringFile::position(unsigned line, unsigned column) const
|
|||||||
|
|
||||||
void RefactoringFile::lineAndColumn(int offset, unsigned *line, unsigned *column) const
|
void RefactoringFile::lineAndColumn(int offset, unsigned *line, unsigned *column) const
|
||||||
{
|
{
|
||||||
Q_ASSERT(line);
|
QTC_ASSERT(line, return);
|
||||||
Q_ASSERT(column);
|
QTC_ASSERT(column, return);
|
||||||
Q_ASSERT(offset >= 0);
|
QTC_ASSERT(offset >= 0, return);
|
||||||
QTextCursor c(cursor());
|
QTextCursor c(cursor());
|
||||||
c.setPosition(offset);
|
c.setPosition(offset);
|
||||||
*line = c.blockNumber() + 1;
|
*line = c.blockNumber() + 1;
|
||||||
|
Reference in New Issue
Block a user