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 <utils/qtcassert.h>
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QTextBlock>
|
||||
|
||||
@@ -104,7 +106,7 @@ CppQuickFixAssistInterface::CppQuickFixAssistInterface(CPPEditorWidget *editor,
|
||||
, m_currentFile(CppRefactoringChanges::file(editor, m_semanticInfo.doc))
|
||||
, 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);
|
||||
m_path = astPath(editor->textCursor());
|
||||
}
|
||||
|
@@ -253,8 +253,8 @@ QString RefactoringFile::fileName() const
|
||||
|
||||
int RefactoringFile::position(unsigned line, unsigned column) const
|
||||
{
|
||||
Q_ASSERT(line != 0);
|
||||
Q_ASSERT(column != 0);
|
||||
QTC_ASSERT(line != 0, return -1);
|
||||
QTC_ASSERT(column != 0, return -1);
|
||||
if (const QTextDocument *doc = document())
|
||||
return doc->findBlockByNumber(line - 1).position() + column - 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
|
||||
{
|
||||
Q_ASSERT(line);
|
||||
Q_ASSERT(column);
|
||||
Q_ASSERT(offset >= 0);
|
||||
QTC_ASSERT(line, return);
|
||||
QTC_ASSERT(column, return);
|
||||
QTC_ASSERT(offset >= 0, return);
|
||||
QTextCursor c(cursor());
|
||||
c.setPosition(offset);
|
||||
*line = c.blockNumber() + 1;
|
||||
|
Reference in New Issue
Block a user