forked from qt-creator/qt-creator
CppEditor: Pass some values by reference
Change-Id: I18af0c97c22ef2189ebaeaacd32030b22f838c3d Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
ee26fdf32c
commit
278eb8f93d
@@ -124,7 +124,7 @@ static QByteArray &removeTrailingWhitespace(QByteArray &input)
|
|||||||
|
|
||||||
/// The '@' in the originalSource is the position from where the quick-fix discovery is triggered.
|
/// The '@' in the originalSource is the position from where the quick-fix discovery is triggered.
|
||||||
/// Exactly one TestFile must contain the cursor position marker '@' in the originalSource.
|
/// Exactly one TestFile must contain the cursor position marker '@' in the originalSource.
|
||||||
QuickFixTestCase::QuickFixTestCase(const QList<QuickFixTestDocument::Ptr> theTestFiles,
|
QuickFixTestCase::QuickFixTestCase(const QList<QuickFixTestDocument::Ptr> &theTestFiles,
|
||||||
CppQuickFixFactory *factory,
|
CppQuickFixFactory *factory,
|
||||||
const QStringList &includePaths,
|
const QStringList &includePaths,
|
||||||
int resultIndex)
|
int resultIndex)
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public:
|
|||||||
class QuickFixTestCase : public TestCase
|
class QuickFixTestCase : public TestCase
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QuickFixTestCase(const QList<QuickFixTestDocument::Ptr> theTestFiles,
|
QuickFixTestCase(const QList<QuickFixTestDocument::Ptr> &theTestFiles,
|
||||||
CppQuickFixFactory *factory,
|
CppQuickFixFactory *factory,
|
||||||
const QStringList &includePaths = QStringList(),
|
const QStringList &includePaths = QStringList(),
|
||||||
int resultIndex = 0);
|
int resultIndex = 0);
|
||||||
|
|||||||
@@ -4163,7 +4163,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
MoveFuncDefOutsideOp(const QSharedPointer<const CppQuickFixAssistInterface> &interface,
|
MoveFuncDefOutsideOp(const QSharedPointer<const CppQuickFixAssistInterface> &interface,
|
||||||
MoveType type, FunctionDefinitionAST *funcDef, const QString cppFileName)
|
MoveType type, FunctionDefinitionAST *funcDef, const QString &cppFileName)
|
||||||
: CppQuickFixOperation(interface, 0)
|
: CppQuickFixOperation(interface, 0)
|
||||||
, m_funcDef(funcDef)
|
, m_funcDef(funcDef)
|
||||||
, m_type(type)
|
, m_type(type)
|
||||||
@@ -4297,9 +4297,9 @@ class MoveFuncDefToDeclOp : public CppQuickFixOperation
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
MoveFuncDefToDeclOp(const QSharedPointer<const CppQuickFixAssistInterface> &interface,
|
MoveFuncDefToDeclOp(const QSharedPointer<const CppQuickFixAssistInterface> &interface,
|
||||||
const QString fromFileName, const QString toFileName,
|
const QString &fromFileName, const QString &toFileName,
|
||||||
FunctionDefinitionAST *funcDef, const QString declText,
|
FunctionDefinitionAST *funcDef, const QString &declText,
|
||||||
const ChangeSet::Range toRange)
|
const ChangeSet::Range &toRange)
|
||||||
: CppQuickFixOperation(interface, 0)
|
: CppQuickFixOperation(interface, 0)
|
||||||
, m_fromFileName(fromFileName)
|
, m_fromFileName(fromFileName)
|
||||||
, m_toFileName(toFileName)
|
, m_toFileName(toFileName)
|
||||||
@@ -4680,7 +4680,7 @@ class OptimizeForLoopOperation: public CppQuickFixOperation
|
|||||||
public:
|
public:
|
||||||
OptimizeForLoopOperation(const CppQuickFixInterface &interface, const ForStatementAST *forAst,
|
OptimizeForLoopOperation(const CppQuickFixInterface &interface, const ForStatementAST *forAst,
|
||||||
const bool optimizePostcrement, const ExpressionAST *expression,
|
const bool optimizePostcrement, const ExpressionAST *expression,
|
||||||
const FullySpecifiedType type)
|
const FullySpecifiedType &type)
|
||||||
: CppQuickFixOperation(interface)
|
: CppQuickFixOperation(interface)
|
||||||
, m_forAst(forAst)
|
, m_forAst(forAst)
|
||||||
, m_optimizePostcrement(optimizePostcrement)
|
, m_optimizePostcrement(optimizePostcrement)
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
/// Move word camel case wise from current cursor position until given token (not included)
|
/// Move word camel case wise from current cursor position until given token (not included)
|
||||||
/// and execute the tokenActions for each new position.
|
/// and execute the tokenActions for each new position.
|
||||||
static void moveWordCamelCaseToToken(TranslationUnit *translationUnit, Token token,
|
static void moveWordCamelCaseToToken(TranslationUnit *translationUnit, const Token &token,
|
||||||
CPPEditor *editor, const Actions &tokenActions);
|
CPPEditor *editor, const Actions &tokenActions);
|
||||||
|
|
||||||
static void undoAllChangesAndCloseAllEditors();
|
static void undoAllChangesAndCloseAllEditors();
|
||||||
@@ -282,8 +282,10 @@ void TestActionsTestCase::executeActionsOnEditorWidget(CPPEditorWidget *editorWi
|
|||||||
QApplication::processEvents();
|
QApplication::processEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TestActionsTestCase::moveWordCamelCaseToToken(TranslationUnit *translationUnit, Token token,
|
void TestActionsTestCase::moveWordCamelCaseToToken(TranslationUnit *translationUnit,
|
||||||
CPPEditor *editor, const Actions &tokenActions)
|
const Token &token,
|
||||||
|
CPPEditor *editor,
|
||||||
|
const Actions &tokenActions)
|
||||||
{
|
{
|
||||||
QVERIFY(translationUnit);
|
QVERIFY(translationUnit);
|
||||||
QVERIFY(editor);
|
QVERIFY(editor);
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ public:
|
|||||||
};
|
};
|
||||||
|
|
||||||
F2TestCase(CppEditorAction action,
|
F2TestCase(CppEditorAction action,
|
||||||
const QList<TestDocumentPtr> testFiles,
|
const QList<TestDocumentPtr> &testFiles,
|
||||||
const OverrideItemList &expectedVirtualFunctionProposal = OverrideItemList());
|
const OverrideItemList &expectedVirtualFunctionProposal = OverrideItemList());
|
||||||
|
|
||||||
private:
|
private:
|
||||||
@@ -238,7 +238,7 @@ private:
|
|||||||
/// Exactly one test document must be provided that contains '$', the target position marker.
|
/// Exactly one test document must be provided that contains '$', the target position marker.
|
||||||
/// It can be the same document.
|
/// It can be the same document.
|
||||||
F2TestCase::F2TestCase(CppEditorAction action,
|
F2TestCase::F2TestCase(CppEditorAction action,
|
||||||
const QList<TestDocumentPtr> testFiles,
|
const QList<TestDocumentPtr> &testFiles,
|
||||||
const OverrideItemList &expectedVirtualFunctionProposal)
|
const OverrideItemList &expectedVirtualFunctionProposal)
|
||||||
{
|
{
|
||||||
QVERIFY(succeededSoFar());
|
QVERIFY(succeededSoFar());
|
||||||
|
|||||||
Reference in New Issue
Block a user