CppEditor: quickfix for conversion between pointer and stack variable

The ConvertFromAndToPointer quickfix allows to convert a pointer to a
stack variable and vice versa. The initializer of the declaration is
adjusted. Member accesses change to . or -> accordingly.
Usages of the & and * operators are automatically fixed.

Task-number: QTCREATORBUG-9598
Task-number: QTCREATORBUG-12733
Change-Id: I388a9bd32179c79bff808615299a91a225acea64
Reviewed-by: Nikolai Kosjar <nikolai.kosjar@digia.com>
This commit is contained in:
Joerg Bornemann
2013-09-26 12:02:46 +02:00
parent ab9d5ab535
commit d7449a0097
4 changed files with 462 additions and 0 deletions

View File

@@ -459,6 +459,17 @@ public:
void match(const CppQuickFixInterface &interface, TextEditor::QuickFixOperations &result);
};
/*!
Converts the selected variable to a pointer if it is a stack variable or reference, or vice versa.
Activates on variable declarations.
*/
class ConvertFromAndToPointer : public CppQuickFixFactory
{
public:
void match(const CppQuickFixInterface &interface, TextEditor::QuickFixOperations &result);
};
/*!
Adds getter and setter functions for a member variable
*/