|
|
514c855 |
From: Jens Lody <fedora@jenslody.de>
|
|
|
29526d3 |
Date: Tue, 14 Feb 2017 14:04:51 +0100
|
|
|
514c855 |
Subject: Backport of changes for astyle 2.06
|
|
|
514c855 |
|
|
|
514c855 |
diff -Nru a/src/plugins/astyle/astyleconfigdlg.cpp b/src/plugins/astyle/astyleconfigdlg.cpp
|
|
|
514c855 |
--- a/src/plugins/astyle/astyleconfigdlg.cpp 2016-01-23 17:43:22.000000000 +0100
|
|
|
514c855 |
+++ b/src/plugins/astyle/astyleconfigdlg.cpp 2017-02-14 13:23:37.904786473 +0100
|
|
|
514c855 |
@@ -245,6 +245,20 @@
|
|
|
514c855 |
XRCCTRL(*this, "rbGoogle", wxRadioButton)->SetValue(true);
|
|
|
514c855 |
break;
|
|
|
514c855 |
#undef AS_GOOGLE
|
|
|
514c855 |
+#define AS_MOZILLA "\
|
|
|
514c855 |
+int Foo(bool isBar)\n\
|
|
|
514c855 |
+{\n\
|
|
|
514c855 |
+ if (isBar) {\n\
|
|
|
514c855 |
+ bar();\n\
|
|
|
514c855 |
+ return 1;\n\
|
|
|
514c855 |
+ } else\n\
|
|
|
514c855 |
+ return 0;\n\
|
|
|
514c855 |
+}"
|
|
|
514c855 |
+ case aspsMozilla:
|
|
|
514c855 |
+ sample = _T(AS_MOZILLA);
|
|
|
514c855 |
+ XRCCTRL(*this, "rbMozilla", wxRadioButton)->SetValue(true);
|
|
|
514c855 |
+ break;
|
|
|
514c855 |
+#undef AS_MOZILLA
|
|
|
514c855 |
#define AS_PICO "\
|
|
|
514c855 |
int Foo(bool isBar)\n\
|
|
|
514c855 |
{ if (isBar)\n\
|
|
|
514c855 |
@@ -305,6 +319,8 @@
|
|
|
514c855 |
SetStyle(asps1TBS);
|
|
|
514c855 |
else if (event.GetId() == XRCID("rbGoogle"))
|
|
|
514c855 |
SetStyle(aspsGoogle);
|
|
|
514c855 |
+ else if (event.GetId() == XRCID("rbMozilla"))
|
|
|
514c855 |
+ SetStyle(aspsMozilla);
|
|
|
514c855 |
else if (event.GetId() == XRCID("rbPico"))
|
|
|
514c855 |
SetStyle(aspsPico);
|
|
|
514c855 |
else if (event.GetId() == XRCID("rbLisp"))
|
|
|
514c855 |
@@ -362,6 +378,7 @@
|
|
|
514c855 |
XRCCTRL(*this, "chkAttachInlines", wxCheckBox)->SetValue(cfg->ReadBool(_T("/attach_inlines"), false));
|
|
|
514c855 |
|
|
|
514c855 |
XRCCTRL(*this, "spnIndentation", wxSpinCtrl)->SetValue(cfg->ReadInt(_T("/indentation"), 4));
|
|
|
514c855 |
+ XRCCTRL(*this, "spnContinuation", wxSpinCtrl)->SetValue(cfg->ReadInt(_T("/continuation"), 0));
|
|
|
514c855 |
XRCCTRL(*this, "chkUseTab", wxCheckBox)->SetValue(cfg->ReadBool(_T("/use_tabs"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkForceUseTabs", wxCheckBox)->SetValue(cfg->ReadBool(_T("/force_tabs"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkIndentCase", wxCheckBox)->SetValue(cfg->ReadBool(_T("/indent_case"), false));
|
|
|
514c855 |
@@ -383,7 +400,8 @@
|
|
|
514c855 |
XRCCTRL(*this, "chkAddOneLineBrackets", wxCheckBox)->SetValue(cfg->ReadBool(_T("/add_one_line_brackets"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkRemoveBrackets", wxCheckBox)->SetValue(cfg->ReadBool(_T("/remove_brackets"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkKeepBlocks", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_blocks"), false));
|
|
|
514c855 |
- XRCCTRL(*this, "chkKeepComplex", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_complex"), false));
|
|
|
514c855 |
+ XRCCTRL(*this, "chkKeepHeaders", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_headers"), false));
|
|
|
514c855 |
+ XRCCTRL(*this, "chkKeepStatements", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_statements"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkConvertTabs", wxCheckBox)->SetValue(cfg->ReadBool(_T("/convert_tabs"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkCloseTemplates", wxCheckBox)->SetValue(cfg->ReadBool(_T("/close_templates"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkRemoveCommentPrefix", wxCheckBox)->SetValue(cfg->ReadBool(_T("/remove_comment_prefix"), false));
|
|
|
514c855 |
@@ -392,17 +410,26 @@
|
|
|
514c855 |
XRCCTRL(*this, "chkBreakAfterLogical", wxCheckBox)->SetValue(cfg->ReadBool(_T("/break_after_mode"), false));
|
|
|
514c855 |
|
|
|
514c855 |
if (XRCCTRL(*this, "chkBreakLines", wxCheckBox)->GetValue())
|
|
|
514c855 |
+ {
|
|
|
514c855 |
XRCCTRL(*this, "txtMaxLineLength", wxTextCtrl)->Enable();
|
|
|
514c855 |
+ XRCCTRL(*this, "chkBreakAfterLogical", wxCheckBox)->Enable();
|
|
|
514c855 |
+ }
|
|
|
514c855 |
else
|
|
|
514c855 |
+ {
|
|
|
514c855 |
XRCCTRL(*this, "txtMaxLineLength", wxTextCtrl)->Disable();
|
|
|
514c855 |
+ XRCCTRL(*this, "chkBreakAfterLogical", wxCheckBox)->Disable();
|
|
|
514c855 |
+ }
|
|
|
514c855 |
+
|
|
|
514c855 |
|
|
|
514c855 |
XRCCTRL(*this, "chkBreakBlocks", wxCheckBox)->SetValue(cfg->ReadBool(_T("/break_blocks"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkBreakBlocksAll", wxCheckBox)->SetValue(cfg->ReadBool(_T("/break_blocks_all"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkPadOperators", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_operators"), false));
|
|
|
514c855 |
- XRCCTRL(*this, "chkPadParensOut", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_parentheses_out"), false));
|
|
|
514c855 |
- XRCCTRL(*this, "chkPadParensIn", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_parentheses_in"), false));
|
|
|
514c855 |
+ XRCCTRL(*this, "chkPadParenOut", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_parentheses_out"), false));
|
|
|
514c855 |
+ XRCCTRL(*this, "chkPadParenIn", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_parentheses_in"), false));
|
|
|
514c855 |
+ XRCCTRL(*this, "chkPadFirstParenOut", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_first_paren_out"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkPadHeader", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_header"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkUnpadParens", wxCheckBox)->SetValue(cfg->ReadBool(_T("/unpad_parentheses"), false));
|
|
|
514c855 |
+ XRCCTRL(*this, "chkPadComma", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_comma"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkDelEmptyLine", wxCheckBox)->SetValue(cfg->ReadBool(_T("/delete_empty_lines"), false));
|
|
|
514c855 |
XRCCTRL(*this, "chkFillEmptyLines", wxCheckBox)->SetValue(cfg->ReadBool(_T("/fill_empty_lines"), false));
|
|
|
514c855 |
XRCCTRL(*this, "cmbPointerAlign", wxComboBox)->SetValue(cfg->Read(_T("/pointer_align"), _T("None")));
|
|
|
514c855 |
@@ -455,6 +482,7 @@
|
|
|
514c855 |
cfg->Write(_T("/attach_inlines"), XRCCTRL(*this, "chkAttachInlines", wxCheckBox)->GetValue());
|
|
|
514c855 |
|
|
|
514c855 |
cfg->Write(_T("/indentation"), XRCCTRL(*this, "spnIndentation", wxSpinCtrl)->GetValue());
|
|
|
514c855 |
+ cfg->Write(_T("/continuation"), XRCCTRL(*this, "spnContinuation", wxSpinCtrl)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/use_tabs"), XRCCTRL(*this, "chkUseTab", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/force_tabs"), XRCCTRL(*this, "chkForceUseTabs", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/indent_case"), XRCCTRL(*this, "chkIndentCase", wxCheckBox)->GetValue());
|
|
|
514c855 |
@@ -465,7 +493,7 @@
|
|
|
514c855 |
cfg->Write(_T("/indent_switches"), XRCCTRL(*this, "chkIndentSwitches", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/indent_preproc_block"), XRCCTRL(*this, "chkIndentPreprocBlock", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/indent_preproc_define"), XRCCTRL(*this, "chkIndentPreprocDefine", wxCheckBox)->GetValue());
|
|
|
514c855 |
- cfg->Write(_T("/indent_preprocessor_cond"), XRCCTRL(*this, "chkIndentPreprocCond", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ cfg->Write(_T("/indent_preproc_cond"), XRCCTRL(*this, "chkIndentPreprocCond", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/indent_col1_comments"), XRCCTRL(*this, "chkIndentCol1Comments", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/min_conditional_indent"), XRCCTRL(*this, "spnMinConditionalEvent", wxSpinCtrl)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/max_instatement_indent"), XRCCTRL(*this, "txtMaxInStatementIndent",wxTextCtrl)->GetValue());
|
|
|
514c855 |
@@ -476,7 +504,8 @@
|
|
|
514c855 |
cfg->Write(_T("/add_one_line_brackets"), XRCCTRL(*this, "chkAddOneLineBrackets", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/remove_brackets"), XRCCTRL(*this, "chkRemoveBrackets", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/keep_blocks"), XRCCTRL(*this, "chkKeepBlocks", wxCheckBox)->GetValue());
|
|
|
514c855 |
- cfg->Write(_T("/keep_complex"), XRCCTRL(*this, "chkKeepComplex", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ cfg->Write(_T("/keep_headers"), XRCCTRL(*this, "chkKeepHeaders", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ cfg->Write(_T("/keep_statements"), XRCCTRL(*this, "chkKeepStatements", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/convert_tabs"), XRCCTRL(*this, "chkConvertTabs", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/close_templates"), XRCCTRL(*this, "chkCloseTemplates", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/remove_comment_prefix"), XRCCTRL(*this, "chkRemoveCommentPrefix", wxCheckBox)->GetValue());
|
|
|
514c855 |
@@ -487,10 +516,12 @@
|
|
|
514c855 |
cfg->Write(_T("/break_blocks"), XRCCTRL(*this, "chkBreakBlocks", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/break_blocks_all"), XRCCTRL(*this, "chkBreakBlocksAll", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/pad_operators"), XRCCTRL(*this, "chkPadOperators", wxCheckBox)->GetValue());
|
|
|
514c855 |
- cfg->Write(_T("/pad_parentheses_out"), XRCCTRL(*this, "chkPadParensOut", wxCheckBox)->GetValue());
|
|
|
514c855 |
- cfg->Write(_T("/pad_parentheses_in"), XRCCTRL(*this, "chkPadParensIn", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ cfg->Write(_T("/pad_parentheses_out"), XRCCTRL(*this, "chkPadParenOut", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ cfg->Write(_T("/pad_parentheses_in"), XRCCTRL(*this, "chkPadParenIn", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ cfg->Write(_T("/pad_first_paren_out"), XRCCTRL(*this, "chkPadFirstParenOut", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/pad_header"), XRCCTRL(*this, "chkPadHeader", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/unpad_parentheses"), XRCCTRL(*this, "chkUnpadParens", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ cfg->Write(_T("/pad_comma"), XRCCTRL(*this, "chkPadComma", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/delete_empty_lines"), XRCCTRL(*this, "chkDelEmptyLine", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/fill_empty_lines"), XRCCTRL(*this, "chkFillEmptyLines", wxCheckBox)->GetValue());
|
|
|
514c855 |
cfg->Write(_T("/pointer_align"), XRCCTRL(*this, "cmbPointerAlign", wxComboBox)->GetValue());
|
|
|
514c855 |
diff -Nru a/src/plugins/astyle/astylepredefinedstyles.h b/src/plugins/astyle/astylepredefinedstyles.h
|
|
|
514c855 |
--- a/src/plugins/astyle/astylepredefinedstyles.h 2016-01-23 17:43:22.000000000 +0100
|
|
|
514c855 |
+++ b/src/plugins/astyle/astylepredefinedstyles.h 2017-02-14 13:24:27.029238200 +0100
|
|
|
514c855 |
@@ -20,6 +20,7 @@
|
|
|
514c855 |
aspsHorstmann,
|
|
|
514c855 |
asps1TBS,
|
|
|
514c855 |
aspsGoogle,
|
|
|
514c855 |
+ aspsMozilla,
|
|
|
514c855 |
aspsPico,
|
|
|
514c855 |
aspsLisp,
|
|
|
514c855 |
aspsCustom
|
|
|
514c855 |
diff -Nru a/src/plugins/astyle/dlgformattersettings.cpp b/src/plugins/astyle/dlgformattersettings.cpp
|
|
|
514c855 |
--- a/src/plugins/astyle/dlgformattersettings.cpp 2016-01-23 17:43:22.000000000 +0100
|
|
|
514c855 |
+++ b/src/plugins/astyle/dlgformattersettings.cpp 2017-02-14 13:24:58.326167038 +0100
|
|
|
514c855 |
@@ -51,6 +51,8 @@
|
|
|
514c855 |
formatter.setFormattingStyle(astyle::STYLE_1TBS);
|
|
|
514c855 |
else if (XRCCTRL(*m_dlg, "rbGoogle", wxRadioButton)->GetValue())
|
|
|
514c855 |
formatter.setFormattingStyle(astyle::STYLE_GOOGLE);
|
|
|
514c855 |
+ else if (XRCCTRL(*m_dlg, "rbMozilla", wxRadioButton)->GetValue())
|
|
|
514c855 |
+ formatter.setFormattingStyle(astyle::STYLE_MOZILLA);
|
|
|
514c855 |
else if (XRCCTRL(*m_dlg, "rbPico", wxRadioButton)->GetValue())
|
|
|
514c855 |
formatter.setFormattingStyle(astyle::STYLE_PICO);
|
|
|
514c855 |
else if (XRCCTRL(*m_dlg, "rbLisp", wxRadioButton)->GetValue())
|
|
|
514c855 |
@@ -63,12 +65,15 @@
|
|
|
514c855 |
|
|
|
514c855 |
bool value = XRCCTRL(*m_dlg, "chkForceUseTabs", wxCheckBox)->GetValue();
|
|
|
514c855 |
int spaceNum = XRCCTRL(*m_dlg, "spnIndentation", wxSpinCtrl)->GetValue();
|
|
|
514c855 |
-
|
|
|
514c855 |
if (XRCCTRL(*m_dlg, "chkUseTab", wxCheckBox)->GetValue())
|
|
|
514c855 |
formatter.setTabIndentation(spaceNum, value);
|
|
|
514c855 |
else
|
|
|
514c855 |
formatter.setSpaceIndentation(spaceNum);
|
|
|
514c855 |
|
|
|
514c855 |
+ int contNum = XRCCTRL(*m_dlg, "spnContinuation", wxSpinCtrl)->GetValue();
|
|
|
514c855 |
+ if (contNum>0 && contNum<=4)
|
|
|
514c855 |
+ formatter.setContinuationIndentation(contNum);
|
|
|
514c855 |
+
|
|
|
514c855 |
formatter.setCaseIndent(XRCCTRL(*m_dlg, "chkIndentCase", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setClassIndent(XRCCTRL(*m_dlg, "chkIndentClasses", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setLabelIndent(XRCCTRL(*m_dlg, "chkIndentLabels", wxCheckBox)->GetValue());
|
|
|
514c855 |
@@ -89,7 +94,8 @@
|
|
|
514c855 |
formatter.setAddOneLineBracketsMode(XRCCTRL(*m_dlg, "chkAddOneLineBrackets", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setRemoveBracketsMode(XRCCTRL(*m_dlg, "chkRemoveBrackets", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setBreakOneLineBlocksMode(!XRCCTRL(*m_dlg, "chkKeepBlocks", wxCheckBox)->GetValue());
|
|
|
514c855 |
- formatter.setSingleStatementsMode(!XRCCTRL(*m_dlg, "chkKeepComplex", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ formatter.setBreakOneLineHeadersMode(!XRCCTRL(*m_dlg, "chkKeepHeaders", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ formatter.setBreakOneLineStatementsMode(!XRCCTRL(*m_dlg, "chkKeepStatements", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setTabSpaceConversionMode(XRCCTRL(*m_dlg, "chkConvertTabs", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setCloseTemplatesMode(XRCCTRL(*m_dlg, "chkCloseTemplates", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setStripCommentPrefix(XRCCTRL(*m_dlg, "chkRemoveCommentPrefix", wxCheckBox)->GetValue());
|
|
|
514c855 |
@@ -105,10 +111,12 @@
|
|
|
514c855 |
formatter.setBreakBlocksMode(XRCCTRL(*m_dlg, "chkBreakBlocks", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setBreakClosingHeaderBlocksMode(XRCCTRL(*m_dlg, "chkBreakBlocksAll", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setOperatorPaddingMode(XRCCTRL(*m_dlg, "chkPadOperators", wxCheckBox)->GetValue());
|
|
|
514c855 |
- formatter.setParensOutsidePaddingMode(XRCCTRL(*m_dlg, "chkPadParensOut", wxCheckBox)->GetValue());
|
|
|
514c855 |
- formatter.setParensInsidePaddingMode(XRCCTRL(*m_dlg, "chkPadParensIn", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ formatter.setParensOutsidePaddingMode(XRCCTRL(*m_dlg, "chkPadParenOut", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ formatter.setParensInsidePaddingMode(XRCCTRL(*m_dlg, "chkPadParenIn", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ formatter.setParensFirstPaddingMode(XRCCTRL(*m_dlg, "chkPadFirstParenOut", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setParensHeaderPaddingMode(XRCCTRL(*m_dlg, "chkPadHeader", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setParensUnPaddingMode(XRCCTRL(*m_dlg, "chkUnpadParens", wxCheckBox)->GetValue());
|
|
|
514c855 |
+ formatter.setCommaPaddingMode(XRCCTRL(*m_dlg, "chkPadComma", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setDeleteEmptyLinesMode(XRCCTRL(*m_dlg, "chkDelEmptyLine", wxCheckBox)->GetValue());
|
|
|
514c855 |
formatter.setEmptyLineFill(XRCCTRL(*m_dlg, "chkFillEmptyLines", wxCheckBox)->GetValue());
|
|
|
514c855 |
|
|
|
514c855 |
diff -Nru a/src/plugins/astyle/formattersettings.cpp b/src/plugins/astyle/formattersettings.cpp
|
|
|
514c855 |
--- a/src/plugins/astyle/formattersettings.cpp 2016-01-23 17:43:22.000000000 +0100
|
|
|
514c855 |
+++ b/src/plugins/astyle/formattersettings.cpp 2017-02-14 13:25:30.889815288 +0100
|
|
|
514c855 |
@@ -78,6 +78,10 @@
|
|
|
514c855 |
formatter.setFormattingStyle(astyle::STYLE_GOOGLE);
|
|
|
514c855 |
break;
|
|
|
514c855 |
|
|
|
514c855 |
+ case aspsMozilla: // Mozilla
|
|
|
514c855 |
+ formatter.setFormattingStyle(astyle::STYLE_MOZILLA);
|
|
|
514c855 |
+ break;
|
|
|
514c855 |
+
|
|
|
514c855 |
case aspsPico: // Pico
|
|
|
514c855 |
formatter.setFormattingStyle(astyle::STYLE_PICO);
|
|
|
514c855 |
break;
|
|
|
514c855 |
@@ -102,6 +106,10 @@
|
|
|
514c855 |
else
|
|
|
514c855 |
formatter.setSpaceIndentation(spaceNum);
|
|
|
514c855 |
|
|
|
514c855 |
+ int contNum = cfg->ReadInt(_T("/continuation"), 0);
|
|
|
514c855 |
+ if (contNum>0 && contNum<=4)
|
|
|
514c855 |
+ formatter.setContinuationIndentation(contNum);
|
|
|
514c855 |
+
|
|
|
514c855 |
formatter.setCaseIndent(cfg->ReadBool(_T("/indent_case")));
|
|
|
514c855 |
formatter.setClassIndent(cfg->ReadBool(_T("/indent_classes")));
|
|
|
514c855 |
formatter.setLabelIndent(cfg->ReadBool(_T("/indent_labels")));
|
|
|
514c855 |
@@ -121,7 +129,8 @@
|
|
|
514c855 |
formatter.setAddOneLineBracketsMode(cfg->ReadBool(_T("/add_one_line_brackets")));
|
|
|
514c855 |
formatter.setRemoveBracketsMode(cfg->ReadBool(_T("/remove_brackets")));
|
|
|
514c855 |
formatter.setBreakOneLineBlocksMode(!cfg->ReadBool(_T("/keep_blocks")));
|
|
|
514c855 |
- formatter.setSingleStatementsMode(!cfg->ReadBool(_T("/keep_complex")));
|
|
|
514c855 |
+ formatter.setBreakOneLineHeadersMode(!cfg->ReadBool(_T("/keep_headers")));
|
|
|
514c855 |
+ formatter.setBreakOneLineStatementsMode(!cfg->ReadBool(_T("/keep_statements")));
|
|
|
514c855 |
formatter.setTabSpaceConversionMode(cfg->ReadBool(_T("/convert_tabs")));
|
|
|
514c855 |
formatter.setCloseTemplatesMode(cfg->ReadBool(_T("/close_templates")));
|
|
|
514c855 |
formatter.setStripCommentPrefix(cfg->ReadBool(_T("/remove_comment_prefix")));
|
|
|
514c855 |
@@ -139,8 +148,10 @@
|
|
|
514c855 |
formatter.setOperatorPaddingMode(cfg->ReadBool(_T("/pad_operators")));
|
|
|
514c855 |
formatter.setParensOutsidePaddingMode(cfg->ReadBool(_T("/pad_parentheses_out")));
|
|
|
514c855 |
formatter.setParensInsidePaddingMode(cfg->ReadBool(_T("/pad_parentheses_in")));
|
|
|
514c855 |
+ formatter.setParensFirstPaddingMode(cfg->ReadBool(_T("/pad_first_paren_out")));
|
|
|
514c855 |
formatter.setParensHeaderPaddingMode(cfg->ReadBool(_T("/pad_header")));
|
|
|
514c855 |
formatter.setParensUnPaddingMode(cfg->ReadBool(_T("/unpad_parentheses")));
|
|
|
514c855 |
+ formatter.setCommaPaddingMode(cfg->ReadBool(_T("/pad_comma")));
|
|
|
514c855 |
formatter.setDeleteEmptyLinesMode(cfg->ReadBool(_T("/delete_empty_lines")));
|
|
|
514c855 |
formatter.setEmptyLineFill(cfg->ReadBool(_T("/fill_empty_lines")));
|
|
|
514c855 |
|
|
|
514c855 |
diff -Nru a/src/plugins/astyle/resources/configuration.xrc b/src/plugins/astyle/resources/configuration.xrc
|
|
|
514c855 |
--- a/src/plugins/astyle/resources/configuration.xrc 2016-01-23 17:43:22.000000000 +0100
|
|
|
514c855 |
+++ b/src/plugins/astyle/resources/configuration.xrc 2017-02-14 13:22:06.261061943 +0100
|
|
|
514c855 |
@@ -109,6 +109,13 @@
|
|
|
514c855 |
<border>5</border>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<object class="sizeritem">
|
|
|
514c855 |
+ <object class="wxRadioButton" name="rbMozilla">
|
|
|
514c855 |
+ <label>Mozilla</label>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <flag>wxTOP|wxLEFT|wxRIGHT|wxALIGN_LEFT</flag>
|
|
|
514c855 |
+ <border>5</border>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <object class="sizeritem">
|
|
|
514c855 |
<object class="wxRadioButton" name="rbPico">
|
|
|
514c855 |
<label>Pico</label>
|
|
|
514c855 |
<tooltip>Pico style uses run-in brackets and attached closing brackets. Opening brackets are broken and allow run-in statements. The closing bracket is attached to the last line in the block. Switches are indented to allow a run-in to the opening switch block. The style implies keep-one-line-blocks and keep-one-line-statements. If add-brackets is used they will be added as one-line brackets. This style frequently is used with an indent of 2 spaces.</tooltip>
|
|
|
514c855 |
@@ -257,8 +264,29 @@
|
|
|
514c855 |
<border>5</border>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<object class="sizeritem">
|
|
|
514c855 |
+ <object class="wxBoxSizer">
|
|
|
514c855 |
+ <object class="sizeritem">
|
|
|
514c855 |
+ <object class="wxStaticText" name="ID_STATICTEXT7">
|
|
|
514c855 |
+ <label>Continuation indent for line ending with '(' or assignment '='</label>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <flag>wxALIGN_CENTER_VERTICAL</flag>
|
|
|
514c855 |
+ <border>5</border>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <object class="sizeritem">
|
|
|
514c855 |
+ <object class="wxSpinCtrl" name="spnContinuation">
|
|
|
514c855 |
+ <value>0</value>
|
|
|
514c855 |
+ <max>4</max>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <flag>wxLEFT|wxALIGN_CENTER_VERTICAL</flag>
|
|
|
514c855 |
+ <border>5</border>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <flag>wxTOP|wxALIGN_LEFT</flag>
|
|
|
514c855 |
+ <border>5</border>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <object class="sizeritem">
|
|
|
514c855 |
<object class="wxCheckBox" name="chkIndentCase">
|
|
|
514c855 |
- <label>Indent case: statement in switches (commands under case:)</label>
|
|
|
514c855 |
+ <label>Indent case statement in switches (commands under case:)</label>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<flag>wxTOP|wxALIGN_LEFT</flag>
|
|
|
514c855 |
<border>5</border>
|
|
|
514c855 |
@@ -413,7 +441,7 @@
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<object class="sizeritem">
|
|
|
514c855 |
<object class="wxCheckBox" name="chkRemoveBrackets">
|
|
|
514c855 |
- <label>Remove brackets from conditional statements (ingle statement on a single line)</label>
|
|
|
514c855 |
+ <label>Remove brackets from conditional statements (single statement on a single line)</label>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<flag>wxTOP|wxALIGN_LEFT</flag>
|
|
|
514c855 |
<border>5</border>
|
|
|
514c855 |
@@ -426,8 +454,15 @@
|
|
|
514c855 |
<border>5</border>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<object class="sizeritem">
|
|
|
514c855 |
- <object class="wxCheckBox" name="chkKeepComplex">
|
|
|
514c855 |
- <label>Don't break complex statements and multiple statements residing in a single line</label>
|
|
|
514c855 |
+ <object class="wxCheckBox" name="chkKeepHeaders">
|
|
|
514c855 |
+ <label>Break one-line headers</label>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <flag>wxTOP|wxALIGN_LEFT</flag>
|
|
|
514c855 |
+ <border>5</border>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <object class="sizeritem">
|
|
|
514c855 |
+ <object class="wxCheckBox" name="chkKeepStatements">
|
|
|
514c855 |
+ <label>Break one-line statements</label>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<flag>wxTOP|wxALIGN_LEFT</flag>
|
|
|
514c855 |
<border>5</border>
|
|
|
514c855 |
@@ -529,15 +564,22 @@
|
|
|
514c855 |
<border>5</border>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<object class="sizeritem">
|
|
|
514c855 |
- <object class="wxCheckBox" name="chkPadParensOut">
|
|
|
514c855 |
- <label>Insert space padding around parenthesies on the outside</label>
|
|
|
514c855 |
+ <object class="wxCheckBox" name="chkPadParenOut">
|
|
|
514c855 |
+ <label>Insert space padding around parentheses on the outside</label>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <flag>wxTOP|wxALIGN_LEFT</flag>
|
|
|
514c855 |
+ <border>5</border>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <object class="sizeritem">
|
|
|
514c855 |
+ <object class="wxCheckBox" name="chkPadParenIn">
|
|
|
514c855 |
+ <label>Insert space padding around parentheses on the inside</label>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<flag>wxTOP|wxALIGN_LEFT</flag>
|
|
|
514c855 |
<border>5</border>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<object class="sizeritem">
|
|
|
514c855 |
- <object class="wxCheckBox" name="chkPadParensIn">
|
|
|
514c855 |
- <label>Insert space padding around parenthesies on the inside</label>
|
|
|
514c855 |
+ <object class="wxCheckBox" name="chkPadFirstParenOut">
|
|
|
514c855 |
+ <label>Insert space padding around the first paren in a series on the outside only</label>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<flag>wxTOP|wxALIGN_LEFT</flag>
|
|
|
514c855 |
<border>5</border>
|
|
|
514c855 |
@@ -551,7 +593,14 @@
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<object class="sizeritem">
|
|
|
514c855 |
<object class="wxCheckBox" name="chkUnpadParens">
|
|
|
514c855 |
- <label>Remove extra space padding around parenthesis</label>
|
|
|
514c855 |
+ <label>Remove extra space padding around parentheses</label>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <flag>wxTOP|wxALIGN_LEFT</flag>
|
|
|
514c855 |
+ <border>5</border>
|
|
|
514c855 |
+ </object>
|
|
|
514c855 |
+ <object class="sizeritem">
|
|
|
514c855 |
+ <object class="wxCheckBox" name="chkPadComma">
|
|
|
514c855 |
+ <label>Insert space padding after commas (not needed if pad-operators is used)</label>
|
|
|
514c855 |
</object>
|
|
|
514c855 |
<flag>wxTOP|wxALIGN_LEFT</flag>
|
|
|
514c855 |
<border>5</border>
|