diff options
author | Christian Kandeler <christian.kandeler@qt.io> | 2021-02-05 13:12:41 +0100 |
---|---|---|
committer | Christian Kandeler <christian.kandeler@qt.io> | 2021-02-08 15:19:31 +0000 |
commit | 33d2d736ea4f52725c0714064f5380277181e9a2 (patch) | |
tree | 51b49c3c1a4cfb31cf7f716d6180c4ba8a8a568a /src/plugins/cppeditor/cppquickfix_test.cpp | |
parent | 8cd9300eda37c21f3f1f444e4183c245885ff6f5 (diff) | |
download | qt-creator-33d2d736ea4f52725c0714064f5380277181e9a2.tar.gz |
CppEditor: Do not add redundant access specifier
... when inserting a member function declaration for a definition.
Fixes: QTCREATORBUG-5591
Change-Id: Ie85b435a1595832d0085abdcc0a4187d939820e0
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/cppeditor/cppquickfix_test.cpp')
-rw-r--r-- | src/plugins/cppeditor/cppquickfix_test.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/cppeditor/cppquickfix_test.cpp b/src/plugins/cppeditor/cppquickfix_test.cpp index 7bfdf5b7ba..5ba0101b39 100644 --- a/src/plugins/cppeditor/cppquickfix_test.cpp +++ b/src/plugins/cppeditor/cppquickfix_test.cpp @@ -4707,6 +4707,9 @@ void insertToSectionDeclFromDef(const QByteArray §ion, int sectionIndex) QByteArray original; QByteArray expected; + QByteArray sectionString = section + ":\n"; + if (sectionIndex == 4) + sectionString.clear(); // Header File original = @@ -4716,7 +4719,7 @@ void insertToSectionDeclFromDef(const QByteArray §ion, int sectionIndex) expected = "class Foo\n" "{\n" - + section + ":\n" + + + sectionString + " Foo();\n" "@};\n"; testDocuments << QuickFixTestDocument::create("file.h", original, expected); |