Commit 278eb8f9 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

CppEditor: Pass some values by reference



Change-Id: I18af0c97c22ef2189ebaeaacd32030b22f838c3d
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@digia.com>
parent ee26fdf3
......@@ -124,7 +124,7 @@ static QByteArray &removeTrailingWhitespace(QByteArray &input)
/// 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.
QuickFixTestCase::QuickFixTestCase(const QList<QuickFixTestDocument::Ptr> theTestFiles,
QuickFixTestCase::QuickFixTestCase(const QList<QuickFixTestDocument::Ptr> &theTestFiles,
CppQuickFixFactory *factory,
const QStringList &includePaths,
int resultIndex)
......
......@@ -72,7 +72,7 @@ public:
class QuickFixTestCase : public TestCase
{
public:
QuickFixTestCase(const QList<QuickFixTestDocument::Ptr> theTestFiles,
QuickFixTestCase(const QList<QuickFixTestDocument::Ptr> &theTestFiles,
CppQuickFixFactory *factory,
const QStringList &includePaths = QStringList(),
int resultIndex = 0);
......
......@@ -4163,7 +4163,7 @@ public:
};
MoveFuncDefOutsideOp(const QSharedPointer<const CppQuickFixAssistInterface> &interface,
MoveType type, FunctionDefinitionAST *funcDef, const QString cppFileName)
MoveType type, FunctionDefinitionAST *funcDef, const QString &cppFileName)
: CppQuickFixOperation(interface, 0)
, m_funcDef(funcDef)
, m_type(type)
......@@ -4297,9 +4297,9 @@ class MoveFuncDefToDeclOp : public CppQuickFixOperation
{
public:
MoveFuncDefToDeclOp(const QSharedPointer<const CppQuickFixAssistInterface> &interface,
const QString fromFileName, const QString toFileName,
FunctionDefinitionAST *funcDef, const QString declText,
const ChangeSet::Range toRange)
const QString &fromFileName, const QString &toFileName,
FunctionDefinitionAST *funcDef, const QString &declText,
const ChangeSet::Range &toRange)
: CppQuickFixOperation(interface, 0)
, m_fromFileName(fromFileName)
, m_toFileName(toFileName)
......@@ -4680,7 +4680,7 @@ class OptimizeForLoopOperation: public CppQuickFixOperation
public:
OptimizeForLoopOperation(const CppQuickFixInterface &interface, const ForStatementAST *forAst,
const bool optimizePostcrement, const ExpressionAST *expression,
const FullySpecifiedType type)
const FullySpecifiedType &type)
: CppQuickFixOperation(interface)
, m_forAst(forAst)
, m_optimizePostcrement(optimizePostcrement)
......
......@@ -116,7 +116,7 @@ public:
private:
/// Move word camel case wise from current cursor position until given token (not included)
/// 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);
static void undoAllChangesAndCloseAllEditors();
......@@ -282,8 +282,10 @@ void TestActionsTestCase::executeActionsOnEditorWidget(CPPEditorWidget *editorWi
QApplication::processEvents();
}
void TestActionsTestCase::moveWordCamelCaseToToken(TranslationUnit *translationUnit, Token token,
CPPEditor *editor, const Actions &tokenActions)
void TestActionsTestCase::moveWordCamelCaseToToken(TranslationUnit *translationUnit,
const Token &token,
CPPEditor *editor,
const Actions &tokenActions)
{
QVERIFY(translationUnit);
QVERIFY(editor);
......
......@@ -225,7 +225,7 @@ public:
};
F2TestCase(CppEditorAction action,
const QList<TestDocumentPtr> testFiles,
const QList<TestDocumentPtr> &testFiles,
const OverrideItemList &expectedVirtualFunctionProposal = OverrideItemList());
private:
......@@ -238,7 +238,7 @@ private:
/// Exactly one test document must be provided that contains '$', the target position marker.
/// It can be the same document.
F2TestCase::F2TestCase(CppEditorAction action,
const QList<TestDocumentPtr> testFiles,
const QList<TestDocumentPtr> &testFiles,
const OverrideItemList &expectedVirtualFunctionProposal)
{
QVERIFY(succeededSoFar());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment