* set the variables for each predefined style. * this will override any previous settings. */
| 308 | * this will override any previous settings. |
| 309 | */ |
| 310 | void ASFormatter::fixOptionVariableConflicts() |
| 311 | { |
| 312 | if (formattingStyle == STYLE_ALLMAN) |
| 313 | { |
| 314 | setBracketFormatMode(BREAK_MODE); |
| 315 | } |
| 316 | else if (formattingStyle == STYLE_JAVA) |
| 317 | { |
| 318 | setBracketFormatMode(ATTACH_MODE); |
| 319 | } |
| 320 | else if (formattingStyle == STYLE_KR) |
| 321 | { |
| 322 | setBracketFormatMode(LINUX_MODE); |
| 323 | } |
| 324 | else if (formattingStyle == STYLE_STROUSTRUP) |
| 325 | { |
| 326 | setBracketFormatMode(STROUSTRUP_MODE); |
| 327 | } |
| 328 | else if (formattingStyle == STYLE_WHITESMITH) |
| 329 | { |
| 330 | setBracketFormatMode(BREAK_MODE); |
| 331 | setBracketIndent(true); |
| 332 | setClassIndent(true); |
| 333 | setSwitchIndent(true); |
| 334 | } |
| 335 | else if (formattingStyle == STYLE_BANNER) |
| 336 | { |
| 337 | setBracketFormatMode(ATTACH_MODE); |
| 338 | setBracketIndent(true); |
| 339 | setClassIndent(true); |
| 340 | setSwitchIndent(true); |
| 341 | } |
| 342 | else if (formattingStyle == STYLE_GNU) |
| 343 | { |
| 344 | setBracketFormatMode(BREAK_MODE); |
| 345 | setBlockIndent(true); |
| 346 | } |
| 347 | else if (formattingStyle == STYLE_LINUX) |
| 348 | { |
| 349 | setBracketFormatMode(LINUX_MODE); |
| 350 | // always for Linux style |
| 351 | setMinConditionalIndentOption(MINCOND_ONEHALF); |
| 352 | } |
| 353 | else if (formattingStyle == STYLE_HORSTMANN) |
| 354 | { |
| 355 | setBracketFormatMode(RUN_IN_MODE); |
| 356 | setSwitchIndent(true); |
| 357 | } |
| 358 | else if (formattingStyle == STYLE_1TBS) |
| 359 | { |
| 360 | setBracketFormatMode(LINUX_MODE); |
| 361 | setAddBracketsMode(true); |
| 362 | setRemoveBracketsMode(false); |
| 363 | } |
| 364 | else if (formattingStyle == STYLE_GOOGLE) |
| 365 | { |
| 366 | setBracketFormatMode(ATTACH_MODE); |
| 367 | setModifierIndent(true); |
nothing calls this directly
no outgoing calls
no test coverage detected