bug 11072 - fix problems with formatting around const functions RCL_2_4
authordadubrow
Mon, 12 Apr 2010 15:01:49 -0500
branchRCL_2_4
changeset 138 e0657161c0cc
parent 132 3720b50bf185
child 139 3b27a90d6161
bug 11072 - fix problems with formatting around const functions
cdt/cdt_6_0_x/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java
--- a/cdt/cdt_6_0_x/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java	Wed Feb 10 13:31:11 2010 -0600
+++ b/cdt/cdt_6_0_x/org.eclipse.cdt.ui/src/org/eclipse/cdt/internal/ui/text/CIndenter.java	Mon Apr 12 15:01:49 2010 -0500
@@ -833,7 +833,7 @@
 					} else if ((prevToken == Symbols.TokenEQUAL || prevToken == Symbols.TokenRBRACKET) &&
 							!fPrefs.prefIndentBracesForArrays) {
 						cancelIndent= true;
-					} else if (prevToken == Symbols.TokenRPAREN && fPrefs.prefIndentBracesForMethods) {
+					} else if ((prevToken == Symbols.TokenRPAREN || prevToken == Symbols.TokenCONST) && fPrefs.prefIndentBracesForMethods) {
 						extraIndent= 1;
 					} else if (prevToken == Symbols.TokenIDENT && fPrefs.prefIndentBracesForTypes) {
 						extraIndent= 1;
@@ -1035,6 +1035,13 @@
 		case Symbols.TokenTRY:
 			return skipToStatementStart(danglingElse, false);
 
+		case Symbols.TokenCONST:
+			nextToken();
+			if (fToken != Symbols.TokenRPAREN) {
+				return skipToPreviousListItemOrListStart();
+			}
+			// could be const method decl
+			//$FALL-THROUGH$
 		case Symbols.TokenRPAREN:
 			if (skipScope(Symbols.TokenLPAREN, Symbols.TokenRPAREN)) {
 				int scope= fPosition;