Skip to content
Snippets Groups Projects
Commit a45ccb0d authored by Nikolai Kosjar's avatar Nikolai Kosjar Committed by hjk
Browse files

CppEditor: Replace Q_ASSERT with QTC_ASSERT/QTC_CHECK


Change-Id: I1ae059f2fcc2b667d9fe36799b15358815c8acea
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 6f0294b0
No related branches found
No related tags found
No related merge requests found
...@@ -50,6 +50,8 @@ ...@@ -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, ...@@ -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 ...@@ -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 ...@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment