Patch #2966 2010-03-29 01:18
loaden
Add astyle's features: --pad-header, update Astyle to 1.24 R- Download
- 2966-Add_astyle_s_f.patch (3.7 KB)
Index: src/plugins/astyle/astyleconfigdlg.cpp
===================================================================
--- src/plugins/astyle/astyleconfigdlg.cpp (revision 6196)
+++ src/plugins/astyle/astyleconfigdlg.cpp (working copy)
@@ -224,6 +224,7 @@
XRCCTRL(*this, "chkPadOperators", wxCheckBox)->Enable(!en);
XRCCTRL(*this, "chkPadParensOut", wxCheckBox)->Enable(!en);
XRCCTRL(*this, "chkPadParensIn", wxCheckBox)->Enable(!en);
+ XRCCTRL(*this, "chkPadHeader", wxCheckBox)->Enable(!en);
XRCCTRL(*this, "chkUnpadParens", wxCheckBox)->Enable(!en);
XRCCTRL(*this, "chkKeepComplex", wxCheckBox)->Enable(!en);
XRCCTRL(*this, "chkKeepBlocks", wxCheckBox)->Enable(!en);
@@ -310,6 +311,7 @@
XRCCTRL(*this, "chkPadOperators", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_operators"), false));
XRCCTRL(*this, "chkPadParensIn", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_parentheses_in"), false));
XRCCTRL(*this, "chkPadParensOut", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_parentheses_out"), false));
+ XRCCTRL(*this, "chkPadHeader", wxCheckBox)->SetValue(cfg->ReadBool(_T("/pad_header"), false));
XRCCTRL(*this, "chkUnpadParens", wxCheckBox)->SetValue(cfg->ReadBool(_T("/unpad_parentheses"), false));
XRCCTRL(*this, "chkKeepComplex", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_complex"), false));
XRCCTRL(*this, "chkKeepBlocks", wxCheckBox)->SetValue(cfg->ReadBool(_T("/keep_blocks"), false));
@@ -365,6 +367,7 @@
cfg->Write(_T("/pad_operators"), XRCCTRL(*this, "chkPadOperators", wxCheckBox)->GetValue());
cfg->Write(_T("/pad_parentheses_in"), XRCCTRL(*this, "chkPadParensIn", wxCheckBox)->GetValue());
cfg->Write(_T("/pad_parentheses_out"), XRCCTRL(*this, "chkPadParensOut", wxCheckBox)->GetValue());
+ cfg->Write(_T("/pad_header"), XRCCTRL(*this, "chkPadHeader", wxCheckBox)->GetValue());
cfg->Write(_T("/unpad_parentheses"), XRCCTRL(*this, "chkUnpadParens", wxCheckBox)->GetValue());
cfg->Write(_T("/keep_complex"), XRCCTRL(*this, "chkKeepComplex", wxCheckBox)->GetValue());
cfg->Write(_T("/keep_blocks"), XRCCTRL(*this, "chkKeepBlocks", wxCheckBox)->GetValue());
Index: src/plugins/astyle/formattersettings.cpp
===================================================================
--- src/plugins/astyle/formattersettings.cpp (revision 6196)
+++ src/plugins/astyle/formattersettings.cpp (working copy)
@@ -137,6 +137,7 @@
formatter.setOperatorPaddingMode(cfg->ReadBool(_T("/pad_operators")));
formatter.setParensOutsidePaddingMode(cfg->ReadBool(_T("/pad_parentheses_out")));
formatter.setParensInsidePaddingMode(cfg->ReadBool(_T("/pad_parentheses_in")));
+ formatter.setParensHeaderPaddingMode(cfg->ReadBool(_T("/pad_header")));
formatter.setParensUnPaddingMode(cfg->ReadBool(_T("/unpad_parentheses")));
formatter.setSingleStatementsMode(!cfg->ReadBool(_T("/keep_complex")));
formatter.setBreakOneLineBlocksMode(!cfg->ReadBool(_T("/keep_blocks")));
Index: src/plugins/astyle/resources/configuration.xrc
===================================================================
--- src/plugins/astyle/resources/configuration.xrc (revision 6196)
+++ src/plugins/astyle/resources/configuration.xrc (working copy)
@@ -325,6 +325,13 @@
<border>8</border>
</object>
<object class="sizeritem">
+ <object class="wxCheckBox" name="chkPadHeader">
+ <label>Insert space padding after paren headers only</label>
+ </object>
+ <flag>wxTOP|wxALIGN_LEFT|wxALIGN_TOP</flag>
+ <border>8</border>
+ </object>
+ <object class="sizeritem">
<object class="wxCheckBox" name="chkUnpadParens">
<label>Remove extra space padding around parenthesis</label>
</object>
History
loaden 2010-03-29 01:18
Introduction and discussion: http://forums.codeblocks.org/index.php/topic,12279.0.html